struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vilpesh Mistry <vil_mis...@yahoo.com>
Subject Re: How to use checkbox in struts.
Date Tue, 07 Feb 2006 09:02:20 GMT
hi
Use boolean.

--- Joey Watson <joey.information@gmail.com> wrote:

> Hello everybody.
> 
> I think this is a old question. but I can not find a
> good and complete
> example in Google.
> My question is :
> 
> I have a Jsp page which will list some datas for
> user. user can choose(by
> click the checkbox) some of those data and click a
> botton for delete or some
> others operator. So I think my Action class ,
> ActionForm , data class and
> JSP will like this.
>
----------------------------------------------------------------------
> Row {
> private String isSelect;
> public getIsSelect() {
> }
> public setIsSelect() {
> }
> }
>
--------------------------------------------------------------------
> ActionForm {
> 
> private ArrayList rows; //dynamic
> 
> public get....
> public set...
> }
>
---------------------------------------------------------------------
> Action {
> ...
>   for (int i = 0; i < ActionForm.rows.size; i++){
>    Row row = ActionForm.rows.get(i);
>    if ( row.isSelect =="check" ) {
>      //Do some thing here.
>    }
>   }
> }
>
....................................................................
> JSP page.
> 
> I have to use <input type = "checkbox"> or
> <Html:Checkout> for data list.
> datas quantity is not fix.
> can not use <html:Mutibox>
> 
> and I need use a botton commit data to Action.
>
--------------------------------------------------------------------
> my problem is :
> 
> 1. In Row class. If define isSelect as a String , is
> it ok, or boolean is
> better?
> 2. I don't know how to write <input type =
> "checkbox"> or <Html:Checkout> to
> make a checkbox, and make action can know whick is
> be selected.
> 
> Thanks for any help.
> 
> Joey
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message