Let me explain. Form example, if there are 100 records and the <pagesize> attribute -in the display tag decleration- set to "10", then there are 10 records shown at a time. When the user click on the little arrow on the top of the table, the table check out the next ten records.
Now, if I have a column of check boxes, when a user check some boxes and then click next arrow - to choose from the next values- the previous selection disappears.
How can I save the user selections?
Her are a snipet of the code from the JSP page
<display:table name="metadataList" export="true" id="row" requestURI="/publish.do?action=preExportSelect" pagesize="10" class="display_tag">
<bean efine name="row" property="metadataId" id="metadataId"/>
<display:column sortable="false" title="Select" media="html">
<html:multibox name="PublishingForm" property="selectedMetadataIds" value="<%= String.valueOf(metadataId) %>" />
anybody has any idea. I can't be the only one who wants to do this?
I know this sounds like passing the buck, but I think you might have better luck getting an answer to this in a forum dedicated to the display tag library. Try this link.
Originally posted by Merrill Higginson:
[qb]Many of us who hang out at this forum have a lot of experience with Struts, but I don't think there are many of us who use the display tag library.
What tag libraries do most people here use? I see there are different options out there, and would like to get up to speed on the best, most popular.
[ March 26, 2006: Message edited by: Eric Gero ]
To implement this you would have to wrap your page in a html:form tag and submit the page when the user clicked one of the page links. I am not sure if it would be best to keep your ActionForm in session, to keep selections from previous pages in hidden fields on the jsp or to implement logic that would process the submitted set of selection and build a master list of all selected items and save that in session.
The problem is that display:tag paging function doesn't populate and sumbit the form fields. What I mean is, if you have input fields, ie. checkbox, which are associated with a form bean, and when I click on next page, a function provided by display:tag, the value of the fields are not sumbited. So, I can't catch them and save tham in let say a session object.
Thank you for replaying
I'm not sure if u still have this problem persisting, or if my solution might help u; why don't u try keeping the form bean associated with that action into the session, by changing the entry in the struts-config.xml file's <action> tag.
Hope this helps.
Anyway I had the same problem you did, and I was able to solve it this way:
I have a hidden form object called "selectedObj" but it isn't a Struts Form object. The update method finds the selectedObj value in the collection and just toggles the selected property.