The CreatorCon Call for Content is officially open! Get started here.

Changing Catalog Item Variable order via script

Staxed
Giga Guru

I'm pretty sure this is possible using g_form.setVisible(fieldname,boolean) to change the order of the variable, but I'm not sure exactly how I should be coding it.

I currently have a variable set that is being used in dozens of other catalog items, so I can't change the order in the set as it would affect some other things I don't want affected...so I'm thinking I should use a Catalog Item UI Script to get what I want done.

Currently the user selects their preferred contact type from (email, pager, cell phone, desk phone), everything works as expected.

However, if the user selects anything other than email, I would still like the email to show as a secondary contact method.  I have this working, but the issue is because email is set above the other fields in the variable set, it's showing above their selected contact method instead of below it...that's what I'm trying to fix.

 

This is what it currently looks like, I'm just trying to change this so that email shows under phone instead of above it (without making the order change in the variable set).

find_real_file.png

1 ACCEPTED SOLUTION

Sorry no. The page is already rendered, rendered in order. the UI scripts can only show / hide, make mandatory or not and set value, set options but not changing the rendered page.

however if you set it to allow dom manipulation then you can some things to the rendered page, things normally not possible with the SN OOB options.

But again, although possible, you should not want to do this. SN support if it goes wrong will be limited. There will be a real change of it breaking after an update.

Again, if you really want it, then I would advice to look into if you cannot just change the order within the variable set. I would even prefer a clone of the variable set for just this item with a changed order over the dom manipulation. 

Only reason I would do the dom part is on a PDI, just to show it is possible, never als a production solution.

View solution in original post

5 REPLIES 5

Sorry no. The page is already rendered, rendered in order. the UI scripts can only show / hide, make mandatory or not and set value, set options but not changing the rendered page.

however if you set it to allow dom manipulation then you can some things to the rendered page, things normally not possible with the SN OOB options.

But again, although possible, you should not want to do this. SN support if it goes wrong will be limited. There will be a real change of it breaking after an update.

Again, if you really want it, then I would advice to look into if you cannot just change the order within the variable set. I would even prefer a clone of the variable set for just this item with a changed order over the dom manipulation. 

Only reason I would do the dom part is on a PDI, just to show it is possible, never als a production solution.