onLoad in UI Policy not working

roy_walton
Mega Guru

Hello,

The onLoad functionality in one of my Catalog UI Policies doesn't seem to be working as expected. The policy is set so that if WebcastSetup_StreamingPref = Live Only (the default), then 3 of the variables on the form should be hidden, and 6 fields should be changed to non-mandatory. However, even though I have onLoad = True for the UI Policy, the variables are only hidden if I change WebcastSetup_StreamingPref to a different option, then back to Live Only.

I've attached a screenshot -- any help would be appreciated.

Thanks,

Roy

1 ACCEPTED SOLUTION

roy_walton
Mega Guru

Thanks Tony for the ideas -- you were on the right track. I looked at another catalog item that had similar logic but was much simpler (it's only hiding/showing one variable), and realized it was because of a line at the end of a client script that un-hid the variable -- the script set a filter on the variable, which is a slushbucket. Both catalog items were using similar UI policies and client scripts.


View solution in original post

3 REPLIES 3

tony_fugere
Mega Guru

The limited screenshot you provided looks sound, but it only paints half of the picture.

Do you have the "on load" checkbox set to true? (obvious questions first)

If you change the value in that variable and cause the UI Policy to fire from an onChange event, does it work?

Do you have any competition in other Catalog UI Policies? Or do you have any Catalog UI Policies or Client Scripts that could be throwing an error. If a Client Script or other UI Policy is causing a JavaScript error on the browser, it may stop all other JS from processing. If this UI Policy is, by chance, set to run after something else (Client Scripts are not guaranteed to run in a specific order), then it could cause this UI Policy to be skipped.


roy_walton
Mega Guru

Thanks Tony for the ideas -- you were on the right track. I looked at another catalog item that had similar logic but was much simpler (it's only hiding/showing one variable), and realized it was because of a line at the end of a client script that un-hid the variable -- the script set a filter on the variable, which is a slushbucket. Both catalog items were using similar UI policies and client scripts.


Let me know if you need anything else. Be sure to mark this answered if you feel it is (helps those searching the community).