Hey All-
I'm developing an application using the ModelDriven approach. On of my
forms is a grid style data entry page and I'm having a difficult time
getting validation to work. I used the approach specified by Patrick
Lightbody (http://struts.apache.org/2.0.11/docs/type-conversion.html) for
handling the rendering and updating of collections. With this approach my
validations aren't firing. I tried using the VisitorFieldValidator to push
the validations out to the Model but that isn't working.
The code that populates the edit grid is along the following lines:
<s:iterator id="category" value="productCategories">
<tr>
<td><s:textfield name="productCategories(%{id}).sortOrder"
value="%{sortOrder}" size="2" cssClass="txt"/></td>
</tr>
</s:iterator>
The object graph underlying all this looks like this:
BrandAction->Brand->ProductCategory
The Brand is the model returned by the BrandAction's getModel() method.
I have my validation configuration files defined in the same package as the
model classes and a validation configuration file defined for the action
with the visitor validator defined within it:
<validators>
<field name="productCategories">
<field-validator type="visitor">
true
</field-validator>
</field>
</validators>
Has anyone successfully got declarative validation working with indexed
properties? Can anyone suggest what I might be doing wrong here?
--
View this message in context:
http://www.nabble.com/-S2--Indexed-properties%2C-Type-Conversion-and-Validation-tp14654165p14654165.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]