6 Replies Latest reply on Apr 24, 2007 1:23 AM by Michal Glowacki

    Nested a4j:repeat does not rerender

    Michal Glowacki Novice

      Hi

      I've something like this:

      <h:selectOneRadio binding="#{event$ManageEvents.viewRadio}" id="viewRadio" immediate="true" layout="pageDirection" value="Standard">
       <a4j:support event="onclick" reRender="eventsTable"/>
       <f:selectItems binding="#{event$ManageEvents.viewRadioSelectItems}" id="viewRadioSelectItems" value="#{event$ManageEvents.radioButtonList1DefaultItems}"/>
       </h:selectOneRadio>
      
      <a4j:repeat binding="#{event$ManageEvents.categoryRepeat}" id="eventsTable" value="#{event$ManageEvents.eventsPending}" var="category_it">
       <t:htmlTag style="background-color: #3D70A6" value="tr">
       <h:outputText escape="false" value="&lt;td colspan=15&gt;"/>
       <h:outputText style="color: white; margin-left: 2px; font-weight: bold" value="#{category_it.categoryName}"/>
       <h:outputText escape="false" value="&lt;/td%gt;"/>
       </t:htmlTag>
       <a4j:repeat binding="#{event$ManageEvents.eventRepeat}" id="eventRow" value="#{category_it.events}" var="event_it">
       <t:htmlTag value="tr">
       <t:htmlTag style="text-align: center" styleClass="border-left" value="td">
       <h:outputText rendered="#{!event_it.showPercentages}" value="#{event_it.numbers1}"/>
       <h:outputText rendered="#{event_it.showPercentages}" value="#{event_it.percentages1}"/>
       </t:htmlTag>
       <t:htmlTag style="text-align: center" styleClass="border-left" value="td">
       <h:outputText rendered="#{!event_it.showPercentages}" value="#{event_it.numbersX}"/>
       <h:outputText rendered="#{event_it.showPercentages}" value="#{event_it.percentagesX}"/>
       </t:htmlTag>
       <t:htmlTag style="text-align: center" styleClass="border-left" value="td">
       <h:outputText rendered="#{!event_it.showPercentages}" value="#{event_it.numbers2}"/>
       <h:outputText rendered="#{event_it.showPercentages}" value="#{event_it.percentages2}"/>
       </t:htmlTag>
       </a4j:repeat>
       </a4j:repeat>
      
      
      Unfortunaly, the a4j:repeat with id eventsTable is not being rerendered after chaning radio selection, but the code for eventsTable value is for sure executed. a4j:log returns as response empty html tag.


        • 1. Re: Nested a4j:repeat does not rerender
          Sergey Smirnov Master

          If you press Refresh (Reload) button on the browser, do you see the updated data?

          • 2. Re: Nested a4j:repeat does not rerender
            Sergey Smirnov Master

            We have a similar bug that is already fixed in SVN. Take the latest richfaces and ajax4jsf snapshots for test.

            • 3. Re: Nested a4j:repeat does not rerender
              Michal Glowacki Novice

              ok

              regarding refresh -no, because the after refresh i radio button is set to first option so I can't experience expected behaviour.

              • 4. Re: Nested a4j:repeat does not rerender
                Sergey Smirnov Master

                I am not sure now, that the problem is on the Ajax level.
                For the testing purpose, let's replace ajax part with regular JSF behavior.

                I.e. remove:
                <a4j:support event="onclick" reRender="eventsTable"/>
                and add just after </h:selectOneRadio>:
                <h:commandButton value="Manual Change" />

                Click on radio button and then the command button.
                Does the table contain the right data after the full page refresh?

                • 5. Re: Nested a4j:repeat does not rerender
                  Michal Glowacki Novice

                  I've also non-ajax links in there to apply additional options, and after
                  clicking on them the page reloads with correct option (selected by radios).
                  Problem only occurs when trying to switch the view using ajaxed-radio
                  buttons. Something more from a4j:log

                  debug[7:22:21,203]: Have Event [object Object] with properties: target:
                  undefined, srcElement: [object], type: click
                  debug[7:22:21,203]: NEW AJAX REQUEST !!! with form :form1
                  debug[7:22:21,203]: parameter form1:_idJsp6 with value form1:_idJsp6
                  debug[7:22:21,203]: Start XmlHttpRequest
                  debug[7:22:21,203]: Reqest state : 1
                  debug[7:22:21,203]: QueryString: AJAXREQUEST=_viewRoot&form1%3AviewRadio=Standard&form1
                  %3AselectDayCalendar_field=&form1%3AselectDayCalendar
                  %3A_datePicker%3AmonthMenu=4&form1%3AselectDayCalendar
                  %3A_datePicker%3AmonthMenu_submitter=false&form1
                  %3AselectDayCalendar%3A_datePicker%3AyearMenu=2007&form1
                  %3AselectDayCalendar%3A_datePicker%3AyearMenu_submitter=false
                  &form1%3AselectDayAllCalendar_field=&form1%3AselectDayAllCalendar
                  %3A_datePicker%3AmonthMenu=4&form1%3AselectDayAllCalendar
                  %3A_datePicker%3AmonthMenu_submitter=false&form1
                  %3AselectDayAllCalendar%3A_datePicker%3AyearMenu=2007&form1
                  %3AselectDayAllCalendar%3A_datePicker%3AyearMenu_submitter=false
                  &form1_hidden=form1_hidden&form1%3A_idJsp6=form1%3A_idJsp6&
                  debug[7:22:21,203]: Reqest state : 1
                  debug[7:22:21,562]: Reqest state : 2
                  debug[7:22:21,562]: Reqest state : 3
                  debug[7:22:21,562]: Reqest state : 4
                  debug[7:22:21,562]: Reqest end with state 4
                  debug[7:22:21,562]: Response with content-type: text/xml;charset=UTF-8
                  debug[7:22:21,562]: Full response content: <?xml version="1.0"?>

                  <!-- MYFACES JAVASCRIPT -->

                  debug[7:22:21,562]: Update page by list of rendered areas from response form1:eventsTable
                  debug[7:22:21,562]: search for elements by name 'script' in element #document
                  debug[7:22:21,562]: selectNodes found 1
                  debug[7:22:21,562]: in response with src=/AdminConsole/faces/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript
                  debug[7:22:21,562]: Such element exist in document
                  debug[7:22:21,578]: search for elements by name 'link' in element #document
                  debug[7:22:21,578]: selectNodes found 0
                  debug[7:22:21,578]: Attempt to update part of page for Id: form1:eventsTable
                  debug[7:22:21,578]: call selectSingleNode for id= form1:eventsTable
                  error[7:22:21,578]: New node for ID form1:eventsTable is not present in response
                  debug[7:22:21,578]: call selectSingleNode for id= ajax-update-ids
                  debug[7:22:21,578]: Hidden JSF state fields:
                  debug[7:22:21,578]: search for elements by name 'input' in element span
                  debug[7:22:21,578]: selectNodes found 1
                  debug[7:22:21,578]: Replace value for inputs: 27 by new values: 1
                  debug[7:22:21,578]: Input in response: jsf_sequence
                  debug[7:22:21,578]: search for elements by name 'INPUT' in element span
                  debug[7:22:21,578]: selectNodes found 0
                  debug[7:22:21,578]: Replace value for inputs: 27 by new values: 0

                  • 6. Re: Nested a4j:repeat does not rerender
                    Michal Glowacki Novice

                    once again:

                    debug[7:22:21,203]: Have Event [object Object] with properties: target: undefined, srcElement: [object], type: click
                    debug[7:22:21,203]: NEW AJAX REQUEST !!! with form :form1
                    debug[7:22:21,203]: parameter form1:_idJsp6 with value form1:_idJsp6
                    debug[7:22:21,203]: Start XmlHttpRequest
                    debug[7:22:21,203]: Reqest state : 1
                    debug[7:22:21,203]: QueryString: AJAXREQUEST=_viewRoot&form1%3AviewRadio=Standard&form1
                    %3AselectDayCalendar_field=&form1%3AselectDayCalendar
                    %3A_datePicker%3AmonthMenu=4&form1
                    %3AselectDayCalendar%3A_datePicker%3AmonthMenu_submitter=false
                    &form1%3AselectDayCalendar%3A_datePicker%3AyearMenu=2007
                    &form1%3AselectDayCalendar%3A_datePicker
                    %3AyearMenu_submitter=false&form1%3AselectDayAllCalendar_field=
                    &form1%3AselectDayAllCalendar%3A_datePicker%3AmonthMenu=4
                    &form1%3AselectDayAllCalendar%3A_datePicker
                    %3AmonthMenu_submitter=false&form1%3AselectDayAllCalendar
                    %3A_datePicker%3AyearMenu=2007&form1%3AselectDayAllCalendar
                    %3A_datePicker%3AyearMenu_submitter=false
                    &form1_hidden=form1_hidden&form1%3A_idJsp6=form1%3A_idJsp6&
                    debug[7:22:21,203]: Reqest state : 1
                    debug[7:22:21,562]: Reqest state : 2
                    debug[7:22:21,562]: Reqest state : 3
                    debug[7:22:21,562]: Reqest state : 4
                    debug[7:22:21,562]: Reqest end with state 4
                    debug[7:22:21,562]: Response with content-type: text/xml;charset=UTF-8
                    debug[7:22:21,562]: Full response content: <?xml version="1.0"?>
                    <html lang="pl_PL" xmlns="http://www.w3.org/1999/xhtml"><head><title></title><script type="text/javascript" src="/AdminConsole/faces/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript">
                    </script></head><body><meta name="Ajax-Update-Ids" content="form1:eventsTable" /><span id="ajax-update-ids"><input type="hidden" name="jsf_sequence" value="1" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /><!-- MYFACES JAVASCRIPT -->
                    </body></html>
                    debug[7:22:21,562]: Update page by list of rendered areas from response form1:eventsTable
                    debug[7:22:21,562]: search for elements by name 'script' in element #document
                    debug[7:22:21,562]: selectNodes found 1
                    debug[7:22:21,562]: <script> in response with src=/AdminConsole/faces/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript
                    debug[7:22:21,562]: Such element exist in document
                    debug[7:22:21,578]: search for elements by name 'link' in element #document
                    debug[7:22:21,578]: selectNodes found 0
                    debug[7:22:21,578]: Attempt to update part of page for Id: form1:eventsTable
                    debug[7:22:21,578]: call selectSingleNode for id= form1:eventsTable
                    error[7:22:21,578]: New node for ID form1:eventsTable is not present in response
                    debug[7:22:21,578]: call selectSingleNode for id= ajax-update-ids
                    debug[7:22:21,578]: Hidden JSF state fields:
                    debug[7:22:21,578]: search for elements by name 'input' in element span
                    debug[7:22:21,578]: selectNodes found 1
                    debug[7:22:21,578]: Replace value for inputs: 27 by new values: 1
                    debug[7:22:21,578]: Input in response: jsf_sequence
                    debug[7:22:21,578]: search for elements by name 'INPUT' in element span
                    debug[7:22:21,578]: selectNodes found 0
                    debug[7:22:21,578]: Replace value for inputs: 27 by new values: 0