r_m_sampson
|
Posted: February 04, 2011 23:29 by r_m_sampson
|
|
Great framework, well implemented and very flexible. I have a situation with text fields that can be dynamically enabled or disabled by other controls. I would like to have the validation disabled/enabled with the state of the text field, and it looks like the source code supports that but it does not seem to work. if the control is disabled prior to being added to the Validation Group then it does work, but I cannot get it to do this when the state is changed later on. I have tried calling validate() on the Validation Panel and validateAll() on the Validation Group but it does not seem to make it take notice of the text field state. Adding and removing a chained validation group is an option i guess, but I am hoping there is a way to do it with the text field state. |
Validation of dynamically disabled component
Replies: 2 - Last Post: June 02, 2011 14:56
by: r_m_sampson
by: r_m_sampson
showing 1 - 3 of 3
t-knight
|
Posted: March 07, 2011 09:20 by t-knight
|
|
Hi r_m_sampson, If you don't mind my dumb solution, you can cheat the library by: 1) enabling the component that you want to clear validation problems, 2) setting the input of your component to a valid value. So, the validate() returns true, 3) resetting the input of your component to your desired value or default value. 4) disabling the component. Note that you need to enable the component before you set its value to notify the validator. This approach could be applied to another case where you want the Validation to be activated at start-up time by enabling the component, setting its input to invalid value, disabling the component, and setting the value back to any desired/initialized value. I hope this can help you fix your problem, although it's not an intelligent way. t-knight. |
r_m_sampson
|
Posted: June 02, 2011 14:56 by r_m_sampson
|
|
Hi t-knight, thanks for replying. I think that way is the only solution for now. The framework really needs to be extended to detect changes in the state of a field and disable validation if the component itself becomes disabled. Cheers, Richard. |
Replies: 2 - Last Post: June 02, 2011 14:56
by: r_m_sampson
by: r_m_sampson






