You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by raychang <rc...@idanalytics.com> on 2010/08/19 01:14:38 UTC

Retrieving Value from Row in Struts2 Table While using Displaytag

Hi,

I am trying to access the value of a particular row in my table (to perform
edit or remove actions), but I can't seem to get the value...

Here is the code for my table in my JSP page:

    <display:table name="table" pagesize="25" requestURI="">
    <display:column title="Action" >
    	<s:form theme="simple">
    		<s:hidden key="cpc" />
        	<s:submit action="remove" value="Remove" 
        	onclick="return confirm('Are you sure you want to delete this
item?');"/>
        	<s:submit action="displayEdit" value="Edit"/>
    	</s:form>
    </display:column>
    <display:column property="cpc" title="CPC" sortable="true"
headerClass="sortable"/>
    <display:column property="companyName" title="Company Name"
sortable="true" headerClass="sortable"/>
    <display:column property="eventType" title="Event Type" sortable="true"
headerClass="sortable"/>
    <display:column property="industryType" title="Industry Type"
sortable="true" headerClass="sortable"/>
    <display:column property="previousEvents" sortable="true"
headerClass="sortable"/>
    <display:column property="creditNotifications" sortable="true"
headerClass="sortable"/>
    <display:column property="interimNotifyEnterprise" sortable="true"
headerClass="sortable"/>
    </display:table>

The source for the table is an ArrayList<TableRow>, where TableRow is a
wrapper class of all the various fields (and I have getters and setters for
all the fields). Now when I check my HTML source code, I see this for the
hidden field:

    <input type="hidden" name="cpc" value="" id="displayResults_cpc"/>

For some reason, there is no value to be found... It was working fine before
I used Displaytag, and I do have a getter and setter in my Action class
(right now it returns an empty String).

-- 
View this message in context: http://old.nabble.com/Retrieving-Value-from-Row-in-Struts2-Table-While-using-Displaytag-tp29477008p29477008.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org