views:

1844

answers:

4

I want to create edit , delete link in display tag with struts2. How can i do so ? If anybody knows please help me ....

i am doing this.

<display:column property="id" title="ID" href="details.jsp" paramId="id" />

but the link is not going to details.jsp .It doesn't go anywhere . what can be the possible reason

+1  A: 

You may have to be more specific in order to get better answers. Is the problem understanding struts2 or display tags? This tutorial expains how to create links in display tags library.

If struts 2 is the problem then you could make you question more specific and we'll see what we can do.

Vincent Ramdhanie
+1  A: 

You can write your stuff within the tag like this:

<display:table id="row" >
    <display:column property="id" title="ID" paramId="id"  > 
        <a href="details.jsp?${row.id}">Details</a>
    </display:column>
</display:table>
HaBaLeS
Thanks but this is not working.
Aryabhatt
+1  A: 

It is done by the following code.

<display:column  title="Edit">
                    <s:url id="updateUrl" action="marketing/update.action">
                        <s:param name="id" value="#attr.countrylist.id" />
                    </s:url>
                    <s:a href="%{updateUrl}" theme="ajax"  targets="countrylist">Update</s:a>
                </display:column>

Thanks for all the answers

Aryabhatt
A: 

You could also create a decorator for the table and have it generate the link. See example below on some other forum: http://sourceforge.net/forum/message.php?msg_id=4119964

Thimmayya