struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mano dasanayake" <m...@mubasher.net>
Subject RE: logic:iterate for arraylist of beans
Date Wed, 13 Dec 2006 20:59:13 GMT
Hi ,
I'm using 1.2 any how...what I mean in the Iterate code is that you simply 
Define an ID for the bean that you are about to iterate...

For an instance,


<logic:iterate id="EMp" name="YourFormBean" property="EmplyList"
type="com.yourCom.common.beans.Employee ">


</logic:iterate>

So you'r going to iterate thru your "EmplyList" and refer 
Each of ur bean by name "EMp".
 Then you can get whatever the attribute you want from your Bean,(Employee).

For this case I think better to use <html:multibox>,,,
Can you explain your requirement specifically?

Regards,
Mano







-----Original Message-----
From: Kranti Parisa [mailto:kranti.parisa@gmail.com] 
Sent: Wednesday, December 13, 2006 3:06 PM
To: Struts Users Mailing List
Subject: Re: logic:iterate for arraylist of beans

Hi Mano,

In the code you have written <logic:iterate id="Emp" type=""...>

"Emp" should be the name of the ArrayList right?

and in logic:iterate type is there? i hope you mean to say collection="" ..

and i need to submit the form after selecting what ever checkboxes that i
need to delete and then click on the detele button.but in the code that you
gave me will submit the orm when i click on the checkbox i think.

the problem is for the "value" of the checkbox
i should assign the value of the checkbox as empid. so that when i submit
the form we can capture all the checked empid using req.gerParamaterValues

please suggest something


On 12/14/06, mano dasanayake <mano@mubasher.net> wrote:
>
> Hi,
> As I understood what you have to do is,
> Iterate through your list and add checkboxes as folllwing...
>
> <logic:iterate id="Emp" type=""...>
>
> <html:checkbox  property="prop1" value="true"
> onclick="submitForm("editaction.do?id=<bean:write name="Emp"
> property="ID"/>")" />
> <bean:write name="Emp" property="name"/>
>
>
> </logic:iterate>
>
> Regards,
> Mano
>
>
>
>
> -----Original Message-----
> From: Kranti Parisa [mailto:kranti.parisa@gmail.com]
> Sent: Wednesday, December 13, 2006 2:07 PM
> To: Struts Users Mailing List
> Subject: logic:iterate for arraylist of beans
>
> hi,
>
> i am facing proble for the following
> =========================
> assigning value to check box
>
> say logic:iterate is having arraylist
> this arraylist is with beans
> means for example employee bean
> i want to view all emps in jsp
> what we will do is we create a bean for each employee
> and add tht bean to arraylist
> so tht we have this arraylist in jsp
> then we use logic:iterate
> to iterate the arraylist
> now we need to print the rows
> each row contains a check box
> this check box should get the value as empid
> so tht when i select the checkbox
> we can do delete or modify..etc
> ============================
>
> plzzzzz suggest/help from this.
> stuck up completely with this.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
------------------
Best Regards
Kranti Kiran Kumar Parisa
Mobile: +91 - 9849 - 625 - 625             +91 - 9391 - 438 - 738



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


Mime
View raw message