4 Replies Latest reply on Dec 9, 2008 5:54 AM by ilya_shaikovsky

    a4j:jsFunction question

    gregoryl

      Hi i am using a4j:jsFunction to update some value of my managed bean and after ajax response arrives i am unable to rerender my div(h:panelGroup)
      I have
      <h:panelGroup id="hintDiv" layout="block" rendered="#{ !empty hint.value }" style="color: blue;">HINT: <h:outputText id="passwordHint" value="#{hint.value}" /></h:panelGroup>

      and my function

      <a4j:jsFunction name="updateHint" reRender="hintDiv" >
      <a4j:actionparam name="logname" assignTo="#{hint.logname}" /> </a4j:jsFunction>

      Why my hintDiv isn't rerendered and what to do to successfully update it ?
      Thanks

        • 1. Re: a4j:jsFunction question
          gregoryl

          one more thing:
          i have looked inside ajax response and i see that value from bean is properly fetched and elements for hintDiv element Body replacement have been successfully prepared in response. But when requested elements are indeed present in ajax response, resulting html element is not updated. I don't know why

          • 2. Re: a4j:jsFunction question
            gregoryl

            Does anybody have any idea what is wrong ?

            • 3. Re: a4j:jsFunction question
              shadowcreeper

              Can't really tell, but maybe try putting hintDiv inside another div (which is always rendered) and reRender that new outside div instead.

              If a div was not rendered do to the rendered attribute, you cannot reRender it. This has been stated multiple times in past threads.

              • 4. Re: a4j:jsFunction question
                ilya_shaikovsky

                reRender of conditionally rendered elements not allowed (nothing to update in DOM if the element isn't rendered initially). Define wrapper (outputPanel) and update just the wrapper component.