[jboss-user] [JBoss Seam] - Re: Problem with validation and entityHome
Thanks for ur answer. I' ve changed the s:button by h:commandButton and in the page.xml I ve written a navigation rule: |navigation from-action=#{reportsHome.mysave} | rule if-outcome=success | end-conversation/ | redirect view-id=/Reports.xhtml/ | /rule | /navigation | It works fine. Thanks a lot. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4121589#4121589 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4121589 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Problem with validation and entityHome
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=bbop=viewtopicp=4121526#4121526 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4121526 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Problem with validation and entityHome
thanks for your quick reply. I try it putting in the ReportsEdit.page.xml begin-conversation join=true flush-mode=MANUAL/ But the behavior is the same. Is it ok? Thanks View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4121533#4121533 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4121533 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Problem with validation and entityHome
Ok. I have: -JSF page: ReportsEdit.xhtml with a button | s:button id=mysave |value=mysave | action=#{reportsHome.mysave} | view=/Reports.xhtml | rendered=#{reportsHome.managed}/ | | -page xml: ReportsEdit.page.xml | !DOCTYPE page PUBLIC | -//JBoss/Seam Pages Configuration DTD 1.2//EN | http://jboss.com/products/seam/pages-1.2.dtd; | | page no-conversation-view-id=/ReportsList.xhtml |login-required=true | |begin-conversation join=true flush-mode=MANUAL/ | |action execute=#{reportsHome.wire}/ | |param name=reportsFrom/ |param name=reportsStudyuid value=#{reportsHome.reportsStudyuid}/ |param name=patientsFrom/ |param name=patientsId value=#{patientsHome.patientsId}/ | |param name=radiologosFrom/ |param name=radiologosId value=#{radiologosHome.radiologosId}/ | |param name=reportstatusFrom/ |param name=reportstatusId value=#{reportstatusHome.reportstatusId}/ | | |navigation from-action=#{reportsHome.persist} |end-conversation/ |redirect view-id=/Reports.xhtml/ |/navigation | |navigation from-action=#{reportsHome.update} |end-conversation/ |redirect view-id=/Reports.xhtml/ |/navigation | |navigation from-action=#{reportsHome.remove} |end-conversation/ |redirect view-id=/PatientsQR.xhtml/ |/navigation | | /page | -Action .java: ReportsHome.java | public String mysave(){ | if (this.getInstance().getRadiologos().getId()==0 | this.getInstance().getReportstatus().getId()=4){ | this.addFacesMessage(ERROR); | return error; | }else{ | super.update(); | return null; | } | } | That's all. Thanks for ur help. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4121552#4121552 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4121552 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Problem with validation and entityHome
Hi everybody, first overall I' m newbie in seam development. I've developed an application generated with seamgen JBOSS-SEAM 1.2.1-GA. The application has a ReportsHome class that extends from EntityHome. | public class ReportsHome extends EntityHomeReports { | ... | } | On the model in the Reports class i ve written a constraint | @AssertFalse(message=You must assign an author before close the report) | public boolean isok(){ | return (authors.getId()==0 reportstatus.getId()=4); | } | In my view i ve put a tag s:validateAll that enclose all the items that must be validated. In theory i think it is all to use validation in seam. But when isok is true the application crashes and go to the debug page. The expected behavior is the message that inform about the assert error. There is something wrong in the application? Thanks in advance. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4119323#4119323 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4119323 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user