Search code examples
pega

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?

enter image description here


Solution

  • 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 Value 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.