10 Replies Latest reply on Aug 12, 2008 6:44 AM by sebgerpb

    convertNumber not called for components in a table

    sebgerpb

      Hi everyone,

      I have a JSF-Page on which are several text fields (inputText and outputText). Those textfields have a convertNumber tag. The pattern for the convertNumber-Tag is supplied via a method in a backing bean in session scope:

      <h:inputText id="myText">
      <f:convertNumber pattern="#{sessionBean.pattern}"
      </h:inputText>
      


      The method getPattern() in my session bean is similar to the following:

      public String getPattern() {
       if (precision == 2) {
       return "###,##0.00"
       }
       else {
       return "###,##0.0000";
       }
      }
      


      On the JSF-Page, there is a rich:modalPanel where a user can change the precision (2 or 4 digits). The users settings are stored in the same backing bean as the getPattern()-method. After saving the users selection, the whole page gets rerendered by simply providing a navigation outcome that returns to the same page.

      Now, the problem is: some of the inputText fields (and also outputText-fields) are in a table, others are not. The ones which are not in a table read their patterns correctly everytime I change the precision settings. But the ones in the table only read their patterns once when I first call the JSF page. After that, the getPattern()-methode is never called again for those components.
      Some more code for the text fields in the table:


      <table>
      <thead>
      ...make head....
      </thead>
      <tbody>
      <a4j:repeat>
      <tr>
      
      <td>
      <h:inputText id="myText">
      <f:convertNumber pattern="#{sessionBean.pattern}" <-- this only gets called once when first accessing the jsf page, but never afterwards
      </h:inputText>
      </td>
      
      ..some more table cells...
      
      </tr>
      </a4j:repeat>
      </tbody>
      </table>
      


      Yes, I know I do not use a RichFaces data Table or something like this. I already tried using rich:dataTable and rich:scrollableDataTable, it doesn't make any difference.

      Can somebody help me with this problem?

      Best regards
      Sebastian