wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts 2 and displaytag issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 and displaytag issue" Watch "Struts 2 and displaytag issue" New topic
Author

Struts 2 and displaytag issue

Toni Montero
Greenhorn

Joined: Jul 04, 2012
Posts: 7
Hi!

I need to paginate a resultList and in this forum i see in other post that you recomend to use displayTag, so I introduce it into my project but now i have an issue that i can't see the solution.

Every row (table generated with displaytag for pagination) contains product info like:

idArticle, name, description, price.

And in another 2 columns I need an input with quantity and the other one a submit link to add current row (product) in a cart.

The problem is that i don't know how to take the number of quantity input and put it in 'column-link' to 'add-to-cart'.

This is the resultList (bean):




Here the jsp:



In column property = "idArticulo" will be an image with 'Add to cart' and after click on it it must send an object to my action with 'Cantidad' input value and idArticulo.

Can anyone help me? What i have to do? Javascript? I read something about decorators in displaytag documentation but there is nothing about picking an input value that is not in ArticleBean...

Thanks in advance and excuse me if I don't speak (write in this case.. ) english very well... ^^
ganapathi pudi
Greenhorn

Joined: Apr 29, 2012
Posts: 10
Click on idArticulo give tag specified parameters href="addArticuloCarritoAction"(Action name) paramId="Articulo.idArticulo" (giving param default value is properity)
finally the solution is

in action you geeting cantidad value is idArticulo(click iteam) handle operations.
further ref display tag tutorial
Toni Montero
Greenhorn

Joined: Jul 04, 2012
Posts: 7
thanks for your replay ganapathi, but this is not what I need. I mean to pass multiple paramters in action link, in this case two parameters, idArticulo and cantidad, but I don't know how to pick the input value named cantidad..

Thank you again.
ganapathi pudi
Greenhorn

Joined: Apr 29, 2012
Posts: 10
generate getters and setter to cantidad at actionclass then getCantidad() returns related idArticulo value. and for multiple values write a decorator .
Toni Montero
Greenhorn

Joined: Jul 04, 2012
Posts: 7
ganapathi pudi wrote:generate getters and setter to cantidad at actionclass then getCantidad() returns related idArticulo value. and for multiple values write a decorator .


Ok. I read something about decorators but still I need to try it. Let's see how it works.

Thank you so much, if i need more help then i will answer here.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2 and displaytag issue