Question


Cognizant Technology Solutions India Ltd.
ES
Last activity: 18 Jul 2017 10:50 EDT
How can we put a boolean(ON OFF) button in a UI? Is there any OOTB control to do this in pega?
***Updated by moderator: Lochan to close post***
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!


Pegasystems Inc.
IN
Hi Tarini,
There is no exact OOTB feature to support this. But I guess you could customize OOTB pxButton with action events to achieve this.
Is there any reason why CheckBox cannot be used for this scenario.


Cognizant Technology Solutions India Ltd.
ES
Hi Pankaj,
Thanks for the suggestion. the reason is user wants a lucrative UI . As in iPhone


Pegasystems Inc.
IN
To achieve exactly what you want I would suggest following steps.
- Find 2 images, one for On and one for Off indicator
- Use a seperate layout to place this button as you would like to refresh this on toggle
- Use pxLink instead of pxButton and don't use Link caption, Just use the image source as property
- Initialize that property with Off image to start with
- On click just configure an action to call Data Transform to Set property with On Image or Off Image (basically toggle)
- On Layout Configure Refresh this layout as Refresh when your property changes
Hope this helps


Pegasystems Inc.
IN


Cognizant Technology Solutions India Ltd.
ES
Hi Phani,
looks good to me. To do this you modified OOTB pxbutton control. I tried set style action set and change color but it didn't work . Can you explain how you implement this?


Pegasystems Inc.
IN
Hi Prasad,
I have created a sample POC for your use case. Please find below the design configuration.
1. Create a section with a Dynamic layout(inline grid double ).
2. In first cell, use an Icon control and refer it to "On" image.
3. In the actions tab of this cell, configure a on click-refresh current section event, with a data transform to set the property( say PropA) value to 0.
4. In the second cell, again use an Icon control and refer it to Off image.
5. In the actions tab of this second cell, configure a on click-refresh current section event, with a data transform to set the property( say PropA) value to 1.
6. In a flow action add the section mentioned above and call a data transform to set the PropA value to 0 (which will always display the Off image, by default).
Please find the reproducible environment details below.
http:// Proprietary information hidden:8080/prweb/PRServlet
[email protected] / rules
Section Name:- MyTestSection
Flow Name:- MyTestFlow
Please let me know, if this is what you are looking for.


Pegasystems Inc.
IN
Ajit - as you know, a parametric data transform to set the property value either to true or false would be easy instead of having two rules.


Pegasystems Inc.
IN
Phani - yes that would be a better option. thanks for your input.