ajax - How to prevent Tapestry from duplicating HTML on zone updates? -
i'm having similar problem described here: (http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/zone-refresh-inserts-duplicate-html-td5722328.html)
when i'm sorting grid
(with custom provided griddatasource
pulls data database, sorting done on db side) clicking on sorting icons, grid gets duplicated, in copy of current grid shown below it. following grid sort events affect grid i'm clicking sort column on. example, if click sort 1st column in 1st grid, 2nd grid unaffected , vice-versa. when refresh page, 2nd grid disappears , things go square 1 again.
i have tried advice thiago h. de paula figueiredo saying try passing zone's body instead of zone addrender
method, no result.
edit: added code.
my page structure:
<t:zone t:id="zone1" id="zone1"> <t:form t:id="form1" id="form1" t:zone="zone1"> <t:beaneditor t:id="filtereditor" t:object="filter"> </t:beaneditor> ... <input id="submitfilter" t:id="submitfilter" class="button" t:type="submit" value="submit" zone="zone1"/> </t:form> <t:form t:id="form2" id="form2" t:zone="^"> <input id="resetfilter" t:id="resetfilter" class="button" t:type="submit" value="reset" zone="zone1"/> </t:form> </t:zone> <t:zone t:id="zone2" id="zone2"> <t:form t:id="form3" id="form3" t:zone="^" t:autofocus="true"> ... <input type="submit" value="cancel" class="button"/> </t:form> </t:zone> <t:zone t:id="zone3" id="zone3"> <t:form t:id="form4" id="form4" t:zone="^" t:autofocus="false"> <t:errors/> <table> <t:grid t:source="datasource" t:model="beanmodel" t:row="entry" t:encoder="encoder" t:rowsperpage="5" t:pagerposition="both" t:inplace="true"> <p:cell1> ... </p:cell1> <p:cell2> ... </p:cell2> <p:cell3> ... </p:cell3> <p:cell4> ... </p:cell4> <p:cell5> ... </p:cell5> </t:grid> </table> </t:form> </t:zone>
when click sort cells on grid in zone3 (the sorting done on db side, via sql), table html duplicates , acts another, separate table.
i've tried updating zones this:
if (request.isxhr()) { ajaxresponserendered.addrender(zone1).addrender(zone2).addrender(zone3); }
and this:
if (request.isxhr()) { ajaxresponserendered.addrender(zone1.getcliendid(), zone1.getbody()).addrender(zone2.getcliendid(), zone2.getbody()).addrender(zone3.getcliendid(), zone3.getbody()); }
but didn't work.
Comments
Post a Comment