ajax:displayTag problem with logic:iterate

2010-03-11
2013-01-31
  • Ignacio Lopez
    Ignacio Lopez
    2010-03-11

    Hi,

    I'm having problems with ajax:displayTag and logic:iterate. Let me explain:

    I have an action wich puts in session an ArrayList that contains an unknown number of ArrayList.

    In the jsp, I iterate this ArrayList (the first one) to retrieve the lists contained in it. I want to display these lists in
    a display:table (with sorting and paging functionalities) Also I need ajax so paging and sorting don't refresh the whole jsp.

    Right now the tables show correctly but when I try to sort one table it doesn't work (when I click on one of the sortable columns
    that table is changed by some parts of the whole JSP)

    I think these problems migth have to do with the ID of the tables…

    Here is the involved piece of code (JSP) I have right now:

    <% int ident = 0; %>
        <logic:iterate id="ciudades" name="listadoLugares">    
        <% request.setAttribute( "ciudades",ciudades); String sCiudades = "ciudades"+ident; String sDiv = "div"+ident; String sTab = "tab"+ident; ident++; %>       
        <div id="nada" style="border:1;border-style:solid;width:50%"><c:out value="aa"/></div>          
        <div id="<%=sDiv %>" style="border:1;border-style:solid;width:50%">
        <ajax:displayTag id="<%=sCiudades %>" >            
            <display:table uid="<%=sTab %>" name="ciudades" pagesize="5">
                <display:column sortable="true" property="idLugar" headerClass="sortable"> </display:column>
                <display:column sortable="true" property="nombreLugar" headerClass="sortable"> </display:column>
                <display:column sortable="true" property="ciudadId" headerClass="sortable"> </display:column>
            </display:table>        
        </ajax:displayTag>
        </div>
        </logic:iterate>
    

    I put the scriplets you can see over there so the displayTag and the display:table have different Id. Am I right to suppose this is necessary?

    I've tried a lot of things and none of them working. Can somebody help me?
    Thanks