Mike Hale wrote:Mickster wrote:No, incremental validation like that is a pain, for me and the user.I think that would depend on the user. For example, I would much rather a numeric editext control not allow me to enter letters than allow me to do so then only let me know what I was entered is wrong after I have moved on to another control.
The problem is my edittext controls are alphanumeric. They work like Photoshop's. The user can enter a distance or position value in whichever ruler units they choose and the code handles any necessary conversion. The user can also enter a value without a unit designation and the code converts it to the current ruler units for validation. For example, if the current ruler unit is millimeters and the user enters '2' or '2.0' as the value, the code assumes they mean millimeters and appends the corresponding unit designation '2 mm'. However, if the user enters '2.0 pc' or '2 pica' or '2 picas', then the code converts it into the current ruler units before validating the distance value.
The validation and everything else is working fine. The only problem is the inability to set focus when validation fails.
Fix for active and onChange
Fix for active and onChange
I did a little checking into this. It turns out that the control is still active when the onChange() callback is invoked.
As a result, setting the control to active at this point doesn't really matter.
As a result, setting the control to active at this point doesn't really matter.