RE: creating my Class

2003-03-21 Thread ALAMI Ahmed
May be like this:

public class Records{
private List records = new ArrayList();
//Constructor
public addRecord(Record record){
records.add(record);
}
// get and set methods
}


public class Record {
private Liste subRecords = new ArrayList();
private String name=null;
private String description = null;
//Constructor
public addSubRecord(SubRecord subRecord){
subRecords.add(subRecord);
// get and set methods
}
}

public class SubRecord{
//Constructor
private String name=null;
private String description = null;
// get and set methods
}
So in your class Action you construct the Records objetcs and you display it in the 
JSP page using  and  tags

Hope it helps you




-Message d'origine-
De : Richard Raquepo [mailto:[EMAIL PROTECTED]
Envoyé : Friday, March 21, 2003 10:12 AM
À : Struts Users Mailing List
Objet : creating my Class


I am in the process of designing a class but coudn't figure out how to start it 
because i'm thinking how
struts tags will display my info.

My expected output is like this

Record1blahblah
Record1_sub_detail1blah
Record1_sub_detail1blah
Record1_sub_detail1blah
Record2blah
Record3blah
Record3_sub_detail1blah

I don't how will be the data type of my class probably it will look like this:

class Record {
ArrayList record;
ArrayList subrecord[];
}


r really don't what to use really. Can someone give me some idea and also how will i 
be able to display it in
my JSP using struts tags.

thanks a lot.

-Richard


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: creating my Class

2003-03-21 Thread Mick . Knutson
That depends, if you are going to have 1 Class per Record, then you could do something 
like:
But if you need to reference each record by name, then you can either add a "name 
Attribute to the Record like:

class Record {
private String name;
private ArrayList record;

public void setSubRecord(Record subRecord){...}
public Record getSubRecord(String recordName){
   loop...
   if( record.getName().equals(recordName) )
   return record;
}

public void setName(String name){...}
public String getName(){...}

}

Then you can just search each RecordObject in the ArrayList.

Of coarse you can always look at a HashMap as well.

  _  

Thank You
 
Mick Knutson
 
Sr. Designer - Project Trust
aUBS AG, Financial - Zürich
Office: +41 (0)1/234.42.75
Internal: 48194
Mobile: 079.726.14.26
  _  



-Original Message-
From: Richard Raquepo [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2003 10:22 AM
To: Struts Users Mailing List
Subject: Re: creating my Class


how can show my record-subrecord?

Record1blahblah
Record1_sub_detail1blah
Record1_sub_detail1blah
Record1_sub_detail1blah
Record2blah
Record3blah
Record3_sub_detail1blah

how will i put data and how will the matching be made.
i mean assuming i have a integer key, how is it done then.

 maybe you can show me some java code i will really appreciate it. thanks.


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 21, 2003 5:08 PM
Subject: RE: creating my Class


an ArrayList will hold Objects. an ArrayList is an object itself. So, the
ArrayList could contain other ArrayList's in it.


  _

Thank You

Mick Knutson

Sr. Designer - Project Trust
aUBS AG, Financial - Zürich
Office: +41 (0)1/234.42.75
Internal: 48194
Mobile: 079.726.14.26
  _



-Original Message-
From: Richard Raquepo [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2003 10:12 AM
To: Struts Users Mailing List
Subject: creating my Class


I am in the process of designing a class but coudn't figure out how to start
it because i'm thinking how
struts tags will display my info.

My expected output is like this

Record1blahblah
Record1_sub_detail1blah
Record1_sub_detail1blah
Record1_sub_detail1blah
Record2blah
Record3blah
Record3_sub_detail1blah

I don't how will be the data type of my class probably it will look like
this:

class Record {
ArrayList record;
ArrayList subrecord[];
}


r really don't what to use really. Can someone give me some idea and also
how will i be able to display it in
my JSP using struts tags.

thanks a lot.

-Richard

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any s

Re: creating my Class

2003-03-21 Thread Richard Raquepo
how can show my record-subrecord?

Record1blahblah
Record1_sub_detail1blah
Record1_sub_detail1blah
Record1_sub_detail1blah
Record2blah
Record3blah
Record3_sub_detail1blah

how will i put data and how will the matching be made.
i mean assuming i have a integer key, how is it done then.

 maybe you can show me some java code i will really appreciate it. thanks.


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 21, 2003 5:08 PM
Subject: RE: creating my Class


an ArrayList will hold Objects. an ArrayList is an object itself. So, the
ArrayList could contain other ArrayList's in it.


  _

Thank You

Mick Knutson

Sr. Designer - Project Trust
aUBS AG, Financial - Zürich
Office: +41 (0)1/234.42.75
Internal: 48194
Mobile: 079.726.14.26
  _



-Original Message-
From: Richard Raquepo [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2003 10:12 AM
To: Struts Users Mailing List
Subject: creating my Class


I am in the process of designing a class but coudn't figure out how to start
it because i'm thinking how
struts tags will display my info.

My expected output is like this

Record1blahblah
Record1_sub_detail1blah
Record1_sub_detail1blah
Record1_sub_detail1blah
Record2blah
Record3blah
Record3_sub_detail1blah

I don't how will be the data type of my class probably it will look like
this:

class Record {
ArrayList record;
ArrayList subrecord[];
}


r really don't what to use really. Can someone give me some idea and also
how will i be able to display it in
my JSP using struts tags.

thanks a lot.

-Richard

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: creating my Class

2003-03-21 Thread Mick . Knutson
an ArrayList will hold Objects. an ArrayList is an object itself. So, the ArrayList 
could contain other ArrayList's in it. 

 
  _  

Thank You
 
Mick Knutson
 
Sr. Designer - Project Trust
aUBS AG, Financial - Zürich
Office: +41 (0)1/234.42.75
Internal: 48194
Mobile: 079.726.14.26
  _  



-Original Message-
From: Richard Raquepo [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2003 10:12 AM
To: Struts Users Mailing List
Subject: creating my Class


I am in the process of designing a class but coudn't figure out how to start it 
because i'm thinking how
struts tags will display my info.

My expected output is like this

Record1blahblah
Record1_sub_detail1blah
Record1_sub_detail1blah
Record1_sub_detail1blah
Record2blah
Record3blah
Record3_sub_detail1blah

I don't how will be the data type of my class probably it will look like this:

class Record {
ArrayList record;
ArrayList subrecord[];
}


r really don't what to use really. Can someone give me some idea and also how will i 
be able to display it in
my JSP using struts tags.

thanks a lot.

-Richard

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]