Is it possible to show a UI Action Button on a form based on a call from another UI Action or Client Script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2012 03:49 AM
I have a UI Action that places a field on a form, sets the enctyption context then hides the button. I would like to then have another button appear on the form that would allow the user to change their mind on the encryption context if they have multiples. I have a condition on another UI button that does that however it will only show up after the form is saved and you go back in. Does the condition of a UI Action only work on form load? Would anyone know if it is possible to call a UI Action from another UI action or from a client script so that I can get the change encryption context button to show after the add button has been clicked and hidden?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2012 05:32 PM
The condition on the button is evaluated at the server, so what you would have to do is remove the condition on the UI Action records and then create an onLoad script that hides the appropriate button. That way both UI Actions are created on the form and can then be manipulated by each other.
So your first button would then show the field, set the encryption context, hide itself and then set the second button to visible. The second button would then do the reverse.
Have not tried it, but should work fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2012 08:24 PM
I'd really like to see a g_form API for hiding UI Actions. Currently the only way is to do it is by maniiuplating the DOM with a Client Script, but that's inherently fragile since the HTML behind UI Actions could change without notice or documentation in any given release. It changed in Aspen, and customers who had hackish (that's maybe too harsh a word, but it's late) Client Scripts relying on the pre-Aspen HTML structure found their scripts no longer functional.
Until such time as there's an API for it, however, it's your only resort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2012 06:09 AM
What I decided to do was to changed the name of my first UI Action and add some logic to it so that it could be used to edit the encryption context if they so chose before saving the form. Now the button sticks around until they save the form and appears to work as expected.
Thank you both for your help with this!