1 Reply Latest reply on Oct 17, 2008 5:54 AM by Nick Belaevski

    How to get a components new value in a method specified by a

    Martin Höller Newbie

      Hi!

      What I want to achieve is to update a form's input elements by selecting a specific value from a select input. This should act like a template mechanism.

      My idea was to define some select input like <rich:inplaceSelect> with an a4j:support component like this:

      <rich:inplaceSelect defaultLabel="Load from template" value="#{mybean.fmtString}">
       <f:selectItem itemValue="###0" itemLabel="1234"/>
       <f:selectItem itemValue="###0,00" itemLabel="1234,56"/>
       <f:selectItem itemValue="#.##0" itemLabel="1.234"/>
       <f:selectItem itemValue="#.##0,00" itemLabel="1.234,56"/>
       <a4j:support event="onchange"
       action="#{mybean.updateFormat()}"
       reRender="someComponents" />
      </rich:inplaceSelect>
      

      My problem is, whenever mybean.updateFormat() is called the inplaceSelect's value has not been updated. The update seems to happen after the call of updateFormat().

      Does anybody know how I could get the new selected value to my updateFormat() method?

      Many thanks in advance,
      - martin