Hello list,

I have successfully used the display tag to iterate over a collection
which is exposed in an action class. On each row in addition to the
columns displaying the fields of each object in the collection, I
embed two more struts-tag urls: Update and Remove.

The objective is to have an extra two columns for every row in the
table giving the ability to update or delete each record:

<display:table name="goalToAchieve.entries" requestURI="" uid="thisGoal">
        <display:column property="entry" />
        <display:column property="date" sortable="true"
defaultorder="ascending" title="TimeStamp"/>
        <display:column><a href="<s:url action='UpdateEntryForm'>
                                <s:param name="name" 
value="%{goalToAchieve.owner.fullName}" />
                        </s:url>
                        ">Edit</a></display:column>
        <display:column><a href="<s:url action='DeleteEntryForm'>
                                        <s:param name="name" 
value="%{goalToAchieve.owner.fullName}" />
                                        <s:property value="%{entry}"/>
                                       </s:url>
                                       ">Remove</a></display:column>
</display:table>

I am having trouble passing the entry property, (or reference to it)
to the url targeting the update or delete action. The entries
collection consists of value type, embeddable objects. I am aware of
how to pass parameters to the linking url, but my issue is passing a
reference to the "entry" property of each row, to the update or delete
action for the same row.

I hope I am explaining this correctly. The update, or delete jsp forms
will simply display the same entry from the table row, prompting the
user to go ahead with updating or deleting. So these will be
pass-through empty actions to the jsp re-displaying the entry.
Submitting one of these forms will trigger the actual action. My
struts.xml looks like this:

<action name="DeleteEntryForm" >
        <result>/pages/DeleteEntryForm.jsp</result>
 </action>
                        
 <action name="DeleteEntry" class="actions.DeleteEntry">
        <result>/pages/DeleteEntrySuccess.jsp</result>
        <result name="input">/pages/DeleteEntryForm.jsp</result>
</action>

The way I am doing it right now, gives me a NoSuchMethod exception:

WARN OgnlValueStack:49 - Error setting value
ognl.MethodFailedException: Method "setEntry" failed for object
actions.deleteen...@e3404f [java.lang.NoSuchMethodException:
setEntry([Ljava.lang.String;)]

But in the DeleteEntry class, I have the getters and setters for
entry, and also do a remove from the collection within the execute
method.

Any help is much appreciated

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

Reply via email to