1 Reply Latest reply on Jun 21, 2007 7:39 AM by ilya_shaikovsky

    Rerendering repeat

    sammy8306

      I started exploring the A4J lib this morning, and I'm running into a problem. The following code is taken from my seam project:

      <a:region id="listt">
       <a:log/>
       <ui:repeat var="listvar" value="#{NewBlogEntryComponent.blogEntry_be.tags}">
       <h:outputText value="#{listvar} "/>
       <a:commandButton value="Delete" reRender="listt" action="#{NewBlogEntryComponent.remove(listvar)}"/>
       <br />
       </ui:repeat>
       <br />
       <s:decorate>
       <h:selectOneMenu id="tags1" value="#{dev.nulll}" valueChangeListener="#{NewBlogEntryComponent.listener}">
       <s:selectItems var="field" label="#{field.toString}" value="#{AllTag}" noSelectionLabel="Please select : " />
       <s:convertEntity/>
       <a:support event="onchange" reRender="listt" bypassUpdates="true" />
       </h:selectOneMenu>
       </s:decorate>
      </a:region>
      


      This code works (that is, my data is manipulated ok), except for the rerendering part. I would like the ui:repeat to be rerendered as well. For this to happen, I tried:

      * changing ui:repeat to a:repeat
      * re-render the repeat explicitly instead of the region (i.e. moving the id inside the ui/a:repeat)

      but nothing worked. <a:log /> is giving me this:

      debug[13:01:49,144]: Have Event [object Object] with properties: target: [object SELECT], srcElement: [object SELECT], type: change
      debug[13:01:49,145]: NEW AJAX REQUEST !!! with form :_id29
      debug[13:01:49,147]: parameter _id29:_id70 with value _id29:_id70
      debug[13:01:49,148]: Start XmlHttpRequest
      debug[13:01:49,149]: Reqest state : 1
      debug[13:01:49,151]: QueryString: AJAXREQUEST=_id29%3Alistt&_id29%3Atitle=&_id29%3Aabstract=&_id29%3Acontents=&_id29%3Adate=&_id29%3Auser=org.jboss.seam.ui.NoSelectionConverter.noSelectionValue&_id29%3Atags1=6&_id29%3Acategory=org.jboss.seam.ui.NoSelectionConverter.noSelectionValue&_id29_SUBMIT=1&jsf_sequence=4&_id29%3A_link_hidden_=&_id29%3A_id70=_id29%3A_id70&
      debug[13:01:49,566]: Reqest state : 2
      debug[13:01:49,654]: Reqest state : 3
      debug[13:01:49,655]: Reqest state : 4
      debug[13:01:49,656]: Reqest end with state 4
      debug[13:01:49,656]: Response with content-type: text/xml; charset=utf-8
      debug[13:01:49,657]: Full response content: <?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml"><head><script type="text/javascript" src="/blog-jpa-seam/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript.seam"> </script><script id="_id29:_id62" type="text/javascript">//<![CDATA[ LOG.registerPopup('L','LogWindow',800,600,LOG.ALL); // //]]> </script><title></title></head><body>tag 4_1 <input id="_id29:_id63:0:_id65" name="_id29:_id63:0:_id65" onclick="A4J.AJAX.Submit('_id29:listt','_id29',event,{'parameters':{'_id29:_id63:0:_id65':'_id29:_id63:0:_id65'},'actionUrl':'/blog-jpa-seam/NewBlogEntry.seam'});return false;" value="Delete" type="button" /> <br />tag 4_3 <input id="_id29:_id63:1:_id65" name="_id29:_id63:1:_id65" onclick="A4J.AJAX.Submit('_id29:listt','_id29',event,{'parameters':{'_id29:_id63:1:_id65':'_id29:_id63:1:_id65'},'actionUrl':'/blog-jpa-seam/NewBlogEntry.seam'});return false;" value="Delete" type="button" /> <br /> <br /><span id="_id29:_id68"><select id="_id29:tags1" name="_id29:tags1" size="1" onchange="A4J.AJAX.Submit('_id29:listt','_id29',event,{'parameters':{'_id29:_id70':'_id29:_id70'},'actionUrl':'/blog-jpa-seam/NewBlogEntry.seam'})"><option value="org.jboss.seam.ui.NoSelectionConverter.noSelectionValue">Please select :</option><option value="4">tag 4_1</option><option value="5">tag 4_2</option><option value="6" selected="selected">tag 4_3</option><option value="7">tag 1_1</option><option value="8">tag 1_2</option><option value="9">tag 1_3</option><option value="10">tag 2_1</option><option value="11">tag 2_2</option><option value="12">tag 2_3</option><option value="13">tag 6_1</option><option value="14">tag 6_2</option><option value="15">tag 6_3</option><option value="16">tag 10_1</option><option value="17">tag 10_2</option><option value="18">tag 10_3</option><option value="19">tag 5_1</option><option value="20">tag 5_2</option><option value="21">tag 5_3</option><option value="22">tag 9_1</option><option value="23">tag 9_2</option><option value="24">tag 9_3</option><option value="25">tag 8_1</option><option value="26">tag 8_2</option><option value="27">tag 8_3</option><option value="28">tag 3_1</option><option value="29">tag 3_2</option><option value="30">tag 3_3</option><option value="31">tag 7_1</option><option value="32">tag 7_2</option><option value="33">tag 7_3</option></select></span><meta name="Ajax-Update-Ids" content="_id29:listt" /><span id="ajax-update-ids"><input type="hidden" name="jsf_sequence" value="5" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>
      debug[13:01:49,664]: Update page by list of rendered areas from response _id29:listt
      debug[13:01:49,665]: search for elements by name 'script' in element #document
      debug[13:01:49,666]: getElementsByTagName found 2
      debug[13:01:49,666]: <script> in response with src=/blog-jpa-seam/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript.seam
      debug[13:01:49,666]: Such element exist in document
      debug[13:01:49,667]: search for elements by name 'link' in element #document
      debug[13:01:49,667]: getElementsByTagName found 0
      debug[13:01:49,668]: Attempt to update part of page for Id: _id29:listt
      debug[13:01:49,669]: call getElementById for id= _id29:listt
      error[13:01:49,669]: New node for ID _id29:listt is not present in response
      


      It seems that only information for the selectmenu is present in the response. How can I get this to work?