DyanActionForm and html:select, html:options tags

2003-02-20 Thread Anand M S
Hi,
  If I use DyanActionForm, how should I populate dropdown box using
html:options tag? we would declare all the form attributes in
struts-config.xml, how should I initialize the collection and where?

Thanks,
Anand

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




RE: DyanActionForm and html:select, html:options tags

2003-02-20 Thread Jarnot Voytek Contr AU HQ/SC
html:select deals with populating a form property (a String - typically -
for single-select, and array for multi-select); html:options needs a
collection placed into some scope which is commonly done in the Action class
that forwards to the JSP which needs to display the drop-down box.

--
Voytek Jarnot
Quidquid latine dictum sit, altum viditur.


 -Original Message-
 From: Anand M S [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 20, 2003 9:14 AM
 To: Struts Users Mailing List
 Subject: DyanActionForm and html:select, html:options tags
 
 
 Hi,
   If I use DyanActionForm, how should I populate dropdown box using
 html:options tag? we would declare all the form attributes in
 struts-config.xml, how should I initialize the collection and where?
 
 Thanks,
 Anand
 
 -
 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: DyanActionForm and html:select, html:options tags

2003-02-20 Thread Anand M S
Thanks for reply. But how can we do this using DynaActionForm, I'm not sure,
please can u provide some code sample?

Thanks in advance.

- Original Message -
From: Jarnot Voytek Contr AU HQ/SC [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, February 20, 2003 10:20 AM
Subject: RE: DyanActionForm and html:select, html:options tags


 html:select deals with populating a form property (a String - typically -
 for single-select, and array for multi-select); html:options needs a
 collection placed into some scope which is commonly done in the Action
class
 that forwards to the JSP which needs to display the drop-down box.

 --
 Voytek Jarnot
 Quidquid latine dictum sit, altum viditur.


  -Original Message-
  From: Anand M S [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, February 20, 2003 9:14 AM
  To: Struts Users Mailing List
  Subject: DyanActionForm and html:select, html:options tags
 
 
  Hi,
If I use DyanActionForm, how should I populate dropdown box using
  html:options tag? we would declare all the form attributes in
  struts-config.xml, how should I initialize the collection and where?
 
  Thanks,
  Anand
 
  -
  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]



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




Re: DyanActionForm and html:select, html:options tags

2003-02-20 Thread Anand M S

If we use ActionForm, then we will be  having getter for collection which we
can use in our jsp, here is the code
html:select name=userForm property=testStatus 
html:options collection=list property=name labelProperty=value /

/html:select

But how can we get the same functionality if we use DynaActionForm, all
attributes will be in xml config file. Then how and where can we have
collection?

Any help would be greately appriciated

Thanks,
Anand

- Original Message -
From: Anand M S [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, February 20, 2003 10:35 AM
Subject: Re: DyanActionForm and html:select, html:options tags


 Thanks for reply. But how can we do this using DynaActionForm, I'm not
sure,
 please can u provide some code sample?

 Thanks in advance.

 - Original Message -
 From: Jarnot Voytek Contr AU HQ/SC [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Thursday, February 20, 2003 10:20 AM
 Subject: RE: DyanActionForm and html:select, html:options tags


  html:select deals with populating a form property (a String -
typically -
  for single-select, and array for multi-select); html:options needs a
  collection placed into some scope which is commonly done in the Action
 class
  that forwards to the JSP which needs to display the drop-down box.
 
  --
  Voytek Jarnot
  Quidquid latine dictum sit, altum viditur.
 
 
   -Original Message-
   From: Anand M S [mailto:[EMAIL PROTECTED]]
   Sent: Thursday, February 20, 2003 9:14 AM
   To: Struts Users Mailing List
   Subject: DyanActionForm and html:select, html:options tags
  
  
   Hi,
 If I use DyanActionForm, how should I populate dropdown box using
   html:options tag? we would declare all the form attributes in
   struts-config.xml, how should I initialize the collection and where?
  
   Thanks,
   Anand
  
   -
   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]
 
 

 -
 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: html:select html:options tags

2001-08-29 Thread chiji nwankwo
Hi,Depending on what you are trying to do or the scale of the applicationyou are building, you can declare the collection within your jsp pageand put it within the pageContext or you can declare it in your Action subclass and put it in the session.  I found the last option to be a neater and better way of doing things.  I think it will be a good idea todeclare / define the collection in the Action subclass, incase you needto populate the list from an external source, such as a database.Example 1 (within jsp page, taken from struts example application - subscription.jsp)% java.util.ArrayList list = new java.util.ArrayList(); list.add(new org.apache.struts.webapp.example.LabelValueBean("IMAP Protocol", "imap")); list.add(new org.apache.struts.webapp.example.LabelValueBean("POP3 Protocol", "pop3")); pageContext.setAttribute("serverTypes", list);% other code ..html:select property="type" html:options collection="serverTypes" property="value" labelProperty="label"//html:select other code ..* The LabelValueBean is a utility class, which is part of the struts example,that creates a bean object.  The object contains label value pairs, as thename implies.Example 2 ( within Action subclass )perform method - declared locally (avoid the use of instance variables in Action class).ArrayList list = new ArrayList(); .. other code ...serverTypes.add( new LabelValueBean( label - string, value - string ) );session.setAttribute( "serverTypes", serverTypes );.. other code ...jsp page.html:select property="type" html:options collection="serverTypes" property="value" //html:select* labelProperty can be omitted if the label and value have the same value.I hope this helps you.Chiji

From: Nandini Agarwal <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED] 
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject: tags 
Date: Tue, 28 Aug 2001 15:02:49 -0700 
MIME-Version: 1.0 
Received: from [64.125.133.20] by hotmail.com (3.2) with ESMTP id MHotMailBD55672B0073400438B1407D85140C9A0; Tue, 28 Aug 2001 15:33:15 -0700 
Received: (qmail 3917 invoked by uid 500); 28 Aug 2001 22:05:39 - 
Received: (qmail 3908 invoked from network); 28 Aug 2001 22:05:38 - 
Received: from freedom.mrstock.com (216.52.133.36) by daedalus.apache.org with SMTP; 28 Aug 2001 22:05:38 - 
Received: from office-mail.mrstock.com (office-mail.mrstock.com [63.204.129.19])by freedom.mrstock.com (Postfix) with ESMTP id 57E021B8for <[EMAIL PROTECTED]>; Tue, 28 Aug 2001 17:03:22 -0400 (EDT) 
Received: by office-mail.mrstock.com with Internet Mail Service (5.5.2653.19)id ; Tue, 28 Aug 2001 15:02:54 -0700 
From struts-user-return-16231-cn081 Tue, 28 Aug 2001 15:34:00 -0700 
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm 
Precedence: bulk 
list-help: 
list-unsubscribe: 
list-post: 
Delivered-To: mailing list [EMAIL PROTECTED] 
Message-ID: <[EMAIL PROTECTED]>
X-Mailer: Internet Mail Service (5.5.2653.19) 
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 
 
Hi, 
I am new to java, struts, jsp and EJB. And guess what, I need help. 
 
What, I need to do is substitute the following with the collection ... tag. 
 
 
 Less than $5,000 
 Greater than $5,000 
 Greater than $10,000 
 Greater than $15,000 
 Greater than $20,000 
 Greater than $25,000 
 Greater than $30,000 
 Greater than $40,000 
 Greater than $50,000 
 Greater than $75,000 
 Greater than $100,000 
 Greater than $150,000 
 Greater than $200,000 
 Greater than $300,000 
 Greater than $500,000 
 Greater than $750,000 
 Greater than $1,000,000 
 
 
 
 
 
I need help here with some code examples. Also, where do I need to create 
the collection (In actionform ?)? 
 
 
Thanks, 
Nandini 
Get your FREE download of MSN Explorer at http://explorer.msn.com


RE: html:select html:options tags

2001-08-29 Thread Nandini Agarwal



Thanks 
so much. This makes thing so much clearer for me.


  -Original Message-From: chiji nwankwo 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, August 29, 2001 2:47 
  AMTo: [EMAIL PROTECTED]Subject: Re: 
  html:select html:options tags
  
  Hi,Depending on what you are trying to do or the scale of the applicationyou are building, you can declare the collection within your jsp pageand put it within the pageContext or you can declare it in your Action subclass and put it in the session.  I found the last option to be a neater and better way of doing things.  I think it will be a good idea todeclare / define the collection in the Action subclass, incase you needto populate the list from an external source, such as a database.Example 1 (within jsp page, taken from struts example application - subscription.jsp)% java.util.ArrayList list = new java.util.ArrayList(); list.add(new org.apache.struts.webapp.example.LabelValueBean("IMAP Protocol", "imap")); list.add(new org.apache.struts.webapp.example.LabelValueBean("POP3 Protocol", "pop3")); pageContext.setAttribute("serverTypes", list);% other code ..html:select property="type" html:options collection="serverTypes" property="value" labelProperty="label"//html:select other code ..* The LabelValueBean is a utility class, which is part of the struts example,that creates a bean object.  The object contains label value pairs, as thename implies.Example 2 ( within Action subclass )perform method - declared locally (avoid the use of instance variables in Action class).ArrayList list = new ArrayList(); .. other code ...serverTypes.add( new LabelValueBean( label - string, value - string ) );session.setAttribute( "serverTypes", serverTypes );.. other code ...jsp page.html:select property="type" html:options collection="serverTypes" property="value" //html:select* labelProperty can be omitted if the label and value have the same value.I hope this helps you.Chiji
  
  From: Nandini Agarwal <[EMAIL PROTECTED]>
  Reply-To: [EMAIL PROTECTED] 
  To: "'[EMAIL PROTECTED]'" 
  <[EMAIL PROTECTED]>
  Subject: tags 
  Date: Tue, 28 Aug 2001 15:02:49 -0700 
  MIME-Version: 1.0 
  Received: from [64.125.133.20] by hotmail.com (3.2) with ESMTP 
  id MHotMailBD55672B0073400438B1407D85140C9A0; Tue, 28 Aug 2001 15:33:15 -0700 
  Received: (qmail 3917 invoked by uid 500); 28 Aug 2001 22:05:39 
  - 
  Received: (qmail 3908 invoked from network); 28 Aug 2001 
  22:05:38 - 
  Received: from freedom.mrstock.com (216.52.133.36) by 
  daedalus.apache.org with SMTP; 28 Aug 2001 22:05:38 - 
  Received: from office-mail.mrstock.com (office-mail.mrstock.com 
  [63.204.129.19])by freedom.mrstock.com (Postfix) with ESMTP id 57E021B8for 
  <[EMAIL PROTECTED]>; Tue, 28 Aug 2001 17:03:22 -0400 (EDT) 
  Received: by office-mail.mrstock.com with Internet Mail Service 
  (5.5.2653.19)id ; Tue, 28 Aug 2001 15:02:54 -0700 
  From struts-user-return-16231-cn081 Tue, 28 Aug 2001 15:34:00 
  -0700 
  Mailing-List: contact [EMAIL PROTECTED]; run 
  by ezmlm 
  Precedence: bulk 
  list-help: <mailto:[EMAIL PROTECTED]>
  list-unsubscribe: 
  <mailto:[EMAIL PROTECTED]>
  list-post: <mailto:[EMAIL PROTECTED]>
  Delivered-To: mailing list [EMAIL PROTECTED] 
  Message-ID: 
  <[EMAIL PROTECTED]>
  X-Mailer: Internet Mail Service (5.5.2653.19) 
  X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 
   
  Hi, 
  I am new to java, struts, jsp and EJB. And guess what, I need 
  help. 
   
  What, I need to do is substitute the following with the 
  collection ... tag. 
   
   
   Less than $5,000 
   Greater than $5,000 
   Greater than $10,000 
   Greater than $15,000 
   Greater than $20,000 
   Greater than $25,000 
   Greater than $30,000 
   Greater than $40,000 
   Greater than $50,000 
   Greater than $75,000 
   Greater than $100,000 
   Greater than $150,000 
   Greater than $200,000 
   Greater than $300,000 
   Greater than $500,000 
   Greater than $750,000 
   Greater than $1,000,000 
   
   
   
   
   
  I need help here with some code examples. Also, where do I need 
  to create 
  the collection (In actionform ?)? 
   
   
  Thanks, 
  Nandini 
  
  
  Get your FREE download of MSN Explorer at http://explorer.msn.com


html:select html:options tags

2001-08-28 Thread Nandini Agarwal

Hi,
I am new to java, struts, jsp and EJB. And  guess what, I need help.

What, I need to do is  substitute the following with the html:options
collection ... tag.
 
tdhtml:select property=liquidNetWorth
option value=10Less than $5,000
option value=11Greater than $5,000
option value=12Greater than $10,000
option value=13Greater than $15,000
option value=14Greater than $20,000
option value=15Greater than $25,000
option value=16Greater than $30,000
option value=17Greater than $40,000
option value=18Greater than $50,000
option value=19Greater than $75,000
option value=20Greater than $100,000
option value=21Greater than $150,000
option value=22Greater than $200,000
option value=23Greater than $300,000
option value=24Greater than $500,000
option value=25Greater than $750,000
option value=26Greater than $1,000,000
/html:select

/td


I need help here with some code examples. Also, where do I need to create
the collection  (In actionform ?)?


Thanks,
Nandini