Hi all,

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




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

Reply via email to