0 Replies Latest reply on Jun 26, 2009 8:35 AM by Nikola Ninovic

    convertNumber type="currency" is not called by ajax command

    Nikola Ninovic Newbie

      I have a problem with convertNumber and type="currency".

      This is the situation:

      I have two command links. First have to display price in euros, and second have to display price in pounds



      <a4j:commandLink actionListener="#{userSession.settingEuroPrice}" value="Euro Value" reRender="form"/>
      <a4j:commandLink actionListener="#{userSession.settingPoundPrice}" value="Pound Value" reRender="form"/>
      


      And this is the output
      <h:outputText value="#{userSession.price}" >
       <f:convertNumber type="currency" currencySymbol="#{userSession.currencySign}"/>
      </h:outputText>
      


      But when I press command link, my method (userSession.settingEuroPrice) is called, new currency sign is set, but userSession.currencySign is not called until page refresh and currency sign is not displayd.

      If I use h:commandLink instead of a4j:commandLink, everything is works ok

      This is the backing bean
      
       private String currencySign;
       private double price;
      
       public void settingEuroPrice(ActionEvent event){
       currencySign = "\u20AC";
       price = 1000;
       }
      
       public void settingPoundPrice(ActionEvent event){
       currencySign = "\u00A3";
       price = 2000;
       }
      
       public String getCurrencySign() {
       return currencySign;
       }