2 Replies Latest reply on Nov 5, 2009 9:37 AM by ahoehma

    ajaxSingle=

    christian_koelle

      I work a lot with conditional rendering, i.e

      <h:ouputText rendered="#{!condition}" .../>
      <h:inputText rendered="#{condition} .../>


      I.e. depending on the condition either this or that is intended to be rendered.

      I noticed that data input in <h:inputText is not written back into the backing bean properly, if I use <a4j:support> on a widget, which inverts the condition, although ajaxSingle=false.

      <a4j:support
       event="onchange"
       ajaxSingle="false"
       reRender="formId ..." />


      If I use the following construct, the input data is submitted properly.

      styleClass="#{(condition) ? ' ' : 'invisible'}">


      Now my question: Is the later workaround the proper practice if I want to show either this or that component?

      Regards and thanks in advance.




        • 1. Re: ajaxSingle=
          ilya_shaikovsky

          rendered condition should be stored between request - to be session or conversation scoped. I think you used request.

          • 2. Re: ajaxSingle=
            ahoehma

            You can try to use the condition at view-creation-time with

            xmlns:c="http://java.sun.com/jstl/core"
            
            <c:if test="#{condition}">
             <h:inputText>
             <a4j:support
             event="onchange"
             ajaxSingle="false"
             reRender="formId ..." />
             </h:inputText>
            </c:if>