Thursday, February 2, 2012

Clicking on a display table row

I have been working on displaying data from the database with the action triggered from a displaytag row,  and now it works. I use the following steps, the code fragments might give brief info
  1. get the row id in the jsp page that contains displaytage result 
  <display:column title="View"  property="dvdid" sortable="true"  href="detailaction.do" paramId="id" paramProperty="dvdid" ><s:hidden name="list[%{#attr.row_rowNum - 1}].dvdid" value="%{#attr.row.dvdid}"/></display:column>
      
  1. get access from the struts action 
 Query result = session.createQuery("from Dvdstbl where dvdid="+request.getParameter("id"));
  1. display the result wherever you intend to.