|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
[struts 2] Table questionHi,
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 questionI 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 <milanmilanovich@...> 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 |
|
|
|
|
|
Re: [struts 2] Table questionHi!
To have a composed string you can do it in JSP. Something like: <s:select list='fruit' listKey='fruit_id' listValue="${fruit_id} ${fruit_name}" /> for example. And, for pagination, try displayTag, its easy to use Felipe A. Lorenz www.idealogic.com.br On Tue, May 13, 2008 at 12:00 PM, Milan Milanovic <milanmilanovich@...> wrote: > Thanks Jim! > Could you give me an example for the second thing (pagination) ? I need > something > simple as you said. > For combo box, how can I tell my combobox to retrieve data from list of > composed > strings (e.g. List<String> where I will compose "1 Apple"), but when > selected to choose > in my action class from list of Fruits, e.g. List<Fruit>, where Fruit > have id and name attributes ? > -- > Thx, Milan Milanovic > > > ----- Original Message ---- > From: Jim Kiley <jhkiley@...> > To: Struts Users Mailing List <user@...> > Sent: Tuesday, May 13, 2008 3:34:58 PM > Subject: Re: [struts 2] Table question > > 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 < > milanmilanovich@...> > 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 > > > > > |
|
|
Re: [struts 2] Table questionExcept you can't use EL expressions in struts tags in the latest versions of
S2, unless you hack the taglib. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications > From: Felipe Lorenz <felipe.lorenz@...> > Reply-To: Struts Users Mailing List <user@...> > Date: Tue, 13 May 2008 18:44:52 -0300 > To: Struts Users Mailing List <user@...> > Subject: Re: [struts 2] Table question > > Hi! > > To have a composed string you can do it in JSP. > > Something like: > > <s:select list='fruit' listKey='fruit_id' listValue="${fruit_id} > ${fruit_name}" /> > for example. > > And, for pagination, try displayTag, its easy to use > > Felipe A. Lorenz > www.idealogic.com.br > > On Tue, May 13, 2008 at 12:00 PM, Milan Milanovic <milanmilanovich@...> > wrote: > >> Thanks Jim! >> Could you give me an example for the second thing (pagination) ? I need >> something >> simple as you said. >> For combo box, how can I tell my combobox to retrieve data from list of >> composed >> strings (e.g. List<String> where I will compose "1 Apple"), but when >> selected to choose >> in my action class from list of Fruits, e.g. List<Fruit>, where Fruit >> have id and name attributes ? >> -- >> Thx, Milan Milanovic >> >> >> ----- Original Message ---- >> From: Jim Kiley <jhkiley@...> >> To: Struts Users Mailing List <user@...> >> Sent: Tuesday, May 13, 2008 3:34:58 PM >> Subject: Re: [struts 2] Table question >> >> 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 < >> milanmilanovich@...> >> 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 >> >> >> >> >> This email and any attachments ("Message") may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
|
|
|
|
|
|
Re: [struts 2] Table questionOGNL expressions. It is in the documentation. :)
Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications > From: Milan Milanovic <milanmilanovich@...> > Reply-To: Struts Users Mailing List <user@...> > Date: Tue, 13 May 2008 15:05:34 -0700 (PDT) > To: Struts Users Mailing List <user@...> > Subject: Re: [struts 2] Table question > > O.K. Thanks. > > So, what you propose to show id and name to user ? > > -- > Thx, Milan > > > ----- Original Message ---- > From: Randy Burgess <RBurgess@...> > To: Struts Users Mailing List <user@...> > Sent: Tuesday, May 13, 2008 11:47:57 PM > Subject: Re: [struts 2] Table question > > Except you can't use EL expressions in struts tags in the latest versions of > S2, unless you hack the taglib. > > Regards, > Randy Burgess > Sr. Web Applications Developer > Nuvox Communications > > > >> From: Felipe Lorenz <felipe.lorenz@...> >> Reply-To: Struts Users Mailing List <user@...> >> Date: Tue, 13 May 2008 18:44:52 -0300 >> To: Struts Users Mailing List <user@...> >> Subject: Re: [struts 2] Table question >> >> Hi! >> >> To have a composed string you can do it in JSP. >> >> Something like: >> >> <s:select list='fruit' listKey='fruit_id' listValue="${fruit_id} >> ${fruit_name}" /> >> for example. >> >> And, for pagination, try displayTag, its easy to use >> >> Felipe A. Lorenz >> www.idealogic.com.br >> >> On Tue, May 13, 2008 at 12:00 PM, Milan Milanovic <milanmilanovich@...> >> wrote: >> >>> Thanks Jim! >>> Could you give me an example for the second thing (pagination) ? I need >>> something >>> simple as you said. >>> For combo box, how can I tell my combobox to retrieve data from list of >>> composed >>> strings (e.g. List<String> where I will compose "1 Apple"), but when >>> selected to choose >>> in my action class from list of Fruits, e.g. List<Fruit>, where Fruit >>> have id and name attributes ? >>> -- >>> Thx, Milan Milanovic >>> >>> >>> ----- Original Message ---- >>> From: Jim Kiley <jhkiley@...> >>> To: Struts Users Mailing List <user@...> >>> Sent: Tuesday, May 13, 2008 3:34:58 PM >>> Subject: Re: [struts 2] Table question >>> >>> 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 < >>> milanmilanovich@...> >>> 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 >>> >>> >>> >>> >>> > > > > This email and any attachments ("Message") may contain legally privileged > and/or confidential information. If you are not the addressee, or if this > Message has been addressed to you in error, you are not authorized to read, > copy, or distribute it, and we ask that you please delete it (including all > copies) and notify the sender by return email. Delivery of this Message to > any person other than the intended recipient(s) shall not be deemed a waiver > of confidentiality and/or a privilege. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@... > For additional commands, e-mail: user-help@... > > > This email and any attachments ("Message") may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
|
| Free Forum Powered by Nabble | Forum Help |