6 Replies Latest reply on Oct 13, 2007 7:31 AM by fred.lamuette

    Newbie question

    fred.lamuette

      Hi all,
      I hope you could help me because there is something trivial I cant do.

      <h:form>
      ...
      <s:decorate id="code_decorator" template="/layout/edit2.xhtml">
      <ui:define name="label">Code</ui:define>
      <h:inputText id="code" value="#{myAction.code}" required="true" >
      <a:support event="onchange" actionListener="#{myAction.queryCode}" reRender="address" ajaxSingle="true" eventsQueue="form"/>
      <a:support event="onblur" reRender="code_decorator" ajaxSingle="true" limitToList="true" eventsQueue="form"/>
      ...
      <h:inputText id="address" value="#{myAction.address}" required="true" size="22" maxlength="20" />
      ...
      </h:form>
      

      When I change the value of the field 'code', then press tab, nothing appears for my input text 'address'.
      What is the solution?
      Thank you.

        • 1. Re: Newbie question
          ilya_shaikovsky

          Are you sure that s:decorate has representation in DOM when no errors exist.. try to surround your update area with a4j:outputPanel and update it.

          • 2. Re: Newbie question
            fred.lamuette

             

            "ilya_shaikovsky" wrote:
            Are you sure that s:decorate has representation in DOM when no errors exist.. try to surround your update area with a4j:outputPanel and update it.


            Actually the complete code is
            <h:form>
            ...
            <s:decorate id="code_decorator" template="/layout/edit2.xhtml">
            <ui:define name="label">Code</ui:define>
            <h:inputText id="code" value="#{myAction.code}" required="true" >
            <a:support event="onchange" actionListener="#{myAction.queryCode}" reRender="address" ajaxSingle="true" eventsQueue="form"/>
            <a:support event="onblur" reRender="code_decorator" ajaxSingle="true" limitToList="true" eventsQueue="form"/>
            </h:inputText>
            </s:decorate>
            ...
            <h:inputText id="address" value="#{myAction.address}" required="true" size="22" maxlength="20" />
            ...
            </h:form>
            


            The method queryCode is well runned with the onchange event, in this method we change the 'adress' attribute (myAction.address), and expect it well rendered in the the inputText id='address'. That's not the case.
            Have you any ideas?

            • 3. Re: Newbie question
              fred.lamuette

              I tried to wrap my input text id='address' in a <a:outputpanel id="panel_address' and change the reRender to 'panel_address'. No success.
              I also want to add that after changing the value of my source input text, nothing appears but simply refreshing the page DOES the expected result !

              • 4. Re: Newbie question
                maksimkaszynski

                Try to remove ajaxSingle attribute from support components - will it work in that case.

                • 5. Re: Newbie question
                  fred.lamuette

                  Hi maksim,
                  I tried to remove ajaxSingle="true" with with no success. I have checked that no validation errors appear in order to execute the listener action.
                  Please can you explain me that when I set the destination input text as disabled, it works like a charm ? :

                  <h:inputText id="address" value="#{myAction.address}" required="true" size="22" maxlength="20" disabled="true"/>
                  


                  I dont know very well JSF, but is it possible that when a submitted value is stored in the input text component in the apply request values phase, this component doesn't refresh with the model data in the render phase?

                  Thank you for your support.


                  • 6. Re: Newbie question
                    fred.lamuette

                    Ok, for those interested in the solution : http://labs.jboss.com/wiki/RichFacesTwoInputText