3 Replies Latest reply on Nov 25, 2008 11:39 AM by chawax

    Inconsistent behaviour of messages component with 2.1.0.BETA1

    chawax

      Hi,


      Upgrading from Seam 2.1.0.A1 to 2.1.0.BETA1, I encounter problems with messages built-in Seam component on a specific (and a little complex) XHTML page built with Richfaces components.


      This page is made of two panels : one displaying a treeview, the other displaying details for the selected element in the treeview. To do this, I use reRender property of a4j:commandLink component.


      Here is a simplified extract of the XHTML page :


      <rich:panel>
         <h:panelGrid columns="2" width="100%">
         
         <!-- Tree to display organization structure -->
      
         <a4j:outputPanel id="organizationTreePanel">
            <rich:tree 
                  id="organizationTree"
                  switchType="client"
                  ajaxSubmitSelection="true">
               <rich:recursiveTreeNodesAdaptor 
                     roots="#{organization.rootUnit}" 
                     nodes="#{unit.children}" 
                     var="unit">
                  <rich:treeNode>
                     <a4j:commandLink 
                           value="#{unit.code}" 
                           action="#{organizationCrud.selectOrganizationalUnit(unit)}"
                           ajaxSingle="true"
                           reRender="organizationalUnitDetailsPanel" /> 
                  </rich:treeNode>
               </rich:recursiveTreeNodesAdaptor>
            </rich:tree>
         </a4j:outputPanel>
      
         <!-- Panel to display details of the selected organizational unit -->
      
         <a4j:outputPanel id="organizationalUnitDetailsPanel">
            <h:outputText 
                  value="#{messages['message.noOrganizationalUnit']}" 
                  rendered="#{organizationalUnit.uniqueCode == null}" />
            <h:outputText value="#{messages['label.organizationalUnit.uniqueCode']} :" />
         </a4j:outputPanel>
         </h:panelGrid>
      </rich:panel>



      What happens is that when I click on a tree node, it rerenders details panel, but it looks like messages has an inconsistent behaviour. Sometimes the labels are OK. But most of the time they are wrong and the key of the label is displayed, and not the localized value (for example label.organizationalUnit.uniqueCode while I expected Unique code).


      Not sure this is a problem with Seam, but I have doubts since it used to work with Seam 2.1.0.A1.


      Anyone has an idea ?