3 Replies Latest reply on Oct 20, 2008 5:45 AM by matinh

    <a4j:support action=

    matinh

      Hi!

      This is a repost as the Ajax4JFS Users Forum is now closed.

      What I want to achieve is to update input elements in a form by selecting an item from a select input. This should act like a template mechanism: select a template => form inputs are filled in with predefined values.

      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

        • 1. Re: <a4j:support action=...> and select input
          matinh

          Sorry for the subject, the forum seems to cut off the subject when double quotes are used...

          • 2. Re: <a4j:support action=
            joblini

            Try adding bypassupdates="false" to the a4j:support.

            • 3. Re: <a4j:support action=
              matinh

              Thanks for your reply, joblini!

              I tried using bypassUpdates="false" and it works now as expected. It works even without this modification, as bypassUpdates' default value seems to be "false" anyway. I guess I broke my earlier code somewhere else while experimenting...

              However, I have one related question: I'm using the code from above in a <rich:dataList>. As I don't need to store the value of the selected item in my bean, I'm looking for a possibility to pass it to the updateFormat() method.

              Any ideas?