Hi all,
** sorry for duplicate post**
I want to validate some PropertySelections that are contained within a
For loop, like this:
HTML:
<form jwcid="form">
<span jwcid="myLoop">
<select jwcid="popList" />
</span>
</form>
PAGE:
<bean name="delegate"
class="my.package.MyCustomValidationDelegate"/>
<component id="form" type="Form">
<binding name="listener" value="listener:onFormSubmit"/>
<binding name="delegate" value="beans.delegate"/> </component>
<property name="currentDetail"/>
<component id="myLoop" type="For">
<binding name="source" value="ognl:record.details"/>
<binding name="value" value="ognl:currentDetail"/>
</component>
<component id="popList" type="PropertySelection">
<binding name="model" value="ognl:scoresModel" />
<binding name="value" value="ognl:currentDetail.score"/>
<binding name="validators" value="validators:myOwnValidator"/>
</component>
What I would like to do in my java class now, is: get hold of each
individual submitted propertySelection, validate it and if the
validation fails, add some decoration in the html to it. (The decoration
will be handled by my validation delegate). Something like this:
...some code to get hold of each submitted propertyselection value (I
tried looping through the delegates getFieldTracking-List, but strangely
only the form items that are outside the loop appear to be in that list...
.. and then:
.. some code to validate
.. and then, when validation fails:
delegate.setFormComponent((IFormComponent)
componentThatFailedValidation ));
delegate.recordFieldInputValue(theValue);
delegate.record(someMessage,null);
... in order to have the delegate show the error message and add
decoration to the html.
So, my main question is: How does one get hold of an individual instance
of a component within a for loop?
Thanks for any advice,
Martijn
--
*Cumquat Information Technology*
De Dreef 19
3706 BR Zeist
T +31 (0)30 - 6940490
F +31 (0)10 - 6940499
http://www.cumquat.nl <http://www.cumquat.nl/>
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
M +31 6 22 384 318
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]