struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frost, Gary [IT]" <Gary.Fr...@citigroup.com>
Subject Re: Nested Bean Problem
Date Mon, 28 Jul 2003 05:35:42 GMT
Or you could create a new class, JBNCCArrayList  (Java Bean Naming
Convention Compliant Array List) or some other (nicer) name,  that extends
ArrayList (remember to include all the appropriate constructors), that adds
the following method
	public int getSize()
	{
		return size();
	}

And use that in place of the ArrayList.  This will allow the BeanUtils to
get the size  (e.g. "userBean.roleUser[0].menuComponent.size") because the
naming convention is in place, and this solution does not require extra
object creation (as in the CollectionBean suggestion).

I really think Sun should fix this, it annoys the c*!p out of me, I
personally can't see the harm in 'adding' the Collection Classes to fix this
naming convention error, by adding (not a wholesale rename) they can
maintain backward compatibility (perhaps marking size() as deprecated).  But
then I'm not a Language Specification writer, so maybe I'm missing
something.

Gary




-----Original Message-----
From: Nagaraj_K [mailto:Nagaraj_K@satyam.com]
Sent: Friday, 25 July 2003 3:15 PM
To: Struts Users Mailing List
Subject: RE: Nested Bean Problem


Why not add a method in the roleUserBean which returns the size of the
ArrayList menuComponent Bean? Using the index of the iterator you will get
the roleUserBean component using which u can get the size of the
menuComponent ArrayList.

Nagaraj

-----Original Message-----
From: prashant.mdesai@seepz.tcs.co.in
[mailto:prashant.mdesai@seepz.tcs.co.in]
Sent: Friday, July 25, 2003 10:39 AM
To: Struts Users Mailing List
Subject: Re: Nested Bean Problem



Actually the ArrayList menuComponentBean is having all the menuNames which
I am showing in the top header row of a html table. I want to set the
colspan of all the other rows equal to the number of menu items in this
row.



Thanks,
Prashant.




 

                    "Nagendra

                    Kumar O V S"         To:
<struts-user@jakarta.apache.org>                                  
                    <nagendra@iki        cc:

                    go.com>              Subject:     Re: Nested Bean
Problem                                      
 

                    07/25/03

                    10:22 AM

                    Please

                    respond to

                    "Struts Users

                    Mailing List"

 

 




 

 hi,

 why do u want to get the size of the collection...?

 u can use indexId attribute which gives the index of the iterator

 

 -- nagi

 

 -------Original Message-------

 

 From: Struts Users Mailing List

 Date: Friday, July 25, 2003 09:57:28 AM

 To: struts-user@jakarta.apache.org

 Subject: Nested Bean Problem

 

 Hi,

 I have a problem handling nested beans..

 For example...

 I have a userBean as given below

 private int userID;

 private String lastName;

 private String firstName;

 private ArrayList roleUser;

 Where the last field Arraylist is the arraylist of the objects of the bean

 called roleUserBean.

 

 Again the roleUserBean has the following properties.

 private int roleid;

 private String desc;

 private String name;

 private ArrayList menuComponent;

 The last property menuComponent is the arrayList of objects of the bean

 called menuComponentBean.

 

 Now the menuComponentBean contains

 private int menuID;

 private String menuName;

 private String description;

 

 

 I have put the userBean in the session scope. Now I want to know how many

 objects are there in the menuComponentBean (size of the ArrayList

 menuComponentBean). I am not able to get that. Please help.

 

 Thanks in advance.

 Prashant M Desai.

 

 

 

 ---------------------------------------------------------------------

 To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org

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

 

 

 

 

 

 

 ---------------------------------------------------------------------

 To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org

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

 

 

 .

 

 

 

 

 

 

 

 



____________________________________________________
  IncrediMail - Email has finally evolved - Click Here




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
************************************************************************** 
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************

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


Mime
View raw message