Radio Group Clearing out data

  • 25 August 2017
  • 2 replies
  • 1 view

Badge +3

I have a Radio Group that contain elements New, Old and Existing. When clicking on either of these values I have the OnChange rule firing to clear out a fields associated to these values. That way the user can enter data associate to that element.

 

For example:

OnChange Event of RadioGroup1

 

New --> Clears Field1, Field2, Field3. Display Field1
Old -->  Clear Field1, Field2, Field3. Display Field2
Existing --> Clear Field1, Field2, Field3. Display Field3.

 

 

But on the initialization/loading of the form,  the Radio Group OnChange event is automatically fired when SmartObject set the value of the Radio Group and clears out the data I want to display on Field1-3. How do I code to prevent this?


2 replies

Badge +3

It would be possible to create a first initialize check using a parameter with a value (i.e. 0). Then after the full initialize is complete, or at the end of your Form initialize, set the value equal to 1. Only allow your on-change to fire if the parameter = 1. Let me know if that will work for your solution. David

 

- Added by David Aerne

Badge +8

If this rule is firing on initialize the there is a rule telling it to do so. Check the initialize rule and make sure the rule is not listed. If it is then simply disable it. I generally create an unbound rule and call it where I need it. "On Click" or "On Change" generally does not action until a specific control has been actioned.

 

Thanks,

Bryan Peters

Reply