This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Struts and the fly likes displaytag help Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "displaytag help" Watch "displaytag help" New topic
Author

displaytag help

srinivas.b
Ranch Hand

Joined: Oct 26, 2006
Posts: 58
Dear all,

I am new to struts.I am developing a small application. In that i want to use displaytag to display items. I want to select few items and add to cart.
Could any one please suggest me, how can i do that?
is it possible?

Thank you
sirish veer
Greenhorn

Joined: Feb 06, 2008
Posts: 3
Download displaytags jar file.
<display:table name="offices" requestURI="" pagesize="${row}" sort="list"
id="officeResults" class="jobResults" >
<% String office = (String)(((Office)((ManageOfficesDao)pageContext.getAttribute("officeResults")).getOffice())).getOfficeId() ;
request.setAttribute("officeResult", office); %>
<display:column><s:checkbox theme="simple" name="checked" fieldValue="%{#request.officeResult}" /></display:column>
<display:column sortProperty="sortList" property="office.officeId" title="ID" sort="true"/>
<display:column property="office.officeName" href="viewoffice.action" paramId="Id"
paramProperty="office.officeId" title="Name" sort="true"/>
</display:table>


Here we are passing the officeId when they select the check box and
retrieving it in action class.
srinivas.b
Ranch Hand

Joined: Oct 26, 2006
Posts: 58
Hi sirish,
From your reply i understood that we can do shoppingcart type application using display tag. But honestly i did not understand your code.
Could you please send me a simple application which works like shopping cart .. to add items to cart. I just need how the add button works. Please

Thank you in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35442
    
    9
You're overestimating what DisplayTag can do. It is a tag library that can display tabular data (from data structures or the database) in a web page. You most certainly can not "do shoppingcart type application using display tag". You will need to use various Struts capabilities to do that.

It sounds as if you need a server session in which you can store the items of the shopping cart until checkout. What do you have so far?


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: displaytag help
 
Similar Threads
Displaytag question
retaining search criteria values while sorting or navigating using displaytag
Regarding Scrollable Content and fixed Headers in DisplayTag
Question on using DisplayTag in JSPs
Showing long list