2 Replies Latest reply on Aug 8, 2011 9:32 AM by Richard Wähner

    selectBooleanCheckbox first time rerender

    Richard Wähner Newbie

      Hi,

       

      I've written a popupPanel with a form and a dataTable inside. This dataTable contains a row with selectBooleanCheckbox'es. My problem is, the first time I click one of these checkboxes the check inside is shown shortly and than disappears (I think through the rerender process). The second click in any checkbox leads to the expected result, the check remains in the box and the boolean value is stored in my bean.

       

      Can anybody tell me why it does not work the first but all other time I click on a checkbox. How do I have to change my code to get it work properly?

       

      I've got the same problem with my filter inputText elements in this popupPanel. Their content also disappears the first time I enter something.

       

      I'm using RichFaces 4.0.0.

       

      Thank you

       

      Servlet:

      {code:xml}

      <rich:popupPanel id="assignmentOverlay">

           <h:form id="form">

                <rich:dataTable id="unassignedTemplateList" var="unassignedTemplate">

                     <f:facet name="header>

                     ...

                     </f:facet>

       

                     <rich:column>

                          <h:selectBooleanCheckbox value="#{unassignedTemplate.checked}" valueChangeListener="#{corTopicTemplateCrud.checkboxClicked}">

                                    <a4j:ajax event="change" render=":unassignedTemplateList" immediate="true"/>

                          </h:selectBooleanCheckbox>

                     </rich:column>

                </rich:dataTable>

           </h:form>

      </rich:popupPanel>

      {code}

       

       

      Snippet of my CrudBean:

      {code}

      public void checkboxClicked(ValueChangeEvent event) {

              templates.getRowData().setChecked((Boolean) event.getNewValue());

      }

      {code}

        • 1. Re: selectBooleanCheckbox first time rerender
          Richard Wähner Newbie

          Still looking for help. I have compared the output of both requests (first and second click at the same checkbox). Maybe this helps...

          Differences marked red.

           

          First click, which does not result in expected behaviour:

          RequestContext setup, pushing to Stack..

          RequestContext filter for URL: /bo/pages/correspondence/topic/topicOverview.faces;jsessionid=16EF37670351DD8E22D408A2313F38DD

          Session invalidation filter, pushing to Stack..

          Session invalidation filter for URL: /bo/pages/correspondence/topic/topicOverview.faces;jsessionid=16EF37670351DD8E22D408A2313F38DD

          Before PhaseEvent: RESTORE_VIEW 1

          ActionListener: org.apache.myfaces.extensions.cdi.jsf.impl.listener.action.CodiActionListener

          request Parameter: windowId = 40a

          request Parameter: org.apache.catalina.ASYNC_SUPPORTED = false

          request Parameter: org.apache.myfaces.component.html.util.ExtensionFilter.doFilterCalled = true

          request Parameter: org.apache.myfaces.AddResourceFactory.CACHE_MAP_KEY = org.apache.myfaces.renderkit.html.util.DefaultAddResource@9478af

          Parameter: tabPanel:form:unassignedTemplateList:validToInput =

          Parameter: javax.faces.behavior.event = change

          Parameter: javax.faces.partial.execute = tabPanel:form:unassignedTemplateList:1:j_idt313 @component

          Parameter: tabPanel:form:unassignedTemplateList:1:j_idt313 = on

          Parameter: AJAX:EVENTS_COUNT = 1

          Parameter: javax.faces.partial.render = @component

          Parameter: javax.faces.source = tabPanel:form:unassignedTemplateList:1:j_idt313

          Parameter: tabPanel:form:unassignedTemplateList:corrChannelInput =

          Parameter: javax.faces.partial.event = change

          Parameter: tabPanel:form:unassignedTemplateList:validFromInput =

          Parameter: tabPanel:form = tabPanel:form

          Parameter: org.richfaces.ajax.component = tabPanel:form:unassignedTemplateList:1:j_idt313

          Parameter: windowId = 40a

          Parameter: tabPanel:form:unassignedTemplateList:templateNameInput =

          Parameter: javax.faces.partial.ajax = true

          Looking for /pages/correspondence/topic/topicOverview.xhtml

          Looking for /pages/correspondence/topic/topicOverview.xhtml

          After PhaseEvent: RESTORE_VIEW 1

          Setting Locale to de

          got authenticated User in Context admin

          Before PhaseEvent: RENDER_RESPONSE 6

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          visiting: corTopicOview:topicList

          Get TableState: corTopicOview:topicList

          walking: from 0 to 10 , old: 0 - 10, State org.richfaces.model.ArrangeableStateDefaultImpl@9602c3

          walking: from 0 to 5 , old: 0 - 5, State org.richfaces.model.ArrangeableStateDefaultImpl@4146445

          walking: from 0 to 5 , old: 0 - 5, State org.richfaces.model.ArrangeableStateDefaultImpl@4146e28

          walking: from 0 to 5 , old: 0 - 5, State org.richfaces.model.ArrangeableStateDefaultImpl@965a81

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          walking: from 0 to 10 , old: 0 - 10, State org.richfaces.model.ArrangeableStateDefaultImpl@9602c3

          walking: from 0 to 5 , old: 0 - 5, State org.richfaces.model.ArrangeableStateDefaultImpl@4146445

          walking: from 0 to 5 , old: 0 - 5, State org.richfaces.model.ArrangeableStateDefaultImpl@4146e28

          walking: from 0 to 5 , old: 0 - 5, State org.richfaces.model.ArrangeableStateDefaultImpl@965a81

          After PhaseEvent: RENDER_RESPONSE 6

          PI found at line 1

          Marked section found at line 2. Surroundings: 'CDATA[<span class="rf-msg " id'.

          Marked section found at line 2. Surroundings: 'CDATA[<span class="rf-msg " id'.

          Marked section found at line 2. Surroundings: 'CDATA[<table id="tabPanel:form'.

          Marked section found at line 57. Surroundings: 'CDATA[-3581740421360154707:838'.

           

           

          Second click, which results in expected behaviour:

          RequestContext setup, pushing to Stack..

          RequestContext filter for URL: /bo/pages/correspondence/topic/topicOverview.faces;jsessionid=16EF37670351DD8E22D408A2313F38DD

          Session invalidation filter, pushing to Stack..

          Session invalidation filter for URL: /bo/pages/correspondence/topic/topicOverview.faces;jsessionid=16EF37670351DD8E22D408A2313F38DD

          Before PhaseEvent: RESTORE_VIEW 1

          ActionListener: org.apache.myfaces.extensions.cdi.jsf.impl.listener.action.CodiActionListener

          request Parameter: windowId = 40a

          request Parameter: org.apache.catalina.ASYNC_SUPPORTED = false

          request Parameter: org.apache.myfaces.component.html.util.ExtensionFilter.doFilterCalled = true

          request Parameter: org.apache.myfaces.AddResourceFactory.CACHE_MAP_KEY = org.apache.myfaces.renderkit.html.util.DefaultAddResource@8b315e

          Parameter: tabPanel:form:unassignedTemplateList:validToInput =

          Parameter: javax.faces.behavior.event = change

          Parameter: javax.faces.partial.execute = tabPanel:form:unassignedTemplateList:1:j_idt313 @component

          Parameter: tabPanel:form:unassignedTemplateList:1:j_idt313 = on

          Parameter: AJAX:EVENTS_COUNT = 1

          Parameter: javax.faces.partial.render = @component

          Parameter: javax.faces.source = tabPanel:form:unassignedTemplateList:1:j_idt313

          Parameter: tabPanel:form:unassignedTemplateList:corrChannelInput =

          Parameter: javax.faces.partial.event = change

          Parameter: tabPanel:form:unassignedTemplateList:validFromInput =

          Parameter: javax.faces.ViewState = -3581740421360154707:8388992857019101775

          Parameter: tabPanel:form = tabPanel:form

          Parameter: org.richfaces.ajax.component = tabPanel:form:unassignedTemplateList:1:j_idt313

          Parameter: windowId = 40a

          Parameter: tabPanel:form:unassignedTemplateList:templateNameInput =

          Parameter: javax.faces.partial.ajax = true

          Looking for /pages/correspondence/topic/topicOverview.xhtml

          Looking for /pages/correspondence/topic/topicOverview.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/topicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          Looking for /resources/components/correspondence/noTopicSelected.xhtml

          After PhaseEvent: RESTORE_VIEW 1

          Setting Locale to de

          got authenticated User in Context admin

          using viewRoot: /pages/correspondence/topic/topicOverview.xhtml

          Before PhaseEvent: APPLY_REQUEST_VALUES 2

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          After PhaseEvent: APPLY_REQUEST_VALUES 2

          ApplyValuesListener afterPhase

          Before PhaseEvent: PROCESS_VALIDATIONS 3

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          After PhaseEvent: PROCESS_VALIDATIONS 3

          Before PhaseEvent: UPDATE_MODEL_VALUES 4

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          After PhaseEvent: UPDATE_MODEL_VALUES 4

          Before PhaseEvent: INVOKE_APPLICATION 5

          After PhaseEvent: INVOKE_APPLICATION 5

          Before PhaseEvent: RENDER_RESPONSE 6

          visiting: corTopicOview:topicList

          Get TableState: corTopicOview:topicList

          walking: from 0 to 10 , old: 0 - 10, State org.richfaces.model.ArrangeableStateDefaultImpl@9602c3

          walking: from 0 to 5 , old: 0 - 5, State org.richfaces.model.ArrangeableStateDefaultImpl@4146445

          walking: from 0 to 5 , old: 0 - 5, State org.richfaces.model.ArrangeableStateDefaultImpl@4146e28

          walking: from 0 to 5 , old: 0 - 5, State org.richfaces.model.ArrangeableStateDefaultImpl@965a81

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14002

          isAllowed () called with parameter: 14000

          isAllowed () called with parameter: 14002

          walking: from 0 to 10 , old: 0 - 10, State org.richfaces.model.ArrangeableStateDefaultImpl@9602c3

          walking: from 0 to 5 , old: 0 - 5, State org.richfaces.model.ArrangeableStateDefaultImpl@4146445

          walking: from 0 to 5 , old: 0 - 5, State org.richfaces.model.ArrangeableStateDefaultImpl@4146e28

          walking: from 0 to 5 , old: 0 - 5, State org.richfaces.model.ArrangeableStateDefaultImpl@965a81

          After PhaseEvent: RENDER_RESPONSE 6

          PI found at line 1

          Marked section found at line 2. Surroundings: 'CDATA[<span class="rf-msg " id'.

          Marked section found at line 2. Surroundings: 'CDATA[<span class="rf-msg " id'.

          Marked section found at line 2. Surroundings: 'CDATA[<table id="tabPanel:form'.

          Marked section found at line 57. Surroundings: 'CDATA[-3581740421360154707:838'.

          • 2. Re: selectBooleanCheckbox first time rerender
            Richard Wähner Newbie

            I've found the problem. My popupPanel was embedded in another form, which causes the first request to fail.