2 Replies Latest reply on Apr 19, 2013 3:23 AM by Michal Rejda

    EL expressions in f:convertNumber currencyCode not working

    Waldo Nell Newbie
      I am using Seam 2.2.0GA. In my code I have this:

      <h:outputText value="#{tx.debits}">
        <f:convertNumber currencyCode="#{tx.currencyCode}" groupingUsed="true" maxFractionDigits="2" minFractionDigits="2" type="currency" />
      </h:outputText>

      tx.debits contains the value 10.2
      tx.currencyCode contains XXX (ISO standard for no currency)

      Problem is - when this code is executed I get this error:

      party_transaction_list_form:j_id227:0:j_id242: Could not convert '0' to a string.

      Most likely because tx.getCurrencyCode() is never called - I verified that that getter is never called by EL.  If I write this for testing:

      <h:outputText value="#{tx.currencyCode}">
        <f:convertNumber currencyCode="#{tx.currencyCode}" groupingUsed="true" maxFractionDigits="2" minFractionDigits="2" type="currency" />
      </h:outputText>

      Then I see the currency value XXX printed ad the getter called, so I know my backing bean is fine.

      Any suggestions?