Search Support
-
Radek SulcFebruary 20, 2017 at 3:37 am #3772
Hi,
is there any way how to set programatically visibility of a control to “Same as parent”?
Thanks, Radek
Andrzej MichalecFebruary 20, 2017 at 4:32 am #3775Radek, since for “none” value is “NONE” then for “same as parent” value is … “DEFAULT” 🙂
regards,
-andy.Tomáš NavrátilFebruary 22, 2017 at 4:44 am #3790Hi all,
I have a suggestion regarding this problem. Spark UI toolkit contains additional CV methods like show(), hide(), setVisible(), setEditable() etc. As far as I know, none of these methods can set visibility state to “same as parent”. It would be nice to have complete set of methods for visibilty handling in the toolkit.
Best regards,
Tomas
SPARK SupportFebruary 22, 2017 at 3:55 pm #3806Hi All,
Lets say I have a Table control placed inside of a Panel both set to “Same as parent”. In that case I can access both with:
tbl = page.ui.get(“Table1”);
pnl = page.ui.get(“Panel1”);
if I check the context options, it will return “DEFAULT”;
tbl.context.options._metadata.visibility.get(“value”);
If I then set the Table visibility to false and back with
tbl.setVisisble(false);
tbl.setVisible(true);
and check the context options again, I will now see that return is “EDITABLE”. Although this is no longer same as parent, if I use
pnl.setVisible(false);
the entire Panel is hidden including the table.
After setting the Panel visible again, I can call tbl.setEnabled(false) to switch the table to read only. Once I begin to change the visibility and and disabled/enabled values, there is no need to set the control back to “Same as parent” since the control is already loaded and no longer needs a Default based on the parent’s condition.
But if you really want to, you can use the context options to set the value back to “DEFAULT” with:
tbl.context.options._metadata.visibility.set(“value”,”DEFAULT”);
Regards,
Stephen P.
Radek SulcFebruary 28, 2017 at 4:54 am #3879Hi there, I was of course looking for some way using SPARK UI API. So if I understand it well there is no such way at least now and workaround is needed – using direct call of Coach View framework API.
Are you going to enrich the SPARK UI API to support setting visibility to DEFAULT?
Thanks,
RadekRadek SulcFebruary 28, 2017 at 4:56 am #3880And I really want to. That’s why I am asking the question 🙂
SPARK SupportMarch 3, 2017 at 11:21 am #3925Hi Radek,
Let me discuss this with the Development Team.
Regards,
Stephen P.
Radek SulcMarch 6, 2017 at 12:13 am #3938Stephen,
the same situation is for DEFAULT and also for REQUIRED which is very often dynamically set/chenged. It would definitely make sense to have one consistent API which is in accordance with OOTB visibility – Default/Same as parent, Required, Editable, Read only, None, Hidden.
Thanks a lot,
Radek
SPARK SupportMarch 10, 2017 at 8:26 am #3968Hi Radek,
I have added a User Story to our Enhancement Request backlog per your request.
Regards,
Stephen P.
-
|
You must be logged in to reply to this topic.