0 Replies Latest reply on Jun 19, 2009 7:17 PM by rogermorituesta.rogermori.yahoo.com

    Navigation and Global messages lost when ue:include added to seam-gen ..Edit.xhtml

    rogermorituesta.rogermori.yahoo.com

      Dear community members: .


      I’m creating a facelets include button-bar. to replace the buttons Save, Delete and Cancel within all the edit views (someEntityEdit.xhtml) generated by seam-gen . 


      This composition works but the global messages (Successfully updated, etc) are lost (see log error below) . 


      To make it work, I changed the navigation rules .


      It is critical for my project to have this kind of compositions, and appreciate any ideas.


      Thank you.


      These are the details.


      Error log


      
      ...WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
      sourceId=null[severity=(INFO 0), summary=(Successfully updated), detail=(Successfully updated)]
      
      




      Edit view



       <ui:include src="/inc/bar/EditBar.xhtml" >
                  <ui:param name="ENTITY_HOME" value="#{generalTypeHome}" />
                  <ui:param name="CALLED_FROM_VIEW" value="/#{empty    generalTypeFrom ? 'GeneralTypeList' : generalTypeFrom}.xhtml" />
             </ui:include>
      



      Include Composition


      <!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"
          >
          
              <rich:panel>
                     
                       <div class="actionButtons">
                            <h:commandButton id="save"
                                          value="#{messages['label.save']}"
                                         action="#{ENTITY_HOME.persist}"
                                       disabled="#{!ENTITY_HOME.wired}"
                                       style="#{BUTTON_STYLE}"
                                       rendered="#{!ENTITY_HOME.managed}"/>
                            <rich:spacer width="15" rendered="#{!ENTITY_HOME.managed}" />
                            <h:commandButton id="update"
                                          value="#{messages['label.save']}"
                                          style="#{BUTTON_STYLE}"
                                         action="#{ENTITY_HOME.update}"
                                         
                                       rendered="#{ENTITY_HOME.managed}"/>
                            <rich:spacer width="15" rendered="#{ENTITY_HOME.managed}"/> 
                            <h:commandButton id="delete"
                                          value="#{messages['label.delete']}"
                                          style="#{BUTTON_STYLE}"
                                         action="#{ENTITY_HOME.remove}"
                                      immediate="true"
                                       rendered="#{ENTITY_HOME.managed}"/>
                            <rich:spacer width="15" rendered="#{ENTITY_HOME.managed}"/>
                            <s:button id="cancelEdit"
                                   value="#{messages['label.cancel']}"
                                   style="#{BUTTON_STYLE}"
                             propagation="end"
                                    view="/GeneralType.xhtml"
                                rendered="#{ENTITY_HOME.managed}"/>
                            <rich:spacer width="15" rendered="#{ENTITY_HOME.managed}"/>
                            <s:button id="cancelAdd"
                                   value="#{messages['label.cancel']}"
                                   style="#{BUTTON_STYLE}"
                             propagation="end"
                                    view="#{CALLED_FROM_VIEW}"
                                rendered="#{!ENTITY_HOME.managed}"/>
                        </div>
           </rich:panel>
              
      
      </ui:composition>
      



      Changed navigation rules on page xml descriptor



      <?xml version="1.0" encoding="UTF-8"?>
      <page xmlns="http://jboss.com/products/seam/pages"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.1.xsd"
            no-conversation-view-id="/GeneralTypeList.xhtml"
            login-required="true">
      
         <begin-conversation join="true" flush-mode="MANUAL"/>
      
         <action execute="#{generalTypeHome.wire}" on-postback="false"/>
      
         <param name="generalTypeFrom"/>
         <param name="generalTypeId" value="#{generalTypeHome.generalTypeId}"/>
         
      
      
         <navigation from-action="#{ENTITY_HOME.persist}">
            <rule if-outcome="persisted">
               <end-conversation/>
               <redirect view-id="/GeneralType.xhtml"/>
            </rule>
         </navigation>
      
         <navigation from-action="#{ENTITY_HOME.update}">
            <rule if-outcome="updated">
               <end-conversation/>
               <redirect view-id="/GeneralType.xhtml"/>
            </rule>
         </navigation>
      
         <navigation from-action="#{ENTITY_HOME.remove}">
            <rule if-outcome="removed">
               <end-conversation/>
               <redirect view-id="/GeneralTypeList.xhtml"/>
            </rule>
         </navigation>
      
      </page>
      
      




      Thank you.