Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

strtus2: howto validate a form where not all fields are mandatory?

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Below I have a class name entity (name, address, type...)
The end-user provides some information but not all fields are mandatory.

Q: how can I have 'name' and 'address' to be mandatory but 'type' can be left out? (using annotation)

thanks!



@Validation
public class CustomizeAction extends BaseSupport
{
private Entity entity = new Entity();
.
.
.
public Entity getEntity()
{
return entity;
}

/// WHAT COMES HERE ?!?
public void setEntity(Entity entity)
{
this.entity = entity;
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic