简体   繁体   中英

I need a Disable a particular input field. How do I do it using Pega?

When the user selects the home address field, the office address should be automatically disabled. On the other hand, when the user selects the office address field, the home address should be automatically disabled. How do I do it using Pega?

在此处输入图像描述

I can suggest two solutions

  1. Hide Home Address and Office Address layouts by default.

    Add one Radio button at top of the address layouts for example Address Type with values Office and Address. If user selects Office address type from radio button then display Office Address Layout. If user selects Home address type from the radio button then display Home address layout.

    Instead of hiding layouts, you can disable the fields as well based on the selected radio button option.

  2. Add Action set on click on the Office Address layout and Home Address layout.

    On click of Home Address layout add On Click action. Add Set Value action and set a flag property as .HomeAddressSelected = true , .OfficeAddressSelected = false and add Post Valu e action after Set Value action. Add Refresh Section action if Post Value action is not working.

    On click of Office Address layout add On Click action. Add Set Value action and set a flag property as .HomeAddressSelected = false , .OfficeAddressSelected = true and add Post Value action after Set Value action. Add Refresh Section action if Post Value action is not working.

    Now add disable condition for each property under Home Address layout as if .HomeAddressSelected == false disable the field. and add disable condition for each property under Office Address layout as if .OfficeAddressSelected == false disable the field.

Try both of the solutions and see yourself which one is business users accepting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM