You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Milan Milanovic <mi...@yahoo.com> on 2008/05/13 15:30:38 UTC

[struts 2] Table question

Hi,
first I'll ask again my earlier question, is there possibility to show in a combo box
two values, for example I want to show id and name of the every fruit: 1 Apple ?
The second question is, my struts 2 application on one jsp page will have 5 combo
boxes, 4 text boxes, two buttons and two datetime pickers, and below all these controls a table
that will show what is entered using controls above. The problem is that my table will have
about 100-120 records (rows) to show, and I think that is very much for one jsp page, and
also I want user to see about last 10 rows, because he need to see if there is any error. 
How can I do this, can I use table pagination (how) ?
--
Thx in advance, Milan Milanovic


      

Re: [struts 2] Table question

Posted by Jim Kiley <jh...@summa-tech.com>.
I have to admit that in your first instance I would cheat -- I would dummy
up a method somewhere on my action class or my POJO that returned the
desired string, rather than trying to compose the string within the JSP.

I am unfamiliar with the various tags that can be used to display chunks of
a table.  I know they're out there (the display tag library comes to mind).
The most recent time I had to do this I rolled my own; it was pretty
painless.  I held the data in a List of data objects, and then used
List.subList() in my action method to determine the precise chunk of the
List that I wanted to show.

Hope this helps.

jk

On Tue, May 13, 2008 at 9:30 AM, Milan Milanovic <mi...@yahoo.com>
wrote:

> Hi,
> first I'll ask again my earlier question, is there possibility to show in
> a combo box
> two values, for example I want to show id and name of the every fruit: 1
> Apple ?
> The second question is, my struts 2 application on one jsp page will have
> 5 combo
> boxes, 4 text boxes, two buttons and two datetime pickers, and below all
> these controls a table
> that will show what is entered using controls above. The problem is that
> my table will have
> about 100-120 records (rows) to show, and I think that is very much for
> one jsp page, and
> also I want user to see about last 10 rows, because he need to see if
> there is any error.
> How can I do this, can I use table pagination (how) ?
> --
> Thx in advance, Milan Milanovic
>
>
>




-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com