Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validate Beans inside FormBean ?

Status
Not open for further replies.

Exie

Programmer
Sep 3, 2003
156
0
0
AU
Hi,

I have an application which has a form bean like so:

[blue]public class WorkplaceForm extends ActionForm {
private String workplaceId;
private WorkplaceBean workplaceBean;
... getters ....
... setters ....
}[/blue]

My problem is, I want to validate some fields in WorkplaceBean which is contained inside my WorkplaceForm.

In the rendered HTML form it refers to the WorkplaceBean like:
[blue]<input type="text" name="workplaceBean.field1" value="0">[/blue]

So in my validation.xml I made the following:
<form-validation>
<formset>
<form name="workplaceForm">
<field property="workplaceBean.field1" depends="required,integer">
<msg name="required" key="errors.missing" />
<msg name="integer" key="errors.integer" />
</field>

.... but id doesnt seem to pick it up.

Any ideas ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top