html:select / html:options

2004-03-23 Thread Christian Schlaefcke
Hi Folks!

for several days I mess around with html:select and html:options.

I want to access a collection with names or numbers (just
java.lang.String). This collection is available in the session. For
testing I generated my own collection in the jsp

%
 java.util.Collection list = new java.util.ArrayList();
 teilnehmerListe.add(name1);
 teilnehmerListe.add(name2);
 teilnehmerListe.add(name3);
 session.setAttribute(myList, list);
%
 html:form action=/myAction.do
  html:select property=selectedItem
   html:options collection=myList /
  /html:select
  html:submitOK/html:submit
 /html:form

When I run this I get an IllegalArgumentException: no name specified

I found out that both select and options have an argument name so I
added some dummies test1 and test2 just to have it and get (as
expected) another error: no bean found by that name test1.

What am I doing wrong? Can someone point me to the right direction?

Thanx and Regards,

Chris


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



RE: html:select / html:options

2004-03-23 Thread Lokanath
hi ,

i think u have to get the bean from session to some Collection
useing session.getAttribute(mylist) then assign it to some collection.then
use that collection for populating the select

   lokee

-Original Message-
From: Christian Schlaefcke [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 23, 2004 2:45 AM
To: Struts Users Mailing List
Subject: html:select / html:options


Hi Folks!

for several days I mess around with html:select and html:options.

I want to access a collection with names or numbers (just
java.lang.String). This collection is available in the session. For
testing I generated my own collection in the jsp

%
 java.util.Collection list = new java.util.ArrayList();
 teilnehmerListe.add(name1);
 teilnehmerListe.add(name2);
 teilnehmerListe.add(name3);
 session.setAttribute(myList, list);
%
 html:form action=/myAction.do
  html:select property=selectedItem
   html:options collection=myList /
  /html:select
  html:submitOK/html:submit
 /html:form

When I run this I get an IllegalArgumentException: no name specified

I found out that both select and options have an argument name so I
added some dummies test1 and test2 just to have it and get (as
expected) another error: no bean found by that name test1.

What am I doing wrong? Can someone point me to the right direction?

Thanx and Regards,

Chris


-
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

2004-03-23 Thread Sanoj, Antony (IE10)
Hi,

I believe you need to read the following link 
http://www.jajakarta.org/struts/struts1.1/documentation/ja/target/userGuide/
printer/struts-html.html#options

This should give you an idea of what the attributes of html:options are.
Collection should be a set of java beans. Rules are clearly provided in the
above link.

I can give you an example using html:optionsCollection


 html:form action=Roles method=post
  table border=0 align=center width=100%
  tr
  td
bean:message key=app.roleselection/
  /td
  /tr
  tr
td align=center 
 html:select style=width:180px size=8 property=strRoleId
html:optionsCollection property=htUserRoles
label=strDisplayName value=strId/
 /html:select
/td
   /tr
  /table
html:submit/
/html:form

Regards, 
Sanoj Antony 


-Original Message-
From: Christian Schlaefcke [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 23, 2004 4:15 PM
To: Struts Users Mailing List
Subject: html:select / html:options


Hi Folks!

for several days I mess around with html:select and html:options.

I want to access a collection with names or numbers (just
java.lang.String). This collection is available in the session. For
testing I generated my own collection in the jsp

%
 java.util.Collection list = new java.util.ArrayList();
 teilnehmerListe.add(name1);
 teilnehmerListe.add(name2);
 teilnehmerListe.add(name3);
 session.setAttribute(myList, list);
%
 html:form action=/myAction.do
  html:select property=selectedItem
   html:options collection=myList /
  /html:select
  html:submitOK/html:submit
 /html:form

When I run this I get an IllegalArgumentException: no name specified

I found out that both select and options have an argument name so I
added some dummies test1 and test2 just to have it and get (as
expected) another error: no bean found by that name test1.

What am I doing wrong? Can someone point me to the right direction?

Thanx and Regards,

Chris


-
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

2004-03-23 Thread Mark Lowe
session.setAttribute(myList, list);
session.setAttribute(myList,list.toArray());

for some reason you need to cast to list to an array.

On 24 Mar 2004, at 01:23, Lokanath wrote:

hi ,

i think u have to get the bean from session to some Collection
useing session.getAttribute(mylist) then assign it to some 
collection.then
use that collection for populating the select

   lokee

-Original Message-
From: Christian Schlaefcke [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 23, 2004 2:45 AM
To: Struts Users Mailing List
Subject: html:select / html:options
Hi Folks!

for several days I mess around with html:select and html:options.

I want to access a collection with names or numbers (just
java.lang.String). This collection is available in the session. For
testing I generated my own collection in the jsp
%
 java.util.Collection list = new java.util.ArrayList();
 teilnehmerListe.add(name1);
 teilnehmerListe.add(name2);
 teilnehmerListe.add(name3);
 session.setAttribute(myList, list);
%
 html:form action=/myAction.do
  html:select property=selectedItem
   html:options collection=myList /
  /html:select
  html:submitOK/html:submit
 /html:form
When I run this I get an IllegalArgumentException: no name specified

I found out that both select and options have an argument name 
so I
added some dummies test1 and test2 just to have it and get (as
expected) another error: no bean found by that name test1.

What am I doing wrong? Can someone point me to the right direction?

Thanx and Regards,

Chris

-
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

2003-05-27 Thread Abhinav (Cognizant)
That means we are keeping unsafeValues and unsafeLabels separately in our form-bean. 
(Though they are related -- i think so)
What if these two are kept encapsulated in an object.

-Original Message-
From: Kandi Potter [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:06 PM
To: Struts Users Mailing List
Subject: RE: html:select / html:options


I used the following with vectors of unsafeValues and unsafeLabels in my incidentForm 
bean.



html:select  name=incidentForm  property=selectedUnsafe  
html:option value=nbsp/html:option
html:options name=incidentForm property=unsafeValues  
labelName=incidentForm 
labelProperty=unsafeLabels /
/html:select/TD





-Original Message-
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 11:20 AM
To: Struts Users Mailing List
Subject: html:select / html:options


I have a vector of Objects of a class whose attributes are ID and Name.
This vector is set in the form bean.

I want to display that vector as a select/options field.
ID part will form the value and Name the displayable option.

How can this be done.

Thanx a lot.


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



** Message from InterScan E-Mail VirusWall NT **

** No virus found in attached file noname.htm

No Virus detected in the attached file(s).
* End of message ***


This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. If you are not 
the 
intended recipient, please contact the sender by reply e-mail and destroy all copies 
of 
the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying 
of this email or any action taken in reliance on this e-mail is strictly prohibited 
and 
may be unlawful.

  Visit us at http://www.cognizant.com

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

Re: html:select / html:options

2003-05-27 Thread Denis Avdic
use optionsCollection tag

property:  name of the collection in the  form Bean
label :  The property of the bean within the collection which represents 
the label to be rendered for each option. (ie. Name)
value: The property of the bean within the collection which represents 
the value to be rendered for each option. (ie ID)

thus:

html:optionsCollection 
property=propertyOfFormBeanContainingCollection label=name value=id /





Abhinav (Cognizant) wrote:

That means we are keeping unsafeValues and unsafeLabels separately in our form-bean. 
(Though they are related -- i think so)
What if these two are kept encapsulated in an object.
-Original Message-
From: Kandi Potter [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:06 PM
To: Struts Users Mailing List
Subject: RE: html:select / html:options
I used the following with vectors of unsafeValues and unsafeLabels in my incidentForm bean.



html:select  name=incidentForm  property=selectedUnsafe  
   html:option value=nbsp/html:option
   html:options name=incidentForm property=unsafeValues  labelName=incidentForm  
   labelProperty=unsafeLabels /
/html:select/TD




-Original Message-
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 11:20 AM
To: Struts Users Mailing List
Subject: html:select / html:options
I have a vector of Objects of a class whose attributes are ID and Name.
This vector is set in the form bean.
I want to display that vector as a select/options field.
ID part will form the value and Name the displayable option.
How can this be done.

Thanx a lot.

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


 



** Message from InterScan E-Mail VirusWall NT **

** No virus found in attached file noname.htm

No Virus detected in the attached file(s).
* End of message ***
 



This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. If you are not the 
intended recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying 
of this email or any action taken in reliance on this e-mail is strictly prohibited and 
may be unlawful.

 Visit us at http://www.cognizant.com

 



-
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

2003-05-27 Thread Kandi Potter
I'm just learning here as well.but that is what worked for me.   I actually store 
the vectors in a CollectionForm with the two vectors as members.  I don't know if this 
was the most graceful way to handle the problem, but it worked for me.  I have 
something like this:

I used a CollectionForm for the same purpose as you would like to.  I have several 
drop-down selections so I just create a CollectionForm object for each, and populate 
the labels and values from my business object, which I'm sure you have done already.

also, for state management, the collectionForms are stored in a transaction to be 
re-used during the same session.  This way I can grab them for any action where I need 
the same drop-down list.   

public class CollectionForm   implements Serializable {
private Vector labels;
private Vector values;

...

public class IncidentForm extends ActionForm implements Serializable {
public Vector getUnsafeLabels(){
return CollectionForm.getLabels();

}

public Vector getUnsafeValues(){
return CollectionForm.getValues();
   
}
...



-Original Message-
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 11:49 AM
To: Struts Users Mailing List
Subject: RE: html:select / html:options


That means we are keeping unsafeValues and unsafeLabels separately in our form-bean. 
(Though they are related -- i think so)
What if these two are kept encapsulated in an object.

-Original Message-
From: Kandi Potter [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:06 PM
To: Struts Users Mailing List
Subject: RE: html:select / html:options


I used the following with vectors of unsafeValues and unsafeLabels in my incidentForm 
bean.



html:select  name=incidentForm  property=selectedUnsafe  
html:option value=nbsp/html:option
html:options name=incidentForm property=unsafeValues  
labelName=incidentForm 
labelProperty=unsafeLabels /
/html:select/TD





-Original Message-
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 11:20 AM
To: Struts Users Mailing List
Subject: html:select / html:options


I have a vector of Objects of a class whose attributes are ID and Name.
This vector is set in the form bean.

I want to display that vector as a select/options field.
ID part will form the value and Name the displayable option.

How can this be done.

Thanx a lot.


-
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]



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]




html:select,html:options ,DynaValidatorForm

2003-01-27 Thread Vinay
I am using DynaValidatorForm, I need help in using html:select
,html:options

property for html:select  is defined in struts-config.xml in a form-bean
property

Help appreciated

Thanks
Vinay




Re: html:select,html:options ,DynaValidatorForm

2003-01-27 Thread Vinay
Can anyone help me with a sample code for 

I am doing it this way now

  html:select property=pmarital value=${rp.rpmrtl}
html:option value=SSingle  /html:option
html:option value=DDivorced/html:option
 html:option value=M Married/html:option
 html:option value=W Widowed/html:option
  html:option value=U U  /html:option
 html:option value= /html:option
/html:select

I have the following in struts-config.xml

form-bean
   name=rpForm
   type=org.apache.struts.validator.DynaValidatorActionForm
   form-property name=acctno type=java.lang.String/
  form-property name=pmarital type=java.lang.String/
   form-property name=first type=java.lang.String/
  /form-bean


I want to get rid of all html:option with one html:options

Thanks in advance ,

Help appreciated

Vinay





  



  - Original Message - 
  From: Vinay 
  To: Struts Users Mailing List 
  Sent: Monday, January 27, 2003 11:59 AM
  Subject: html:select,html:options  ,DynaValidatorForm


  I am using DynaValidatorForm, I need help in using html:select
  ,html:options

  property for html:select  is defined in struts-config.xml in a form-bean
  property

  Help appreciated

  Thanks
  Vinay




Re: html:select,html:options ,DynaValidatorForm

2003-01-27 Thread Ashish Kulkarni
Hi
What u can do is
define a Vector like below in your jsp
Vector options = new Vector();
  options.add(new LabelValueBean(Married, M));
  options.add(new LabelValueBean(Single, S));

put it in page context 
pageContext.setAttribute(options, options);
and then use
html:select property=collectionSelect size=1 
html:options collection=options property=value
labelProperty=label/
/html:select
There are more examples given in 
struts-exercise-taglib 
if u install the war file, which u get along with
struts download






--- Vinay [EMAIL PROTECTED] wrote:
 Can anyone help me with a sample code for 
 
 I am doing it this way now
 
   html:select property=pmarital
 value=${rp.rpmrtl}
 html:option value=SSingle 
 /html:option
 html:option
 value=DDivorced/html:option
  html:option value=M
 Married/html:option
  html:option value=W
 Widowed/html:option
   html:option value=U U 
 /html:option
  html:option value=
 /html:option
 /html:select
 
 I have the following in struts-config.xml
 
 form-bean
name=rpForm
   

type=org.apache.struts.validator.DynaValidatorActionForm
form-property name=acctno
 type=java.lang.String/
   form-property name=pmarital
 type=java.lang.String/
form-property name=first
 type=java.lang.String/
   /form-bean
 
 
 I want to get rid of all html:option with one
 html:options
 
 Thanks in advance ,
 
 Help appreciated
 
 Vinay
 
 
 
 
 
   
 
 
 
   - Original Message - 
   From: Vinay 
   To: Struts Users Mailing List 
   Sent: Monday, January 27, 2003 11:59 AM
   Subject: html:select,html:options 
 ,DynaValidatorForm
 
 
   I am using DynaValidatorForm, I need help in using
 html:select
   ,html:options
 
   property for html:select  is defined in
 struts-config.xml in a form-bean
   property
 
   Help appreciated
 
   Thanks
   Vinay
 
 


=
A$HI$H

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




html:select + html:options question

2002-04-29 Thread Adolfo Miguelez

Hi All,

We would appreciate any guidance since we are a little stuck with this issue 
in Struts 1.0.

We have a JSP, which contains an undetermined number of select components, 
known at runtime. AFAIK, a Struts html:select REQUIRES to be embedded in 
an html:form tag, which, in turn, CLAIMS definition of an ActionForm.

As our layout and number of input parameters is determined at runtime, we 
cannot implement such a ActionForm. As a consequence, we needed to migrate 
to an usual HTML select. Take in mind that we are using Struts 1.0.

Parameters from the request are then extracted from the 
request.getParameter() in the perform() of invoked Action.

However this workaround makes our code little messy. We would like to use 
an html:select to take advantage of the dynamic population of its options.

Has anyone run in a similar problem?

Thanks in advance,

Adolfo.



_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




RE: html:select + html:options question

2002-04-29 Thread Ramin, Arash

You should look into upgrading to Struts 1.1, which supports indexed
properties.  This allows you to have a dynamic number of elements on your
form.

- Arash

 -Original Message-
 From: Adolfo Miguelez [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, April 29, 2002 11:26
 To: [EMAIL PROTECTED]
 Subject: html:select + html:options question
 
 
 Hi All,
 
 We would appreciate any guidance since we are a little stuck 
 with this issue 
 in Struts 1.0.
 
 We have a JSP, which contains an undetermined number of 
 select components, 
 known at runtime. AFAIK, a Struts html:select REQUIRES to 
 be embedded in 
 an html:form tag, which, in turn, CLAIMS definition of an ActionForm.
 
 As our layout and number of input parameters is determined at 
 runtime, we 
 cannot implement such a ActionForm. As a consequence, we 
 needed to migrate 
 to an usual HTML select. Take in mind that we are using Struts 1.0.
 
 Parameters from the request are then extracted from the 
 request.getParameter() in the perform() of invoked Action.
 
 However this workaround makes our code little messy. We 
 would like to use 
 an html:select to take advantage of the dynamic population 
 of its options.
 
 Has anyone run in a similar problem?
 
 Thanks in advance,
 
 Adolfo.
 
 
 
 _
 Join the world's largest e-mail service with MSN Hotmail. 
 http://www.hotmail.com
 
 
 --
 To unsubscribe, e-mail:   
 mailto:struts-user- [EMAIL PROTECTED]
 For 
 additional commands, 
 e-mail: mailto:[EMAIL PROTECTED]
 

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




html:select, html:options related query

2002-01-17 Thread hemant

Hello,


I get a javax.servlet.jsp.JspException with the description being No getter method 
available for property selectSeasons for bean under name 
org.apache.struts.taglib.html.BEAN


I have the following  questions

1) Why is it looking at org.apache.struts.taglib.html.BEAN in the first place? 
2) I have read many queries, I'm still not clear if a form-bean is mandatory for an 
action. I do not think it is mandatory but when I tried an action without an action 
form-bean it gave me an exception which is a totally different post in itself. As soon 
as I added a form-bean it went away. The rangesActionForm  in my struts-config.xml 
is one such bean.


Thanks in Advance,

Regards
hemant
___


Environment: Tomcat 3.2.1/Struts 1.0/JBuilder 5.0/


Here is a snippet from my jsp:
--
html:form action=ranges.do
  bean:define id=ldmbean name = ldmservice property=seasons 
type=java.util.Collection/
  html:select property=seasons
html:options collection=seasons property=seasons 
labelProperty=seasonDescription/
  /html:select
  table
  tr
TD align=center rowspan=2 width=67html:submit property=submit 
value=Submit//TD
TD align=center rowspan=2 width=123html:reset value=Reset//TD
  /tr
  /table
  /html:form
-

My struts-config.xml is as shown below

--
struts-config



  !-- == Form Bean Definitions === --
  form-beans
!-- Login form bean --
form-bean  name=loginForm 
type=com.jny.operations.mplanning.mpi.action.actionform.LoginForm/
!-- Main Menu form bean --
form-bean  name=mainMenuForm 
type=com.jny.operations.mplanning.mpi.action.actionform.MainMenuForm/
form-bean  name=rangesActionForm 
type=com.jny.operations.mplanning.mpi.action.actionform.RangesActionForm/
  /form-beans



  !-- == Global Forward Definitions == --
  global-forwards
   forward name=mainmenu  path=/mainmenu.jsp/
   forward name=login path=/login.jsp/
   forward name=chooseBP  path=/choosebp.jsp/
   forward name=createbuyplan path=/createbuyplan.jsp/
   forward name=administrationpath=/administration.jsp/
forward name=rangespath=/ranges.jsp/
  /global-forwards


  !-- == Action Mapping Definitions == --
  action-mappings
!-- Login Mappings --
actionpath=/login
   type=com.jny.operations.mplanning.mpi.action.Login
   name=loginForm
   input=/login.jsp
/action
 !-- Main Menu Mappings --
actionpath=/mainmenu
   type=com.jny.operations.mplanning.mpi.action.MainMenu
   name=mainMenuForm
   input=/mainmenu.jsp
/action

action  path=/createbuyplan
  type=com.jny.operations.mplanning.mpi.action.CreateBuyPlanAction
  validate=false
/action
action  path=/ranges
  name = rangesActionForm
  type=com.jny.operations.mplanning.mpi.action.RetrieveRanges
  validate=false
/action

  /action-mappings
/struts-config
--

Stack Trace:

---
javax.servlet.ServletException: No getter method available for property selectSeasons 
for bean under name org.apache.struts.taglib.html.BEAN
 at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
 at 
_0002fmainmenu_0002ejspmainmenu_jsp_10._jspService(_0002fmainmenu_0002ejspmainmenu_jsp_10.java:436)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
...

...
...



Re: html:select, html:options related query

2002-01-17 Thread Mark Galbreath

Have you looked at the Struts API?  You could probably answer your own
question.

Cheers!
Mark

- Original Message -
From: hemant [EMAIL PROTECTED]
To: struts [EMAIL PROTECTED]
Sent: Thursday, January 17, 2002 7:55 PM
Subject: html:select, html:options related query


Hello,


I get a javax.servlet.jsp.JspException with the description being No
getter method available for property selectSeasons for bean under name
org.apache.struts.taglib.html.BEAN


I have the following  questions

1) Why is it looking at org.apache.struts.taglib.html.BEAN in the first
place?
2) I have read many queries, I'm still not clear if a form-bean is mandatory
for an action. I do not think it is mandatory but when I tried an action
without an action form-bean it gave me an exception which is a totally
different post in itself. As soon as I added a form-bean it went away. The
rangesActionForm  in my struts-config.xml is one such bean.


Thanks in Advance,

Regards
hemant
___


Environment: Tomcat 3.2.1/Struts 1.0/JBuilder 5.0/


Here is a snippet from my jsp:

--
html:form action=ranges.do
  bean:define id=ldmbean name = ldmservice property=seasons
type=java.util.Collection/
  html:select property=seasons
html:options collection=seasons property=seasons
labelProperty=seasonDescription/
  /html:select
  table
  tr
TD align=center rowspan=2 width=67html:submit property=submit
value=Submit//TD
TD align=center rowspan=2 width=123html:reset
value=Reset//TD
  /tr
  /table
  /html:form

-

My struts-config.xml is as shown below


--
struts-config



  !-- == Form Bean Definitions
=== --
  form-beans
!-- Login form bean --
form-bean  name=loginForm
type=com.jny.operations.mplanning.mpi.action.actionform.LoginForm/
!-- Main Menu form bean --
form-bean  name=mainMenuForm
type=com.jny.operations.mplanning.mpi.action.actionform.MainMenuForm/
form-bean  name=rangesActionForm
type=com.jny.operations.mplanning.mpi.action.actionform.RangesActionForm/
  /form-beans



  !-- == Global Forward Definitions
== --
  global-forwards
   forward name=mainmenu  path=/mainmenu.jsp/
   forward name=login path=/login.jsp/
   forward name=chooseBP  path=/choosebp.jsp/
   forward name=createbuyplan path=/createbuyplan.jsp/
   forward name=administrationpath=/administration.jsp/
forward name=rangespath=/ranges.jsp/
  /global-forwards


  !-- == Action Mapping Definitions
== --
  action-mappings
!-- Login Mappings --
actionpath=/login
   type=com.jny.operations.mplanning.mpi.action.Login
   name=loginForm
   input=/login.jsp
/action
 !-- Main Menu Mappings --
actionpath=/mainmenu
   type=com.jny.operations.mplanning.mpi.action.MainMenu
   name=mainMenuForm
   input=/mainmenu.jsp
/action

action  path=/createbuyplan
  type=com.jny.operations.mplanning.mpi.action.CreateBuyPlanAction
  validate=false
/action
action  path=/ranges
  name = rangesActionForm
  type=com.jny.operations.mplanning.mpi.action.RetrieveRanges
  validate=false
/action

  /action-mappings
/struts-config

--

Stack Trace:


---
javax.servlet.ServletException: No getter method available for property
selectSeasons for bean under name org.apache.struts.taglib.html.BEAN
 at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:459)
 at
_0002fmainmenu_0002ejspmainmenu_jsp_10._jspService(_0002fmainmenu_0002ejspma
inmenu_jsp_10.java:436)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
...

...
...




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[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