views:

948

answers:

1

Hi at all.. this is my problem.

My JSP need a pagination. Original version is this:

<s:iterator value="listSurveyToRender" var="s">

                        <tr class="surveyTitle"><td><h4><s:property value="descrizione" /></h4></td></tr>
                        <s:iterator value="listSurveyValuesToRender" var="sv" >
                            <s:if  test="%{#s.idsurvey==#sv.survey.idsurvey}">

                                <s:if test="%{survey.surveytype=='multi'}">
                                    <tr class="rowSurvey">
                                        <td><p><s:property value="valoreTesto"/></p></td><td><s:checkboxlist list="sv" name="domandeCheckbox" listValue="" listKey="idsurveyValues" theme="simple"  /></td>
                                    </tr>
                                </s:if>

                                <s:if test="%{survey.surveytype=='singolo'}">
                                    <tr class="rowSurvey">
                                        <td><p><s:property value="valoreTesto"/></p>td><td><s:radio theme="simple" name="selectedOption" list="valoreNdomanda"/></td>
                                    </tr>
                                </s:if>

                            </s:if>
                        </s:iterator>

                    </s:iterator>

This is ok. But I need a solution to render the same with the pagination. I tried with :

        <s:set name="surveyValues" value="listSurveyValuesToRender" scope="request"/>
 <display:table name="survey" id="survey" sort="list" defaultsort="2" pagesize="4" size="10">
                    <display:column property="descrizione" />



                </display:table>

But now I need a method to see the values that before I getted by nested iteration...

A: 

Have you tried to iterate within the tags? If you set the uid property of the display:table then you can get a handle to the row with it.

For example:

<display:table name="survey" uid="row">
    <display:column>${row.property}</display:column>
</display:table>

You can try a scriptlet that iterates in there or a . Not sure if a struts tag works in there but it theoretically could. Not sure about your displayTag table named "survey" based on your example above. The displayTag table name = collection name.

Dusty Pearce
Unfortunately this is not a solution. Each type of information inside display:colum tag is not renderable. I think that this tag display:column render only the property of the collection inside table tag.
Luigi 1982