show/hide a field in g_modal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2025 05:49 PM - edited 02-22-2025 10:42 AM
Hi Community
I'm trying to complete a task. When click the "Reject" button on the Workspace, a popup window will show. On the popup window there're 2 fields: 1. Rejection Reason whose type is choices; 2. Other details whose type is string, When the user choses "Other" from the choices, the 2nd field-other details-will show, otherwise the other details string field will be hidden. At the bottom of the popup window there're 2 buttons: Cancel and Confirm. I created a UI action and used g_modal.showfield.
My question is:
1. how to show/hide the 2nd field based on the value of the 1st field.
2. how to change the default "OK" button label to "Confirm".
==========================================
The client-side UI action Workspace Client script snippet is below:
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2025 10:50 AM - edited 02-22-2025 10:51 AM
As I know there's a workaround that use 2 modals. But is it possible to use just 1 modal? The client doesn't like the 2 modals solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2025 01:41 PM
The Attribute title is the title for the Modal. confirmTitle is the text on the positive button of the modal, cancelTitle is the text on the cancel button. Size can be used to set the size of the modal. Params is an object of attributes that will be passed into our component.
{ title: 'Set Needs Attention on all open Cases', confirmTitle: "Set flag!", cancelTitle: "Cancel", size: 'lg', height: 'lg', params: { contactName: g_form.getValue('first_name') + " " + g_form.getValue('last_name') } }
This way you can change the Modal Button Label Values.