-
1. Re: Persist not called (after fixing validation errors)
tony.herstell1 Jul 29, 2008 6:53 AM (in response to mjelen)Is it possible to post the xhtml for an offending page.
-
2. Re: Persist not called (after fixing validation errors)
tony.herstell1 Jul 29, 2008 6:58 AM (in response to mjelen)It may help but you could put a controller bean into the mix.
It can be stateless and just called the xxxx.persist.
I must admit I have never called an entity from the
view
; no matter how trivial. -
3. Re: Persist not called (after fixing validation errors)
mjelen Jul 29, 2008 1:13 PM (in response to mjelen)
It may help but you could put a controller bean into the mix.Oh, sorry if that wasn't clear, I am using a controller class that inherits from Seam's EntityHome. It doesn't seem to be a problem there, however, because I got the same results when I created a simple session bean and used it as the target for the button's action.
I tried tracing the problem within RichFaces, it looks like no
button pressed
event is broadcast in the Invoke Application phase (but only when a postback happens due to validation errors prior to this submission).Here's the code of a page where it happens:
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" template="layout/powderpuff.xhtml"> <ui:define name="body"> <h:messages globalOnly="false" styleClass="message" id="globalMessages"/> <h:form id="post" styleClass="edit"> <rich:panel rendered="#{postHome.instance.parent ne null}"> <f:facet name="header">#{messages.inReplyTo}</f:facet> <ui:include src="/discussion/singlePost.xhtml" > <ui:param name="post" value="#{postHome.instance.parent}" /> <ui:param name="repliable" value="false" /> </ui:include> </rich:panel> <rich:panel> <div class="dialog"> <s:validateAll> <s:decorate id="titleDecoration" template="/layout/edit.xhtml"> <ui:define name="label">#{messages.title}</ui:define> <h:inputText id="title" required="true" size="100" value="#{postHome.instance.title}"> <!-- a:support eventsQueue="validationQueue" event="onblur" reRender="titleDecoration"/--> </h:inputText> </s:decorate> <s:decorate id="bodyDecoration" template="/layout/edit.xhtml"> <ui:define name="label">#{messages.body}</ui:define> <h:inputTextarea id="body" cols="60" rows="10" value="#{postHome.instance.body}"> <!-- a:support eventsQueue="validationQueue" event="onblur" reRender="bodyDecoration"/--> </h:inputTextarea> </s:decorate> </s:validateAll><script type="text/javascript"> WYSIWYG.attach('post:bodyDecoration:body',full); </script> </div> <div style="clear: both;"> </div> <div><span class="required">*</span> <h:outputText escape="false" value="#{messages.requiredFields}"/></div> </rich:panel> <div class="actionButtons"> <h:commandButton id="save" value="#{messages.save}" action="#{discussionController.persistPost}" disabled="#{!postHome.wired}" rendered="#{!postHome.managed}"> <s:conversationPropagation type="end"/> </h:commandButton> <h:commandButton id="update" value="#{messages.save}b" action="#{postHome.update}" rendered="#{postHome.managed}"> <s:conversationPropagation type="end"/> </h:commandButton> <h:commandButton id="delete" value="#{messages.delete}" action="#{postHome.remove}" rendered="#{postHome.managed}"> <s:conversationPropagation type="end"/> </h:commandButton> <s:button id="done" value="#{messages.done}" propagation="end" view="/Post.xhtml" rendered="#{postHome.managed}"/> <s:button id="cancel" value="#{messages.cancel}" propagation="end" view="/#{empty postFrom ? 'TopicList' : postFrom}.xhtml" rendered="#{!postHome.managed}"/> </div> </h:form> </ui:define> </ui:composition>
-
4. Re: Persist not called (after fixing validation errors)
mjelen Aug 4, 2008 12:10 AM (in response to mjelen)Never mind.... the solution in my case was to change the conversation propagation settings (to
join
, which is what I use in other places in the application). Now I'm sufficiently new to Seam to say that I don't know why the difference, but the important thing is that it works :).