Re: logic:iterate for arraylist of beans
hi i am using the following code in jsp ArrayList alEmpList = (ArrayList) request.getAttribute("alemp"); but i am not getting the value from the bean that is there in the List Please do suggest me On 12/13/06, Kranti Parisa <[EMAIL PROTECTED]> wrote: Dear Anil, thanks for the information. but the one you are doing is a traditional way of getting the data. but as we are using struts there should be some good way to get this done. if i get any solution i will update the forum On 12/13/06, Anil Kumar T <[EMAIL PROTECTED]> wrote: > > > Hi Kranti, > > I also had a similar requirement. But I did it in bad way.. which is ... > > > > > See if this helps you as a quick fix. But if you get a better solution > do let the group know > Thanks & regards, > Anil. > > > -Original Message- > From: Kranti Parisa [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 13, 2006 3:23 PM > To: Struts Users Mailing List > Subject: Re: logic:iterate for arraylist of beans > > Dear Mano, > > I need to display the employees from the emp table > emp table is having following columns > 1) empid > 2) fname > 3) lname > 4) email > 5) mobile ...etc > > so when i fire a query i will be getting Result Set. while looping the > result set i am creating EmployeeBean > > eg: > > while(rs.next()){ > EmployeeBean objEmployee= new EmployeeBean(); > objEmployee.setEmpID(rs.getString(1)); > > similarly for other properties of the bean > then add this to ArrayList > al.add(objEmployee); > > } // end of while loop > > after that sending the arraylist to jsp thru request.setAttribute > > in JSP now i need to iterate the ArrayList of Employee Beans > and display in a form > > hope this is clear now. in this case not using any FormBean. directly > getting ArrayList and sending thru request. > > so please give me the code template that i need to use > my arraylist name : al > my employee bean name : EmployeeBean > properties in bean: empID,firstName,middleName,...etc > > > > On 12/14/06, mano dasanayake <[EMAIL PROTECTED]> wrote: > > > > 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, > > > > > > > type="com.yourCom.common.beans.Employee "> > > > > > > > > > > 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 ,,, > > Can you explain your requirement specifically? > > > > Regards, > > Mano > > > > > > > > > > > > > > > > -Original Message- > > From: Kranti Parisa [mailto:[EMAIL PROTECTED] ] > > 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 > > > > "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 <[EMAIL PROTECTED]> wrote: > > > > > > Hi, > > > As I understood what you have to do is, > > > Iterate through your list and add checkboxes as folllwing... > > > > > > > > > > > > > > onclick="submitForm(" editaction.do?id= > > property="ID"/>")" /> > > > > > > > > > > > > > > > > > > Regards, > > > Mano > > > > > > > > > > > > > > > -Original Message- > > > From: Kranti Parisa [mailto: [EMAIL PROTECTED] > > > Sent: Wednesday, December 13
Re: logic:iterate for arraylist of beans
Dear Anil, thanks for the information. but the one you are doing is a traditional way of getting the data. but as we are using struts there should be some good way to get this done. if i get any solution i will update the forum On 12/13/06, Anil Kumar T <[EMAIL PROTECTED]> wrote: Hi Kranti, I also had a similar requirement. But I did it in bad way.. which is ... See if this helps you as a quick fix. But if you get a better solution do let the group know Thanks & regards, Anil. -Original Message- From: Kranti Parisa [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 13, 2006 3:23 PM To: Struts Users Mailing List Subject: Re: logic:iterate for arraylist of beans Dear Mano, I need to display the employees from the emp table emp table is having following columns 1) empid 2) fname 3) lname 4) email 5) mobile ...etc so when i fire a query i will be getting Result Set. while looping the result set i am creating EmployeeBean eg: while(rs.next()){ EmployeeBean objEmployee= new EmployeeBean(); objEmployee.setEmpID(rs.getString(1)); similarly for other properties of the bean then add this to ArrayList al.add(objEmployee); } // end of while loop after that sending the arraylist to jsp thru request.setAttribute in JSP now i need to iterate the ArrayList of Employee Beans and display in a form hope this is clear now. in this case not using any FormBean. directly getting ArrayList and sending thru request. so please give me the code template that i need to use my arraylist name : al my employee bean name : EmployeeBean properties in bean: empID,firstName,middleName,...etc On 12/14/06, mano dasanayake <[EMAIL PROTECTED]> wrote: > > 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, > > > type="com.yourCom.common.beans.Employee "> > > > > > 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 ,,, > Can you explain your requirement specifically? > > Regards, > Mano > > > > > > > > -Original Message- > From: Kranti Parisa [mailto:[EMAIL PROTECTED] > 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 > > "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 <[EMAIL PROTECTED]> wrote: > > > > Hi, > > As I understood what you have to do is, > > Iterate through your list and add checkboxes as folllwing... > > > > > > > > > onclick="submitForm("editaction.do?id= > property="ID"/>")" /> > > > > > > > > > > > > Regards, > > Mano > > > > > > > > > > -Original Message- > > From: Kranti Parisa [mailto:[EMAIL PROTECTED] > > 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 > > > > > > plz suggest/help from this. > > stuck up completely with this. > > > > > > > >
RE: logic:iterate for arraylist of beans
Hi Kranti, I also had a similar requirement. But I did it in bad way.. which is ... See if this helps you as a quick fix. But if you get a better solution do let the group know Thanks & regards, Anil. -Original Message- From: Kranti Parisa [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 13, 2006 3:23 PM To: Struts Users Mailing List Subject: Re: logic:iterate for arraylist of beans Dear Mano, I need to display the employees from the emp table emp table is having following columns 1) empid 2) fname 3) lname 4) email 5) mobile ...etc so when i fire a query i will be getting Result Set. while looping the result set i am creating EmployeeBean eg: while(rs.next()){ EmployeeBean objEmployee= new EmployeeBean(); objEmployee.setEmpID(rs.getString(1)); similarly for other properties of the bean then add this to ArrayList al.add(objEmployee); } // end of while loop after that sending the arraylist to jsp thru request.setAttribute in JSP now i need to iterate the ArrayList of Employee Beans and display in a form hope this is clear now. in this case not using any FormBean. directly getting ArrayList and sending thru request. so please give me the code template that i need to use my arraylist name : al my employee bean name : EmployeeBean properties in bean: empID,firstName,middleName,...etc On 12/14/06, mano dasanayake <[EMAIL PROTECTED]> wrote: > > 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, > > > type="com.yourCom.common.beans.Employee "> > > > > > 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 ,,, > Can you explain your requirement specifically? > > Regards, > Mano > > > > > > > > -Original Message- > From: Kranti Parisa [mailto:[EMAIL PROTECTED] > 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 > > "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 <[EMAIL PROTECTED]> wrote: > > > > Hi, > > As I understood what you have to do is, > > Iterate through your list and add checkboxes as folllwing... > > > > > > > > > onclick="submitForm("editaction.do?id= > property="ID"/>")" /> > > > > > > > > > > > > Regards, > > Mano > > > > > > > > > > -Original Message- > > From: Kranti Parisa [mailto:[EMAIL PROTECTED] > > 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 > > > > > > plz suggest/help from this. > > stuck up completely with this. > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > -- > Best Regards > Kranti Kiran Kumar Par
Re: logic:iterate for arraylist of beans
Dear Mano, I need to display the employees from the emp table emp table is having following columns 1) empid 2) fname 3) lname 4) email 5) mobile ...etc so when i fire a query i will be getting Result Set. while looping the result set i am creating EmployeeBean eg: while(rs.next()){ EmployeeBean objEmployee= new EmployeeBean(); objEmployee.setEmpID(rs.getString(1)); similarly for other properties of the bean then add this to ArrayList al.add(objEmployee); } // end of while loop after that sending the arraylist to jsp thru request.setAttribute in JSP now i need to iterate the ArrayList of Employee Beans and display in a form hope this is clear now. in this case not using any FormBean. directly getting ArrayList and sending thru request. so please give me the code template that i need to use my arraylist name : al my employee bean name : EmployeeBean properties in bean: empID,firstName,middleName,...etc On 12/14/06, mano dasanayake <[EMAIL PROTECTED]> wrote: 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, 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 ,,, Can you explain your requirement specifically? Regards, Mano -Original Message- From: Kranti Parisa [mailto:[EMAIL PROTECTED] 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 "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 <[EMAIL PROTECTED]> wrote: > > Hi, > As I understood what you have to do is, > Iterate through your list and add checkboxes as folllwing... > > > > onclick="submitForm("editaction.do?id= property="ID"/>")" /> > > > > > > Regards, > Mano > > > > > -Original Message----- > From: Kranti Parisa [mailto:[EMAIL PROTECTED] > 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 > > > plz suggest/help from this. > stuck up completely with this. > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- -- Best Regards Kranti Kiran Kumar Parisa Mobile: +91 - 9849 - 625 - 625 +91 - 9391 - 438 - 738 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- Best Regards Kranti Kiran Kumar Parisa Mobile: +91 - 9849 - 625 - 625 +91 - 9391 - 438 - 738
RE: logic:iterate for arraylist of beans
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, 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 ,,, Can you explain your requirement specifically? Regards, Mano -Original Message- From: Kranti Parisa [mailto:[EMAIL PROTECTED] 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 "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 <[EMAIL PROTECTED]> wrote: > > Hi, > As I understood what you have to do is, > Iterate through your list and add checkboxes as folllwing... > > > > onclick="submitForm("editaction.do?id= property="ID"/>")" /> > > > > > > Regards, > Mano > > > > > -Original Message- > From: Kranti Parisa [mailto:[EMAIL PROTECTED] > 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 > > > plz suggest/help from this. > stuck up completely with this. > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- -- Best Regards Kranti Kiran Kumar Parisa Mobile: +91 - 9849 - 625 - 625 +91 - 9391 - 438 - 738 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate for arraylist of beans
Hi Mano, In the code you have written "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 <[EMAIL PROTECTED]> wrote: Hi, As I understood what you have to do is, Iterate through your list and add checkboxes as folllwing... ")" /> Regards, Mano -Original Message- From: Kranti Parisa [mailto:[EMAIL PROTECTED] 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 plz suggest/help from this. stuck up completely with this. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- Best Regards Kranti Kiran Kumar Parisa Mobile: +91 - 9849 - 625 - 625 +91 - 9391 - 438 - 738
RE: logic:iterate for arraylist of beans
Hi, As I understood what you have to do is, Iterate through your list and add checkboxes as folllwing... ")" /> Regards, Mano -Original Message- From: Kranti Parisa [mailto:[EMAIL PROTECTED] 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 plz suggest/help from this. stuck up completely with this. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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 plz suggest/help from this. stuck up completely with this.