[jboss-user] [JBoss Seam] - Re: Problem with validation and entityHome

fjgarmu do-not-reply at jboss.com
Sat Jan 19 13:00:32 EST 2008


Thanks for ur reply matt.drees.
I try writing a new method mysave in ReportsHome:

  | 	public String mysave(){		
  | 		if (this.getInstance().getRadiologos().getId()==0 && this.getInstance().getReportstatus().getId()>=4){
  | 			this.addFacesMessage("ERROR");	        
  | 			return "error";
  | 		}else{
  | 			super.update();
  | 			return null;
  | 		}
  | 	}
  | 
In the JSF page the method is called by a <s:button>

  |             <s:button id="mysave" 
  |                    value="mysave"
  |                     action="#{reportsHome.mysave}"
  |                     view="/Reports.xhtml"
  |                 rendered="#{reportsHome.managed}"/>
  | 

The behaviour is: the values are saved even when the ERROR message is raised and the application goes to "Reports.xhtml" page, even when the parameters aren't valid and the super.update method is not called.
Why?
How could I do it for don't save it when the values are not correct?
Thanks in advance.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121526#4121526

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121526



More information about the jboss-user mailing list