1 Reply Latest reply on Aug 28, 2007 5:08 PM by pieter martin

    s:decorate with s:message not displaying

    pieter martin Newbie


      I am trying to display validation messages as per the documentation and the booking example.

      The ajax\hibernate validation works fine but when I check for duplicate manufacturer name on a form submit and add an error message to the injected facesMessages nothing gets displayed.

      if I add a <h:messages /> tag the message does however get displayed.

      I think that for some reason the <s:message /> tag in edit.html is not outing the message.

      Code follows...
      The session bean is a conversation scoped bean. The form submits calls the persist method.

      Any pointers as to what may be wrong?
      BTW it works fine in the booking example on the same instance of jboss.

      <navigation from-action="#{manufacturerManager.persist}">
       <rule if="#{manufacturerManager.manufacturerValid}">
       <redirect view-id="/chemical/manufacturers.xhtml" />
      <s:decorate id="manufacturerNameDecorate" template="../layout/edit.xhtml">
       <ui:define name="label">Name:</ui:define>
       <h:inputText id="manufacturerNameId" value="#{editManufacturer.name}" required="true">
       <a:support event="onblur" reRender="manufacturerNameDecorate"/>
       // @End in pages with rule
       public void persist() {
       List<Manufacturer> existing = em
       "select m.name from Manufacturer m where m.name=#{editManufacturer.name}")
       if (existing.size() == 0) {
       manufacturerNameSearchString = editManufacturer.getName();
       manufacturerValid = true;
       } else {
       "Manufacturer #{editManufacturer.name} already exists");
       manufacturerValid = false;

        • 1. Re: s:decorate with s:message not displaying
          pieter martin Newbie

          Problem solved!

          Had to do with my template.xhtml file.

          In it I have\had

           <f:subview rendered="#{identity.loggedIn and s:hasRole('FARMER') and s:hasRole('AGENT')}">
           <h:panelGrid width="100%">
           <ui:include src="submenu.xhtml">
           <ui:param name="projectName" value="#{agentMasqueradeFarmer.username}"/>
           <ui:insert name="body"/>
           <f:subview rendered="#{not (identity.loggedIn and s:hasRole('FARMER') and s:hasRole('AGENT'))}">
           <ui:insert name="body"/>

          Removing the first <f:subview> makes <s:message> display the message.
          It seems having two f:subviews inserting (depending on mutually exclusive rendering rules) the same body confuses s:message.

          Course I too am confused.

          Whether this is a feature or a bug I dunno.