In your Struts 2 action, how are you retrieving which rows were selected from
the jsp? Could you please post an example of the applicable action code.

wskent wrote:
> 
> How did you get the checkbox on the same line as the display:column
> properties.
> I am getting the checkbox on a line by itself for each row.
> 
> 
> kenk wrote:
>> 
>> Everyone,
>> 
>> I've had a hard time getting DisplayTag and Struts 2 to play nicely
>> together.  I've finally achieved success, and I wanted to post this
>> example to the community, primarily because I've found information on
>> these two hard to find.
>> 
>> This example displays a list of test scenarios:  
>> 
>> <display:table name="${scenarioList}"  class="its" uid="row"
>> pagesize="20" sort="list" requestURI="" >
>>   <display:column title="" >
>>     <s:hidden name="scenarioList[%{#attr.row_rowNum - 1}].scenarioId"
>> value="%{#attr.row.scenarioId}"/>
>>     <s:checkbox name="select[%{#attr.row_rowNum - 1}]"
>> value="select[%{#attr.row_rowNum - 1}]" />
>>   </display:column>
>>   <display:column property="number" sortable="true"
>> href="testScenario2.jsp" paramId="id" paramProperty="scenarioId" />
>>   <display:column property="description" sortable="true"  />
>>   <display:column property="standard" sortable="true"  />
>> </display:table>
>> 
>> I've defined scenarioList (java.util.List) on my Struts action.  I did
>> not need to use the <s:set> tag as seen in other posts.  I'm using "uid"
>> instead of "id" because the displaytag docs says I need to.  I'm paging
>> and sorting successfully -- the requestURI setting seems to have a lot to
>> do with that.
>> 
>> The first column of my table displays a checkbox (the idea here is to
>> allow user selection of multiple rows).  The OGNL syntax took me a long
>> time to figure out, the "[]" mean an index, %{} contains an OGNL
>> expression, #attr means look at the page context, row_rowNum is pure
>> DisplayTag for the row number (based on uid), and -1 is needed to get
>> DisplayTag to start at 0 rather than 1.
>> 
>> Hope this info helps someone -- K 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2---DisplayTag-example-tp17694341p19676045.html
Sent from the DisplayTag - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to