wood burning stoves 2.0*
The moose likes Struts and the fly likes displaytag help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
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: 41124
    
  45
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?


Ping & DNS - my free Android networking tools app
 
Don't get me started about those stupid light bulbs.
 
subject: displaytag help
 
Similar Threads
Showing long list
Question on using DisplayTag in JSPs
Displaytag question
retaining search criteria values while sorting or navigating using displaytag
Regarding Scrollable Content and fixed Headers in DisplayTag