Hi Johan

JavaScript is not an option, we need server side processing. I've tried it with a converter, but the getConverter() method is only called if it's a typed field, else I have to use convertValue()... But this still doesn't solve my problem as they're called from within Form.updateFormComponentModels() which means, the components are only just converting now and I cannot know if both fields I need to consider have already converted and I won't just add it to the second one in the code as it could be rearranged any time... What i'd need would be something that's called after all fields have converted but before they're stored anywhere... Which I don't think exists. Converters aren't really meant to be dependent from other fields as you never know if the other field even converted its value up to now - order matters and can ruin your day then....

Any other idea? I just can't believe my situation is so uncommon.......?!

Thanks

Matt

Johan Compagner wrote:
You have simple Behaviors that can alter values through java script in
the browser and you have converters that converts a value at the
server side, validators are ment for validation of a value that is
converted by a convertor not for changing data.

On 10/13/08, Matthias Keller <[EMAIL PROTECTED]> wrote:
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




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
[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


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to