Timo Rantalaiho wrote:
On Mon, 13 Oct 2008, Matthias Keller wrote:Here's the scenario with two radios and a pulldown: ( ) I don't need anything ( ) I need: [ pulldown with options ]Now if "I need" is selected, everything works as expected, the pulldown value gets stored to the model. Now if 'I dont need anything' is selected, another value for the pulldown needs to be stored in the model. Let's say a marker entry like 'nothing'. I can't have 'nothing' directly in the pulldown as it would make no sense (and the customer explicitly doesn't want that). So in the validator I need to check the status of the radios and if the first option is selected, set the pulldown model's value to my custom value, ignoring any possible input value.I think that you should do it with ajax and custom models instead of validators. It seems like a kludge or at least a strange side effect for a validator to do something like that. Best wishes, Timo
Hi Timo AJAX is not an option, as it is client side.Another scenario would be: User has to enter some data which needs to be stored in a certain way. For example a number needs leading zeros or whatever, it would be good for a validator to a) check that the value is a number and b) on the fly update the value with leading zeros as needed - I guess a converter could do the job but I think that's overkill...? A custom model also is not that easy, at least to my understanding as the model values come from two different components......
Matt -- [EMAIL PROTECTED] +41 44 268 83 98 Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich http://www.ergon.ch ______________________________________________________________ e r g o n smart people - smart software
smime.p7s
Description: S/MIME Cryptographic Signature
