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);
%>
 
  
   
  
  OK
 
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

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 


 
  
  
  

  
  
  
 
 

 

   
  



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);
%>
 
  
   
  
  OK
 

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 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);
%>
 
  
   
  
  OK
 

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]



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);
%>
 
  
   
  
  OK
 

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: Repost : Usage of< html:options>

2004-02-17 Thread Niall Pemberton
I use the  which is the same as  but
uses a more struts "standard" attribute names and you would do it like this:



Niall

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 17, 2004 11:57 AM
Subject: Repost : Usage of< html:options>

Hi,

I am a newbie in struts,

I have to populate a dropdown using html:options. I have to use a collection
of beans. This collection should be stored in my Action Form.

I have a collection of CountryBeans named as collectionCountry. In my action
class I am writing

request.setAttribute("countryList",collectionCountry);

In my jsp I am writing


Now I want to Store this collection in my ActionForm and get it in the jsp.
what changes do I need to do to implement the same


Can you please suggest me some way of doing this


Thanks for any help in advance

Regards

Anant Parnami




-Original Message-
From: Manuel Lenz [mailto:[EMAIL PROTECTED]

Sent: Tuesday, February 17, 2004 1:49 PM
To: Struts Users Mailing List
Subject: No Action is executed







Hi to all,
my struts-webApplication is used by almost 80 people.
After 1-2 weeks my application doesn´t react anymore,
if I do call an ActionClass which will connect to an oracle database.

So I guess I do have a problem with the database connection.
My database config shows that:

  
  
  
  
  
  



I do work with normal statements and with prepared statements. I guess there
might by to much opened result sets, statements and database connection. But
our serverAdministrator says, that there are only 5 unused database
connections left. Max value is 20.

Does anybody have an idea?

Greetings, Manuel


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


Confidentiality Notice


The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain confidential or privileged information. If you are not the intended
recipient, please notify the sender at Wipro or [EMAIL PROTECTED]
immediately and destroy all copies of this message and any attachments.

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


Confidentiality Notice

The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



Repost : Usage of< html:options>

2004-02-17 Thread anant.parnami





Hi,

I am a newbie in struts,

I have to populate a dropdown using html:options. I have to use a collection of beans. 
This collection should be stored in my Action Form.

I have a collection of CountryBeans named as collectionCountry. In my action class I 
am writing

request.setAttribute("countryList",collectionCountry);

In my jsp I am writing


Now I want to Store this collection in my ActionForm and get it in the jsp. what 
changes do I need to do to implement the same


Can you please suggest me some way of doing this


Thanks for any help in advance

Regards

Anant Parnami




-Original Message-
From: Manuel Lenz [mailto:[EMAIL PROTECTED]

Sent: Tuesday, February 17, 2004 1:49 PM
To: Struts Users Mailing List
Subject: No Action is executed







Hi to all,
my struts-webApplication is used by almost 80 people.
After 1-2 weeks my application doesn´t react anymore,
if I do call an ActionClass which will connect to an oracle database.

So I guess I do have a problem with the database connection.
My database config shows that:

  
  
  
  
  
  



I do work with normal statements and with prepared statements. I guess there might by 
to much opened result sets, statements and database connection. But our 
serverAdministrator says, that there are only 5 unused database connections left. Max 
value is 20.

Does anybody have an idea?

Greetings, Manuel


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


Confidentiality Notice


The information contained in this electronic message and any attachments to this 
message are intended for the exclusive use of the addressee(s) and may contain 
confidential or privileged information. If you are not the intended recipient, please 
notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of 
this message and any attachments.

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


Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



html:options with validate

2004-02-17 Thread Sniadach, Tomasz
hi , 
i have an ActionForm with countries in html:options , there are some
other fields, that i have to validate. So, when i submit and errors
occur, the field selected in countries is set to default. Is there a way
to mark the selected field? 
The other fields (text fields) are not cleared.

In my JSP i have something like this:




in the Form ;

public String getSelectedLand() {
return eb.getLand()[0]; 
}

public String[] getCountries() {
return eb.getCountries();
}

Thx for suggestions.
Tomek


Usage of< html:options>

2004-02-17 Thread anant.parnami

Hi,

I am a newbie in struts,
I have to populate a dropdown using html:options. I have to use a collection of beans. 
This collection should be stored in my Action Form.

I have a collection of CountryBeans named as collectionCountry.
In my action class I am writing
request.setAttribute("countryList",collectionCountry);

In my jsp I am writing


Now I want to Store this collection in my ActionForm and get it in the jsp. what 
changes do I need to do to implement the same

Can you please suggest me some way of doing this

Thanks for any help in advance

Regards

Anant Parnami



-Original Message-
From: Manuel Lenz [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 1:49 PM
To: Struts Users Mailing List
Subject: No Action is executed







Hi to all,
my struts-webApplication is used by almost 80 people.
After 1-2 weeks my application doesn´t react anymore,
if I do call an ActionClass which will connect to an oracle database.

So I guess I do have a problem with the database connection.
My database config shows that:

  
  
  
  
  
  



I do work with normal statements and with prepared statements. I guess there might by 
to much opened result sets, statements and database connection. But our 
serverAdministrator says, that there are only 5 unused database connections left. Max 
value is 20.

Does anybody have an idea?

Greetings, Manuel


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


Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



RE: html:options and html:select

2004-02-02 Thread Jiin-Her Lu
If your list stores objects which is the type of Struts' LabelValueBean (provides only 
getValue() and getLabel() methods), then you can simply as 






Jiin-Her Lu
(816) 926-2145

>>> [EMAIL PROTECTED] 02/02/04 06:31AM >>>

Hi Frank

Try using

Request.setAttribute("collectionName",list);





I have tried putting the Collection as the request attribute never in
the form bean. One more thing make user you provide exact path of
CProduct in the name field.

Regards

Anant

-Original Message-
From: Otto, Frank [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 02, 2004 5:41 PM
To: Struts-User (E-Mail)
Subject: html:options and html:select


hello,

I have following bean:

public class CProduct {

private Integer id;

private String name

public Integer getId() {return id;}
puclic void setId(Integer id){
...
}

My form class contains a java.util.List of CProduct bean.

How can I display the List as select box? I want to use the id as value
and the name as label of the select box.

For example:


scanner
harddisk


Has anyone an idea?

Regards,

Frank


Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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

2004-02-02 Thread Guillermo Meyer
Otto, you can take a look at http://providers.sourceforge.net/, this
project can help you in filling options in selects. There is a 0.1
version, butwe are working in 0.2 with a lot of improvements.

Cheers.
Guillermo.

-Original Message-
From: Otto, Frank [mailto:[EMAIL PROTECTED] 
Sent: Lunes, 02 de Febrero de 2004 09:28 a.m.
To: 'Struts Users Mailing List'
Subject: AW: html:options and html:select


Thanks for your answer, but

I have found out, that I can use html:optionsCollection.


 

Regards,

Frank

-Ursprüngliche Nachricht-
Von: Claire Wall [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 2. Februar 2004 13:22
An: Struts Users Mailing List
Betreff: Re: html:options and html:select


you can do the following:



">




'property' of the select box should be the name of the property in your
FormBean that you wish to store the selected value in. You then iterate
through the list in your form by using the  tag. For
every object in your list an  tag is written, where the value is
the property 'id' of the current CProduct and the name displayed in the
select box is the name of this CProduc object. This may not work as it
stands due to using an Integer object - i'm not certain that you can set
the value of a select box option to an Integer object. You'd have to try
it and see, and perhaps somebody can clarify this further, but I've
never tried this myself.

HTH
claire :)

- Original Message -
From: "Otto, Frank" <[EMAIL PROTECTED]>
To: "Struts-User (E-Mail)" <[EMAIL PROTECTED]>
Sent: Monday, February 02, 2004 12:11 PM
Subject: html:options and html:select


> hello,
>
> I have following bean:
>
> public class CProduct {
>
> private Integer id;
>
> private String name
>
> public Integer getId() {return id;}
> puclic void setId(Integer id){
> ...
> }
>
> My form class contains a java.util.List of CProduct bean.
>
> How can I display the List as select box? I want to use the id as 
> value
and the name as label of the select box.
>
> For example:
>
> 
> scanner
> harddisk
> 
>
> Has anyone an idea?
>
> Regards,
>
> Frank
>
>



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

NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las 
personas direccionadas en el mail y puede contener informacion (i)de propiedad 
exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier 
opinion en el contenido, es exclusiva de su autor y no representa necesariamente la 
opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion 
esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna 
por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha 
recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo 
inmediatamente junto con todas las copias del mismo, notificando al remitente. No 
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus 
partes si usted no es el destinatario. Muchas gracias.



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



Re: AW: html:options and html:select

2004-02-02 Thread Claire Wall
Aha!

i use the bean:write's but then i like doing things the complicated way.
Never used the html:options in this situation before so thanks for the tip -
will make things much easier!

cw :)


- Original Message -
From: "Mark Lowe" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, February 02, 2004 12:34 PM
Subject: Re: AW: html:options and html:select


Thank goodness for that, dunno why folks seem to do that bean:write for
dropdowns :o)



On 2 Feb 2004, at 13:27, Otto, Frank wrote:

> Thanks for your answer, but
>
> I have found out, that I can use html:optionsCollection.
>
> 
>  value="id" label="name"/>
> 
>
> Regards,
>
> Frank
>
> -Ursprüngliche Nachricht-
> Von: Claire Wall [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 2. Februar 2004 13:22
> An: Struts Users Mailing List
> Betreff: Re: html:options and html:select
>
>
> you can do the following:
>
> 
> 
>  property="id"/>">
> 
> 
>
>
> 'property' of the select box should be the name of the property in your
> FormBean that you wish to store the selected value in.
> You then iterate through the list in your form by using the
> 
> tag. For every object in your list an  tag is written, where
> the
> value is the property 'id' of the current CProduct and the name
> displayed in
> the select box is the name of this CProduc object. This may not work
> as it
> stands due to using an Integer object - i'm not certain that you can
> set the
> value of a select box option to an Integer object. You'd have to try
> it and
> see, and perhaps somebody can clarify this further, but I've never
> tried
> this myself.
>
> HTH
> claire :)
>
> - Original Message -
> From: "Otto, Frank" <[EMAIL PROTECTED]>
> To: "Struts-User (E-Mail)" <[EMAIL PROTECTED]>
> Sent: Monday, February 02, 2004 12:11 PM
> Subject: html:options and html:select
>
>
>> hello,
>>
>> I have following bean:
>>
>> public class CProduct {
>>
>> private Integer id;
>>
>> private String name
>>
>> public Integer getId() {return id;}
>> puclic void setId(Integer id){
>> ...
>> }
>>
>> My form class contains a java.util.List of CProduct bean.
>>
>> How can I display the List as select box? I want to use the id as
>> value
> and the name as label of the select box.
>>
>> For example:
>>
>> 
>> scanner
>> harddisk
>> 
>>
>> Has anyone an idea?
>>
>> Regards,
>>
>> Frank
>>
>>
>
>
>
> -
> 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: AW: html:options and html:select

2004-02-02 Thread Mark Lowe
Thank goodness for that, dunno why folks seem to do that bean:write for 
dropdowns :o)



On 2 Feb 2004, at 13:27, Otto, Frank wrote:

Thanks for your answer, but

I have found out, that I can use html:optionsCollection.


	


Regards,

Frank

-Ursprüngliche Nachricht-
Von: Claire Wall [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 2. Februar 2004 13:22
An: Struts Users Mailing List
Betreff: Re: html:options and html:select
you can do the following:



">


'property' of the select box should be the name of the property in your
FormBean that you wish to store the selected value in.
You then iterate through the list in your form by using the 

tag. For every object in your list an  tag is written, where 
the
value is the property 'id' of the current CProduct and the name 
displayed in
the select box is the name of this CProduc object. This may not work 
as it
stands due to using an Integer object - i'm not certain that you can 
set the
value of a select box option to an Integer object. You'd have to try 
it and
see, and perhaps somebody can clarify this further, but I've never 
tried
this myself.

HTH
claire :)
- Original Message -
From: "Otto, Frank" <[EMAIL PROTECTED]>
To: "Struts-User (E-Mail)" <[EMAIL PROTECTED]>
Sent: Monday, February 02, 2004 12:11 PM
Subject: html:options and html:select

hello,

I have following bean:

public class CProduct {

private Integer id;

private String name

public Integer getId() {return id;}
puclic void setId(Integer id){
...
}
My form class contains a java.util.List of CProduct bean.

How can I display the List as select box? I want to use the id as 
value
and the name as label of the select box.
For example:


scanner
harddisk

Has anyone an idea?

Regards,

Frank




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

2004-02-02 Thread anant.parnami

Hi Frank

Try using

Request.setAttribute("collectionName",list);





I have tried putting the Collection as the request attribute never in
the form bean. One more thing make user you provide exact path of
CProduct in the name field.

Regards

Anant

-Original Message-
From: Otto, Frank [mailto:[EMAIL PROTECTED]
Sent: Monday, February 02, 2004 5:41 PM
To: Struts-User (E-Mail)
Subject: html:options and html:select


hello,

I have following bean:

public class CProduct {

private Integer id;

private String name

public Integer getId() {return id;}
puclic void setId(Integer id){
...
}

My form class contains a java.util.List of CProduct bean.

How can I display the List as select box? I want to use the id as value
and the name as label of the select box.

For example:


scanner
harddisk


Has anyone an idea?

Regards,

Frank


Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



AW: html:options and html:select

2004-02-02 Thread Otto, Frank
Thanks for your answer, but

I have found out, that I can use html:optionsCollection.





Regards,

Frank

-Ursprüngliche Nachricht-
Von: Claire Wall [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 2. Februar 2004 13:22
An: Struts Users Mailing List
Betreff: Re: html:options and html:select


you can do the following:



">




'property' of the select box should be the name of the property in your
FormBean that you wish to store the selected value in.
You then iterate through the list in your form by using the 
tag. For every object in your list an  tag is written, where the
value is the property 'id' of the current CProduct and the name displayed in
the select box is the name of this CProduc object. This may not work as it
stands due to using an Integer object - i'm not certain that you can set the
value of a select box option to an Integer object. You'd have to try it and
see, and perhaps somebody can clarify this further, but I've never tried
this myself.

HTH
claire :)

- Original Message -
From: "Otto, Frank" <[EMAIL PROTECTED]>
To: "Struts-User (E-Mail)" <[EMAIL PROTECTED]>
Sent: Monday, February 02, 2004 12:11 PM
Subject: html:options and html:select


> hello,
>
> I have following bean:
>
> public class CProduct {
>
> private Integer id;
>
> private String name
>
> public Integer getId() {return id;}
> puclic void setId(Integer id){
> ...
> }
>
> My form class contains a java.util.List of CProduct bean.
>
> How can I display the List as select box? I want to use the id as value
and the name as label of the select box.
>
> For example:
>
> 
> scanner
> harddisk
> 
>
> Has anyone an idea?
>
> Regards,
>
> Frank
>
>



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

2004-02-02 Thread Mark Lowe


ArrayList productList = new ArrayList();

CProduct product = new CProduct();
product.setId(new Integer(1));
product.setName("My Product");
productList.add(product);

request.setAttribute("products",productList.toArray());

...

--


If you dont want to have a refering action then you can have an action 
that returns null rather than a forward. and do this in jstl



Cheers Mark

On 2 Feb 2004, at 13:11, Otto, Frank wrote:

hello,

I have following bean:

public class CProduct {

private Integer id;

private String name

public Integer getId() {return id;}
puclic void setId(Integer id){
...
}
My form class contains a java.util.List of CProduct bean.

How can I display the List as select box? I want to use the id as 
value and the name as label of the select box.

For example:


scanner
harddisk

Has anyone an idea?

Regards,

Frank



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


Re: html:options and html:select

2004-02-02 Thread Claire Wall
you can do the following:



">




'property' of the select box should be the name of the property in your
FormBean that you wish to store the selected value in.
You then iterate through the list in your form by using the 
tag. For every object in your list an  tag is written, where the
value is the property 'id' of the current CProduct and the name displayed in
the select box is the name of this CProduc object. This may not work as it
stands due to using an Integer object - i'm not certain that you can set the
value of a select box option to an Integer object. You'd have to try it and
see, and perhaps somebody can clarify this further, but I've never tried
this myself.

HTH
claire :)

- Original Message -
From: "Otto, Frank" <[EMAIL PROTECTED]>
To: "Struts-User (E-Mail)" <[EMAIL PROTECTED]>
Sent: Monday, February 02, 2004 12:11 PM
Subject: html:options and html:select


> hello,
>
> I have following bean:
>
> public class CProduct {
>
> private Integer id;
>
> private String name
>
> public Integer getId() {return id;}
> puclic void setId(Integer id){
> ...
> }
>
> My form class contains a java.util.List of CProduct bean.
>
> How can I display the List as select box? I want to use the id as value
and the name as label of the select box.
>
> For example:
>
> 
> scanner
> harddisk
> 
>
> Has anyone an idea?
>
> Regards,
>
> Frank
>
>



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



html:options and html:select

2004-02-02 Thread Otto, Frank
hello,
 
I have following bean:
 
public class CProduct {
 
private Integer id;
 
private String name
 
public Integer getId() {return id;}
puclic void setId(Integer id){
...
}
 
My form class contains a java.util.List of CProduct bean.
 
How can I display the List as select box? I want to use the id as value and the name 
as label of the select box.
 
For example:
 

scanner
harddisk

 
Has anyone an idea?
 
Regards,
 
Frank
 


nested beans/html:options

2004-01-25 Thread Mohan Radhakrishnan
Hi
   I am using nested beans. What is the equivalent using nested beans
for the following ?


  

"OBJECTIVE" is in the session scope.


I tried several options but none worked.


Mohan


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



beginner's html:options question

2004-01-20 Thread Anderson, James H [IT]
I have a collection of LabelValueBeans as a property of another bean (an Action), and 
I store this bean in session scope with "preparedData" as the key. But when I try and 
access it using html:option, I get the following error:

"Cannot find bean preparedData in any scope"

Here's html:option related stuff:



> 
Any help greatly appreciated!

jim

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

Re: html:options maximum length?

2003-10-30 Thread Richard Yee
I think you should re-think your UI design. Besides being very slow, the 
select box will be very annoying and difficult for the end user to use. You 
should try and narrow down the users choices before they get to the select 
box page so that you only need to show a few dozen options at most.

Regards,

Richard

At 04:22 PM 10/30/2003, you wrote:
I have a an Array with a large list of names in it (up to about 1000+ or
more).
I need to display these names in a drop down list, but when The page loads
it
simply stops loading after about 837 lines.
The code I am using is:

labelProperty="consultantName" /> Any ideas why it only displays a part of 
the Array and not the full thing? Any help is appreciated, Matt 
__ Disclaimer: 
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error, please notify the addressee by 
return email and delete the email. This email transmission is the property 
of HAS Solutions and any information it contains is legally protected. HAS 
Solutions has no liability (including liability in negligence) to any 
person for any loss or damage consequential or otherwise suffered or 
incurred by that person resulting directly or indirectly from either the 
use of, or reliance on, the information contained herein. 
__


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


html:options maximum length?

2003-10-30 Thread Matt Redman
I have a an Array with a large list of names in it (up to about 1000+ or
more).
I need to display these names in a drop down list, but when The page loads
it
simply stops loading after about 837 lines.
 
The code I am using is:
 



 
Any ideas why it only displays a part of the Array and not the full thing?
 
Any help is appreciated,
 
Matt
__
Disclaimer: 
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom 
they are addressed. 

If you have received this email in error, please notify the addressee 
by return email and delete the email. 

This email transmission is the property of HAS Solutions and any 
information it contains is legally protected. HAS Solutions has no liability

(including liability in negligence) to any person for any loss or damage
consequential or otherwise suffered or incurred by that person resulting
directly or indirectly from either the use of, or reliance on, the
information contained herein.
__



How to avoid that Struts html:options adds new line for each option?

2003-10-23 Thread Jan Kester
Hello

maybe it is a bit too complicated what I am doing. Therefore I first
describe what I need, then what I have done, and then the problem I have...

I would like to have a form that has two radio buttons yes/no, that on click
either show another subset of questions or hide them. The subset of
questions contain html:text, html:radio and html:select/html:options
elements.

I did this by defining a DIV element inside a table-td, with a certain id.
The onclick functions of the radio buttons either call a change-layercontent
or a change-layervoid javascript function. These javascript functions have
different sections for the different kind of browsers but basically either
load a preset string into the div-layer-documentsection or an empty string.
Above the java functions, still inside script tags, the empty string and the
preset string are defined. The preset string will be made up by struts html:
elements. To avoid conflicts with quotes, the struts elements use double
quotes, the javascript single quotes. Around each struts element on a new
line, single quotes have been added, plus a +sign to connect the next line.
In that way, all the struts element will be part of the javascript string
variable.

Now the problem: the html:options element writes it output to several lines.
Only at the beginning of the first line, and at the end of the last line are
quotes now :-(. The javascript does not recognise it as a string variable.

I will add a code piece below:


   
 










var secondlevellayer;
var msgstringvoid=''
var msgstring=''
+ '<table><tr>'
+ '  <td><h5><bean:message
key="prompt.CarDriverPage.sex2"/></h5></td></tr>'
+ '  <tr><td>
+ ' <html:select property="sex2"><html:options 
collection="sexList"
property="name" labelProperty="label"/></html:select>'
+ '  </td></tr>'
+ '</tr></table>';

function printCont(var1) {
alert(var1);
}

function change_layercontent(){
  if(document.layers){
//thisbrowser="NN4";
secondlevellayer = document.layers["secondlevel"];
secondlevellayer.document.open();
secondlevellayer.document.write(msgstring);
secondlevellayer.document.close();
  }

  if(document.all){
//thisbrowser="ie"
secondlevellayer = document.all["secondlevel"];
secondlevellayer.innerHTML=msgstring;
  }

  if(!document.all && document.getElementById){
//thisbrowser="NN6";
secondlevellayer = document.getElementById("secondlevel");
secondlevellayer.innerHTML =msgstring;
  }
}

function change_layervoid(){
  if(document.layers){
//thisbrowser="NN4";
secondlevellayer = document.layers["secondlevel"];
secondlevellayer.document.open();
secondlevellayer.document.write(msgstringvoid);
secondlevellayer.document.close();
  }

  if(document.all){
//thisbrowser="ie"
secondlevellayer = document.all["secondlevel"];
secondlevellayer.innerHTML=msgstringvoid;
  }

  if(!document.all && document.getElementById){
//thisbrowser="NN6";
secondlevellayer = document.getElementById("secondlevel");
secondlevellayer.innerHTML =msgstringvoid;
  }
}

//change_layercontent();
change_layervoid();




Hope someone can help ...

Regards, Jan


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



Re: URGENT: html:options

2003-10-14 Thread Nicolas De Loof


create a scripting variable "agencyIds" and a page scope bean "agencyIds". This 
created vector is empty.

<%  agencyIds= MyUtils.getAgencyIds();   %>

chags the object referenced by the scripting variable, but not the page scoped bean.

You should use something like this, assuming populateAgencyIds(List) adds items to an 
existing List :

<% MyUtils.populateAgencyIds(agencyIds); %>

Nico.



- Original Message - 
From: "ajay brar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 14, 2003 3:18 PM
Subject: Re: URGENT: html:options


> hi!
> thanks for the reply.
> doesn't the jsp import statement followed by the usebean ie,
> %@ page import="MyUtils" %>
> 
> introduce the agencyIds into page scope.
> also with the example you gave me should
> >
> > > label="label"
> > value="value" />
> >
> shouldn't the value of collections be items, since that is the key you used.
> 
> thanks
> cheers
> ajay
> 
> 
> >From: "Nicolas De Loof" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Subject: Re: URGENT: html:options
> >Date: Tue, 14 Oct 2003 15:11:57 +0200
> >
> >collection attribute of  tag is used to set the name of a 
> >bean (in some scope) that is a collection of the
> >items off the select-box.
> >
> >You need to put your Vector into page or request scope to use this tag:
> >
> ><%
> > request.setAttribute("items", agencyIds);
> >%>
> >
> >
> > > label="label"
> > value="value" />
> >
> >
> >Nico.
> >
> >
> >- Original Message -
> >From: "ajay brar" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Tuesday, October 14, 2003 2:53 PM
> >Subject: RE: URGENT: html:options
> >
> >
> > > hi!
> > >
> > > >I think your collection needs to implement the List interface (use an
> > > >ArrayList instead of a vector)
> > > but a vector implements the List interface, or so says the api
> > > any other ideas
> > >
> > >
> > >
> > > >
> > > >-Original Message-
> > > >From: ajay brar [mailto:[EMAIL PROTECTED]
> > > >Sent: 14 October 2003 12:45
> > > >To: [EMAIL PROTECTED]
> > > >Subject: URGENT: html:options
> > > >
> > > >hi!
> > > >i'm getting a problem with my html:options
> > > >what i have is a MyUtils class with a method to retrieve a list of 
> >agency
> > > >id's from the database
> > > >class MyUtils
> > > >{
> > > >//gets agencyIds creates LabelValueBeans and chucks them into a 
> >Vector
> > > >  public static Vector getAgencyIds()
> > > >}
> > > >
> > > >in my jsp page i had
> > > ><%@ page import="MyUtils" %>
> > > >
> > > ><%  agencyIds= MyUtils.getAgencyIds();   %>
> > > >i then had
> > > >
> > > >> > >labelProperty="label" />
> > > >
> > > >
> > > >this gave me an error, setCollection(java.lang.String) cannot be 
> >applied to
> > > >java.util.Vector
> > > >this was a compiler error.
> > > >
> > > >i tried doing,
> > > >changed MyUtils to
> > > >class MyUtils
> > > >{
> > > >private Vector agencyIds=new Vector();
> > > >//gets agencyIds creates LabelValueBeans and chucks them into a 
> >Vector
> > > >  public Vector getAgencyIds()
> > > >}
> > > ><%@ page import="MyUtils" %>
> > > >
> > > >
> > > >> > >label="label"
> > > >value="value" />
> > > >
> > > >
> > > >this gave me an error saying it couldn't find bean agencyId in any 
> >scope.
> > > >
> > > >could someone please help.
> > > >
> > > >thanks
> > > >cheers
> > > >ajay
> > > >
> > > >_
> > > >ninemsn Premium transforms your

Re: URGENT: html:options

2003-10-14 Thread ajay brar
hi!
thanks for the reply.
doesn't the jsp import statement followed by the usebean ie,
%@ page import="MyUtils" %>

introduce the agencyIds into page scope.
also with the example you gave me should

   

shouldn't the value of collections be items, since that is the key you used.

thanks
cheers
ajay

From: "Nicolas De Loof" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Re: URGENT: html:options
Date: Tue, 14 Oct 2003 15:11:57 +0200
collection attribute of  tag is used to set the name of a 
bean (in some scope) that is a collection of the
items off the select-box.

You need to put your Vector into page or request scope to use this tag:

<%
request.setAttribute("items", agencyIds);
%>

   

Nico.

- Original Message -
From: "ajay brar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 14, 2003 2:53 PM
Subject: RE: URGENT: html:options
> hi!
>
> >I think your collection needs to implement the List interface (use an
> >ArrayList instead of a vector)
> but a vector implements the List interface, or so says the api
> any other ideas
>
>
>
> >
> >-Original Message-
> >From: ajay brar [mailto:[EMAIL PROTECTED]
> >Sent: 14 October 2003 12:45
> >To: [EMAIL PROTECTED]
> >Subject: URGENT: html:options
> >
> >hi!
> >i'm getting a problem with my html:options
> >what i have is a MyUtils class with a method to retrieve a list of 
agency
> >id's from the database
> >class MyUtils
> >{
> >//gets agencyIds creates LabelValueBeans and chucks them into a 
Vector
> >  public static Vector getAgencyIds()
> >}
> >
> >in my jsp page i had
> ><%@ page import="MyUtils" %>
> >
> ><%  agencyIds= MyUtils.getAgencyIds();   %>
> >i then had
> >
> >   
> >labelProperty="label" />
> >
> >
> >this gave me an error, setCollection(java.lang.String) cannot be 
applied to
> >java.util.Vector
> >this was a compiler error.
> >
> >i tried doing,
> >changed MyUtils to
> >class MyUtils
> >{
> >private Vector agencyIds=new Vector();
> >//gets agencyIds creates LabelValueBeans and chucks them into a 
Vector
> >  public Vector getAgencyIds()
> >}
> ><%@ page import="MyUtils" %>
> >
> >
> >   
> >label="label"
> >value="value" />
> >
> >
> >this gave me an error saying it couldn't find bean agencyId in any 
scope.
> >
> >could someone please help.
> >
> >thanks
> >cheers
> >ajay
> >
> >_
> >ninemsn Premium transforms your e-mail with colours, photos and 
animated
> >text. Click here  http://ninemsn.com.au/premium/landing.asp
> >
> >
> >-
> >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]
> >
>
> _
> E-mail just got a whole lot better. New ninemsn Premium. Click here
> http://ninemsn.com.au/premium/landing.asp
>
>
> -
> 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]
_
Get less junk mail with ninemsn Premium. Click here  
http://ninemsn.com.au/premium/landing.asp

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


Re: URGENT: html:options

2003-10-14 Thread Nicolas De Loof
collection attribute of  tag is used to set the name of a bean (in some 
scope) that is a collection of the
items off the select-box.

You need to put your Vector into page or request scope to use this tag:

<%
request.setAttribute("items", agencyIds);
%>


   


Nico.


- Original Message - 
From: "ajay brar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 14, 2003 2:53 PM
Subject: RE: URGENT: html:options


> hi!
>
> >I think your collection needs to implement the List interface (use an
> >ArrayList instead of a vector)
> but a vector implements the List interface, or so says the api
> any other ideas
>
>
>
> >
> >-Original Message-
> >From: ajay brar [mailto:[EMAIL PROTECTED]
> >Sent: 14 October 2003 12:45
> >To: [EMAIL PROTECTED]
> >Subject: URGENT: html:options
> >
> >hi!
> >i'm getting a problem with my html:options
> >what i have is a MyUtils class with a method to retrieve a list of agency
> >id's from the database
> >class MyUtils
> >{
> >//gets agencyIds creates LabelValueBeans and chucks them into a Vector
> >  public static Vector getAgencyIds()
> >}
> >
> >in my jsp page i had
> ><%@ page import="MyUtils" %>
> >
> ><%  agencyIds= MyUtils.getAgencyIds();   %>
> >i then had
> >
> >>labelProperty="label" />
> >
> >
> >this gave me an error, setCollection(java.lang.String) cannot be applied to
> >java.util.Vector
> >this was a compiler error.
> >
> >i tried doing,
> >changed MyUtils to
> >class MyUtils
> >{
> >private Vector agencyIds=new Vector();
> >//gets agencyIds creates LabelValueBeans and chucks them into a Vector
> >  public Vector getAgencyIds()
> >}
> ><%@ page import="MyUtils" %>
> >
> >
> >>label="label"
> >value="value" />
> >
> >
> >this gave me an error saying it couldn't find bean agencyId in any scope.
> >
> >could someone please help.
> >
> >thanks
> >cheers
> >ajay
> >
> >_
> >ninemsn Premium transforms your e-mail with colours, photos and animated
> >text. Click here  http://ninemsn.com.au/premium/landing.asp
> >
> >
> >-
> >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]
> >
>
> _
> E-mail just got a whole lot better. New ninemsn Premium. Click here
> http://ninemsn.com.au/premium/landing.asp
>
>
> -
> 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: URGENT: html:options

2003-10-14 Thread ajay brar
hi!

I think your collection needs to implement the List interface (use an
ArrayList instead of a vector)
but a vector implements the List interface, or so says the api
any other ideas


-Original Message-
From: ajay brar [mailto:[EMAIL PROTECTED]
Sent: 14 October 2003 12:45
To: [EMAIL PROTECTED]
Subject: URGENT: html:options
hi!
i'm getting a problem with my html:options
what i have is a MyUtils class with a method to retrieve a list of agency
id's from the database
class MyUtils
{
   //gets agencyIds creates LabelValueBeans and chucks them into a Vector
 public static Vector getAgencyIds()
}
in my jsp page i had
<%@ page import="MyUtils" %>

<%  agencyIds= MyUtils.getAgencyIds();   %>
i then had

  

this gave me an error, setCollection(java.lang.String) cannot be applied to
java.util.Vector
this was a compiler error.
i tried doing,
changed MyUtils to
class MyUtils
{
   private Vector agencyIds=new Vector();
   //gets agencyIds creates LabelValueBeans and chucks them into a Vector
 public Vector getAgencyIds()
}
<%@ page import="MyUtils" %>


  
value="value" />


this gave me an error saying it couldn't find bean agencyId in any scope.

could someone please help.

thanks
cheers
ajay
_
ninemsn Premium transforms your e-mail with colours, photos and animated
text. Click here  http://ninemsn.com.au/premium/landing.asp
-
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]
_
E-mail just got a whole lot better. New ninemsn Premium. Click here 
http://ninemsn.com.au/premium/landing.asp

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


RE: URGENT: html:options

2003-10-14 Thread Daniel Haynes
I think your collection needs to implement the List interface (use an
ArrayList instead of a vector)

-Original Message-
From: ajay brar [mailto:[EMAIL PROTECTED]
Sent: 14 October 2003 12:45
To: [EMAIL PROTECTED]
Subject: URGENT: html:options

hi!
i'm getting a problem with my html:options
what i have is a MyUtils class with a method to retrieve a list of agency
id's from the database
class MyUtils
{
   //gets agencyIds creates LabelValueBeans and chucks them into a Vector
 public static Vector getAgencyIds()
}

in my jsp page i had
<%@ page import="MyUtils" %>

<%  agencyIds= MyUtils.getAgencyIds();   %>
i then had

  


this gave me an error, setCollection(java.lang.String) cannot be applied to
java.util.Vector
this was a compiler error.

i tried doing,
changed MyUtils to
class MyUtils
{
   private Vector agencyIds=new Vector();
   //gets agencyIds creates LabelValueBeans and chucks them into a Vector
 public Vector getAgencyIds()
}
<%@ page import="MyUtils" %>


  


this gave me an error saying it couldn't find bean agencyId in any scope.

could someone please help.

thanks
cheers
ajay

_
ninemsn Premium transforms your e-mail with colours, photos and animated
text. Click here  http://ninemsn.com.au/premium/landing.asp


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



URGENT: html:options

2003-10-14 Thread ajay brar
hi!
i'm getting a problem with my html:options
what i have is a MyUtils class with a method to retrieve a list of agency 
id's from the database
class MyUtils
{
  //gets agencyIds creates LabelValueBeans and chucks them into a Vector
public static Vector getAgencyIds()
}

in my jsp page i had
<%@ page import="MyUtils" %>

<%  agencyIds= MyUtils.getAgencyIds();   %>
i then had

 

this gave me an error, setCollection(java.lang.String) cannot be applied to 
java.util.Vector
this was a compiler error.

i tried doing,
changed MyUtils to
class MyUtils
{
  private Vector agencyIds=new Vector();
  //gets agencyIds creates LabelValueBeans and chucks them into a Vector
public Vector getAgencyIds()
}
<%@ page import="MyUtils" %>


 


this gave me an error saying it couldn't find bean agencyId in any scope.

could someone please help.

thanks
cheers
ajay
_
ninemsn Premium transforms your e-mail with colours, photos and animated 
text. Click here  http://ninemsn.com.au/premium/landing.asp

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


Re: html:options

2003-10-12 Thread ajay brar
hi!
thanks for that.
no the values are not application wide, they may change depending on the 
sequence of user actions.
LabelValueBean sounds like an excellent idea
thanks
cheers
ajay


From: Jeff Kyser <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Re: html:options
Date: Sun, 12 Oct 2003 09:51:17 -0500
name/value pairs from a database are handled nicely
in a list of LabelValueBeans.
I'd pull the code to load that list from the database out
into a model class, or perhaps into a Singleton loaded
by an InitServlet (at startup - if the contents weren't
changing, or were at least application-wide)
Then let your actions access the application-scoped
AgencyList instead of doing the work themselves.
And you can iterate the AgencyList in your JSPs,
dealing with both names and values, or just values -
whatever you want.
-jeff

On Sunday, October 12, 2003, at 09:33  AM, ajay brar wrote:

hi!
i have the following scenario
in my database i have an Agency table(which includes the attribute 
AGENCY_ID) and a Client tables(which includes a AGENCY_ID that maps to the 
id in the Agency table)
agencies are created first through a web interface.
after that you create Clients. what i want is that when you are filling in 
the details for the client, i want  a drop down list that includes the 
AGENCY_ID of all agencies that are in the database. so the person fiiling 
in the info can select a particular AGENCY_ID for that client)
right now in my ClientForm, i have an int agencyId. i want this populated 
on the basis of the selection made form the drop down list.

how do i do this? any suggestions?
i'm thinking of  reading all agencies, chucking them into a collection, 
placing the collection in the session context and then reading off it in 
the jsp page using html:options

The downside to that is that my ClientAction forwrads to client.jsp(where 
you add client details). And i do not particularly want to put all the 
Agency reading bit into ClientAction.
I could use a separate Java class, but i have an action DisplayAgency that 
reads all the agencies from the database, adds them to a User bean, puts 
this in session context and later the page this action forwards to uses 
logic:iterate to move through the collection in the User bean and display 
it. Having another Java class to read only the id's and put them in a 
collection and place this in sesision seems like duplicatng an existing 
task(with sme minor differences)

are there any other ways of doing this?

thanks
cheers
ajay
_
Chat via SMS. Simply send 'CHAT' to 1889918. More info at  
http://ninemsn.com.au/mobilemania/MoChat.asp?blipid=6800

-
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]
_
Chat via SMS. Simply send 'CHAT' to 1889918.  More info at  
http://ninemsn.com.au/mobilemania/MoChat.asp?blipid=6800

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


Re: html:options

2003-10-12 Thread Jeff Kyser
name/value pairs from a database are handled nicely
in a list of LabelValueBeans.
I'd pull the code to load that list from the database out
into a model class, or perhaps into a Singleton loaded
by an InitServlet (at startup - if the contents weren't
changing, or were at least application-wide)
Then let your actions access the application-scoped
AgencyList instead of doing the work themselves.
And you can iterate the AgencyList in your JSPs,
dealing with both names and values, or just values -
whatever you want.
-jeff

On Sunday, October 12, 2003, at 09:33  AM, ajay brar wrote:

hi!
i have the following scenario
in my database i have an Agency table(which includes the attribute 
AGENCY_ID) and a Client tables(which includes a AGENCY_ID that maps to 
the id in the Agency table)
agencies are created first through a web interface.
after that you create Clients. what i want is that when you are 
filling in the details for the client, i want  a drop down list that 
includes the AGENCY_ID of all agencies that are in the database. so 
the person fiiling in the info can select a particular AGENCY_ID for 
that client)
right now in my ClientForm, i have an int agencyId. i want this 
populated on the basis of the selection made form the drop down list.

how do i do this? any suggestions?
i'm thinking of  reading all agencies, chucking them into a 
collection, placing the collection in the session context and then 
reading off it in the jsp page using html:options

The downside to that is that my ClientAction forwrads to 
client.jsp(where you add client details). And i do not particularly 
want to put all the Agency reading bit into ClientAction.
I could use a separate Java class, but i have an action DisplayAgency 
that reads all the agencies from the database, adds them to a User 
bean, puts this in session context and later the page this action 
forwards to uses logic:iterate to move through the collection in the 
User bean and display it. Having another Java class to read only the 
id's and put them in a collection and place this in sesision seems 
like duplicatng an existing task(with sme minor differences)

are there any other ways of doing this?

thanks
cheers
ajay
_
Chat via SMS. Simply send 'CHAT' to 1889918. More info at  
http://ninemsn.com.au/mobilemania/MoChat.asp?blipid=6800

-
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:options

2003-10-12 Thread ajay brar
hi!
i have the following scenario
in my database i have an Agency table(which includes the attribute 
AGENCY_ID) and a Client tables(which includes a AGENCY_ID that maps to the 
id in the Agency table)
agencies are created first through a web interface.
after that you create Clients. what i want is that when you are filling in 
the details for the client, i want  a drop down list that includes the 
AGENCY_ID of all agencies that are in the database. so the person fiiling in 
the info can select a particular AGENCY_ID for that client)
right now in my ClientForm, i have an int agencyId. i want this populated on 
the basis of the selection made form the drop down list.

how do i do this? any suggestions?
i'm thinking of  reading all agencies, chucking them into a collection, 
placing the collection in the session context and then reading off it in the 
jsp page using html:options

The downside to that is that my ClientAction forwrads to client.jsp(where 
you add client details). And i do not particularly want to put all the 
Agency reading bit into ClientAction.
I could use a separate Java class, but i have an action DisplayAgency that 
reads all the agencies from the database, adds them to a User bean, puts 
this in session context and later the page this action forwards to uses 
logic:iterate to move through the collection in the User bean and display 
it. Having another Java class to read only the id's and put them in a 
collection and place this in sesision seems like duplicatng an existing 
task(with sme minor differences)

are there any other ways of doing this?

thanks
cheers
ajay
_
Chat via SMS. Simply send 'CHAT' to 1889918. More info at  
http://ninemsn.com.au/mobilemania/MoChat.asp?blipid=6800

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


Re: Simple html:options question

2003-09-11 Thread Kris Schneider
Pretty sure you can just do:



It should use the list for both the values and the labels. If the list is a
property on your form:



If the list is a property of some other bean:



Quoting Kumar M <[EMAIL PROTECTED]>:

> 
> Hi all,
> 
> I have an ArraList of strings that I want to show in a drop-down box. The 
> same thing is both the label as well as the value. Can anybody tell me how I
> 
> can do this using html:options? The collection in html:options is expected 
> to hold JSP beans, which is not the case in my situation.
> 
> Thanks in advance!

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech   <http://www.dotech.com/>

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



Simple html:options question

2003-09-11 Thread Kumar M
Hi all,

I have an ArraList of strings that I want to show in a drop-down box. The 
same thing is both the label as well as the value. Can anybody tell me how I 
can do this using html:options? The collection in html:options is expected 
to hold JSP beans, which is not the case in my situation.

Thanks in advance!

_
Need more e-mail storage? Get 10MB with Hotmail Extra Storage.   
http://join.msn.com/?PAGE=features/es

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


RE: MessageResource, html:options & i182

2003-08-28 Thread Paul McCulloch
You could use a single key with some sort of delimter:

sports.options=Football\Hockey\Badminton

and parse the key to create your options.

Paul

-Original Message-
From: Lars Bergström [mailto:[EMAIL PROTECTED]
Sent: 28 August 2003 12:25
To: [EMAIL PROTECTED]
Subject: MessageResource, html:options & i182


Part 1
On a jsp page I want to have a html:select of the type that has a
predefined
number of options, e.g. different sports. Now, I want to make use of
Struts
internalization where the differents locales text strings are retrieved
from
its locale properties file. 

If I read the text strings from the Message resource file one by one
then I
have to edit my java code when I find out that I want another sport in
my
html:select. In my case a new sport is added very seldomly. 

Is there a nice way of using struts tags like logic:iterate together
with
html:select or 
Can I in some nice looking way with the help of MessageResourceBundle
class
retrieve all text strings starting with sports.* ? 

Part 2

Have being doing some thinking and reading,

In chapter 13.4.3 (Struts in Action) I found text talking about exaktly
this.
Still, the "keys" array must be populated in some way. One alternative
is to
have a separate properties file that holds all the keys for different
sports.
Another alternative is to have a database table containing the keys. 

org.apache.scaffold.text.MessageUtils? Whereever did it go? Can't find
it!
Anyone? 

An aspect of this is how often you estimate that the information will be
edited by the end user. If the end user never or almost never add new
sports,
then saving the i18n strings in a Resource files would be alright.
However, if
the end user quite frequently changes the information, perhaps would it
then
be more convenient to store the information in a database since it can
be
viewed more a part of the application rather than a part of the delivery
of
the product. 

Best regards

Lasse Bergström

 

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


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.


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



MessageResource, html:options & i182

2003-08-28 Thread Lars Bergström
Part 1
On a jsp page I want to have a html:select of the type that has a
predefined
number of options, e.g. different sports. Now, I want to make use of
Struts
internalization where the differents locales text strings are retrieved
from
its locale properties file. 

If I read the text strings from the Message resource file one by one
then I
have to edit my java code when I find out that I want another sport in
my
html:select. In my case a new sport is added very seldomly. 

Is there a nice way of using struts tags like logic:iterate together
with
html:select or 
Can I in some nice looking way with the help of MessageResourceBundle
class
retrieve all text strings starting with sports.* ? 

Part 2

Have being doing some thinking and reading,

In chapter 13.4.3 (Struts in Action) I found text talking about exaktly
this.
Still, the "keys" array must be populated in some way. One alternative
is to
have a separate properties file that holds all the keys for different
sports.
Another alternative is to have a database table containing the keys. 

org.apache.scaffold.text.MessageUtils? Whereever did it go? Can't find
it!
Anyone? 

An aspect of this is how often you estimate that the information will be
edited by the end user. If the end user never or almost never add new
sports,
then saving the i18n strings in a Resource files would be alright.
However, if
the end user quite frequently changes the information, perhaps would it
then
be more convenient to store the information in a database since it can
be
viewed more a part of the application rather than a part of the delivery
of
the product. 

Best regards

Lasse Bergström

 

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



RE: blank screen when validation fails. appears to be related to html:options

2003-08-22 Thread David Friedman
Dear Rich,

I had my javascript validation break the page like that
when I had two conditions incorrect in my page:

1) I put my  tag within
my opening/closing  tags
2) when I used #1 with the wrong formName="something" (i.e.
no matching validation formset).

When I fixed both of those problems on my Struts 1.1/Tomcat,
I was able to validate properly client & server side without
getting white pages and messed up Javascript.

Regards,
David

-Original Message-
From: Rich [mailto:[EMAIL PROTECTED]
Sent: Friday, August 22, 2003 6:19 PM
To: Struts Users Mailing List (E-mail)
Subject: blank screen when validation fails. appears to be related to
html:options


I am having a problem with validating a html:select drop down.  I think.

The problem: after validation fails the JSP is blank (the browser is blank)
not just an empty drop down.  To be more specific...I load the page then
without filling out any field I do a submit.  It then does the javascript
validation (I am only doing a required validation on one field at the
moment) and displays the alert box.  I click ok and then it appears the it
then tries to do the server-side validation and fails.  When it comes back
instead of seeing the same page with the added validation messages rendered,
it renders a blank screen.  When I view source it shows the code prior to
the html:javascript tag and then cuts off about 2/3 of the way through the
validation JavaScript's.  There is nothing to render after that.

I thought my problem was related to some of the posts about the drop down
not repopulating because when I comment out the lines with the bean:define
and html:options that it then comes back from the validation failure with
the correct view (instead of blank as mentioned above).  But of course the
drop down is empty because I commented out the lines to populate it.  I
tried a few of those suggestion but could not get the page to display with
those lines uncommented.

One thing that may be worth mention is that I get the list for the drop down
with a "public List getAdjustTypes()" on the form.  I could use some help at
this point (well I always need help) since my brain just short circuited
about 20 minutes ago.

Here is my code:

---  The
SP  -

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/czee-tags.tld" prefix="cz" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>





function cancelAdjustment(form) {
  form.action='<html:rewrite page="/checkCancel.do" />';
  form.submit();
}





  
  
Account Adjustment
  




  

  currentForm=checkAdjustmentForm;






  

  

  

  

  
  

  
  

  
  
  


  


  
  

  
  

  
  

  
  

  

  
  

  

  
  
  location.href=''
  
  
  

  

  

  

  

  

  
  





  The Form  ---
package com.mvsc.czee.forms.financial.check;

import com.mvsc.czee.business.financial.Journal;
import com.mvsc.czee.business.contacts.Contact;
import com.mvsc.czee.business.claims.Claimant;
import com.mvsc.czee.business.insured.Insured;
import com.mvsc.czee.business.bankAccount.BankAccount;
import com.mvsc.czee.persistence.Persistence;
import com.mvsc.czee.persistence.SearchObject;
import com.mvsc.czee.SymbolConstants;

import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
import java.util.ListIterator;
import java.sql.SQLException;

import cirrus.hibernate.HibernateException;
import org.apache.log4j.Logger;
import org.apache.struts.util.LabelValueBean;
import org.apache.struts.util.MessageResources;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.Action;

import javax.servlet.ServletRequest;

/**
 * (enter description here)
 * 
 * Examples(s):
 * 
 *Class clazz = new Class();
 *clazz.doSomething();
 * 
 * 
 * $Revision: $ 
 * $Created: Aug 6, 2003 at 1:24:03 PM $
 * @author 

blank screen when validation fails. appears to be related to html:options

2003-08-22 Thread Rich
I am having a problem with validating a html:select drop down.  I think.

The problem: after validation fails the JSP is blank (the browser is blank)
not just an empty drop down.  To be more specific...I load the page then
without filling out any field I do a submit.  It then does the javascript
validation (I am only doing a required validation on one field at the
moment) and displays the alert box.  I click ok and then it appears the it
then tries to do the server-side validation and fails.  When it comes back
instead of seeing the same page with the added validation messages rendered,
it renders a blank screen.  When I view source it shows the code prior to
the html:javascript tag and then cuts off about 2/3 of the way through the
validation JavaScript's.  There is nothing to render after that.

I thought my problem was related to some of the posts about the drop down
not repopulating because when I comment out the lines with the bean:define
and html:options that it then comes back from the validation failure with
the correct view (instead of blank as mentioned above).  But of course the
drop down is empty because I commented out the lines to populate it.  I
tried a few of those suggestion but could not get the page to display with
those lines uncommented.

One thing that may be worth mention is that I get the list for the drop down
with a "public List getAdjustTypes()" on the form.  I could use some help at
this point (well I always need help) since my brain just short circuited
about 20 minutes ago.

Here is my code:

---  The
SP  -

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/czee-tags.tld" prefix="cz" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>





function cancelAdjustment(form) {
  form.action='<html:rewrite page="/checkCancel.do" />';
  form.submit();
}





  
  
Account Adjustment
  




  

  currentForm=checkAdjustmentForm;






  

  

  

  

  
  

  
  

  
  
  


  


  
  

  
  

  
  

  
  

  

  
  

  

  
  
  location.href=''
  
  
  

  

  

  

  

  

  
  





  The Form  ---
package com.mvsc.czee.forms.financial.check;

import com.mvsc.czee.business.financial.Journal;
import com.mvsc.czee.business.contacts.Contact;
import com.mvsc.czee.business.claims.Claimant;
import com.mvsc.czee.business.insured.Insured;
import com.mvsc.czee.business.bankAccount.BankAccount;
import com.mvsc.czee.persistence.Persistence;
import com.mvsc.czee.persistence.SearchObject;
import com.mvsc.czee.SymbolConstants;

import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
import java.util.ListIterator;
import java.sql.SQLException;

import cirrus.hibernate.HibernateException;
import org.apache.log4j.Logger;
import org.apache.struts.util.LabelValueBean;
import org.apache.struts.util.MessageResources;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.Action;

import javax.servlet.ServletRequest;

/**
 * (enter description here)
 * 
 * Examples(s):
 * 
 *Class clazz = new Class();
 *clazz.doSomething();
 * 
 * 
 * $Revision: $ 
 * $Created: Aug 6, 2003 at 1:24:03 PM $
 * @author Richard Conover
 * @author Copyright © 2003 MountainView Software
 */
public class CheckEditForm extends CheckDataForm implements SymbolConstants
{
  private static Logger logger = Logger.getLogger(CheckEditForm.class);
  private static final String SQL_ERROR = "SQL Exception trying to lookup
linked info, class: ";
  private static final String HIBERNATE_ERROR = "Hibernate Exception trying
to lookup linked info, class: ";
  private static final String KEY_MESSAGE = ", key is: ";

  private String searchPayee;
  private String searchCheckNumberFrom;
  private String searchCheckNumberTo;
  private String searchCheckDateFrom;
  private String se

RE: How can I get a value and a name that is different on a html:options collection?

2003-07-28 Thread Bard A. Evjen
Thank you very much! I really appreciate your help!

Cheers, Bård A.

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


RE: How can I get a value and a name that is different on a html:options collection?

2003-07-25 Thread Nagaraj_K
I think you need to used nested iterate to get the desired result.Since you
are storing objects in the Collection,each value that is returned by
labelProperty is just object.toString();


-Original Message-
From: Bard A. Evjen [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2003 6:19 PM
To: [EMAIL PROTECTED]
Subject: How can I get a value and a name that is different on a
html:options collection?


I have a Form class:

public Collection getMyMonthList() {
  myMonthList = new Vector();
  Calendar cal = Calendar.getInstance();
  cal.setTime(new Date(01012003));
  for (int i = 1; i < 13; i++) {
String label = monthListFormat.format(zeroTime(cal.getTime(), 
Calendar.MONTH, i));
LabelValueBean labelBean = new LabelValueBean("i", label);
myMonthList.add(labelBean);
  }
  return myMonthList;
}

and a jsp-file with:


  


But this returns

LabelValueBean[i,February]
LabelValueBean[i,March]
LabelValueBean[i,April]
LabelValueBean[i,May]
LabelValueBean[i,June]
LabelValueBean[i,July]
LabelValueBean[i,August]
LabelValueBean[i,September]
LabelValueBean[i,October]
LabelValueBean[i,November]
LabelValueBean[i,Desember]
LabelValueBean[i,January]

I want to display the name (eg. january) and the value in the option tag 
(eg. 1).

What have I done wrong?

Cheers,
Bard A.


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


RE: How can I get a value and a name that is different on a html:options collection?

2003-07-25 Thread Robert Taylor
> LabelValueBean labelBean = new LabelValueBean("i", label);
Change to
> LabelValueBean labelBean = new LabelValueBean(String.valueOf(i),
label);

robert

> -Original Message-
> From: Bard A. Evjen [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 25, 2003 8:49 AM
> To: [EMAIL PROTECTED]
> Subject: How can I get a value and a name that is different on a
> html:options collection?
>
>
> I have a Form class:
>
> public Collection getMyMonthList() {
>   myMonthList = new Vector();
>   Calendar cal = Calendar.getInstance();
>   cal.setTime(new Date(01012003));
>   for (int i = 1; i < 13; i++) {
> String label = monthListFormat.format(zeroTime(cal.getTime(),
> Calendar.MONTH, i));
> LabelValueBean labelBean = new LabelValueBean("i", label);
> myMonthList.add(labelBean);
>   }
>   return myMonthList;
> }
>
> and a jsp-file with:
>
> 
>   
> 
>
> But this returns
>
> LabelValueBean[i,February]
> LabelValueBean[i,March]
> LabelValueBean[i,April]
> LabelValueBean[i,May]
> LabelValueBean[i,June]
> LabelValueBean[i,July]
> LabelValueBean[i,August]
> LabelValueBean[i,September]
> LabelValueBean[i,October]
> LabelValueBean[i,November]
> LabelValueBean[i,Desember]
> LabelValueBean[i,January]
>
> I want to display the name (eg. january) and the value in the option tag
> (eg. 1).
>
> What have I done wrong?
>
> Cheers,
> Bard A.
>
>
> -
> 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]



How can I get a value and a name that is different on a html:options collection?

2003-07-25 Thread Bard A. Evjen
I have a Form class:

public Collection getMyMonthList() {
 myMonthList = new Vector();
 Calendar cal = Calendar.getInstance();
 cal.setTime(new Date(01012003));
 for (int i = 1; i < 13; i++) {
   String label = monthListFormat.format(zeroTime(cal.getTime(), 
Calendar.MONTH, i));
   LabelValueBean labelBean = new LabelValueBean("i", label);
   myMonthList.add(labelBean);
 }
 return myMonthList;
}

and a jsp-file with:


 

But this returns

LabelValueBean[i,February]
LabelValueBean[i,March]
LabelValueBean[i,April]
LabelValueBean[i,May]
LabelValueBean[i,June]
LabelValueBean[i,July]
LabelValueBean[i,August]
LabelValueBean[i,September]
LabelValueBean[i,October]
LabelValueBean[i,November]
LabelValueBean[i,Desember]
LabelValueBean[i,January]
I want to display the name (eg. january) and the value in the option tag 
(eg. 1).

What have I done wrong?

Cheers,
Bard A.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: html:options list source question

2003-07-14 Thread Craig Berry
Thanks for the very useful information.  Everything you said worked with
a single exception; to get the correct interpretation of the property
value pointing to a collection of LabelValueBeans, I needed to use
html:optionsCollection rather than html:options .

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Sunday, July 13, 2003 9:22 PM
To: 'Struts Users Mailing List'
Subject: RE: html:options list source question


Craig Berry wrote:
> The jsp page contains an html:form section linked via action mapping 
> to
the EditDeForm type.  
> In it, there is a select/options section that looks like this:
> 
> 
>  property="value"
>   labelProperty="label"/>
> 
> I had thought that this would be enough to make it work.

The docs say that if you don't specify 'name', it will look to the form
bean for 'property'.  

So without the  (definitely not needed) did you try:
 ?

(I'm not sure if you'd still need labelName/labelProperty, I suspect not
since you're using LabelValueBean.)

http://jakarta.apache.org/struts/userGuide/struts-html.html#options

(BTW, you don't need the 'set' method to be a bean, read-only properties
are perfectly acceptable.)

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



RE: html:options list source question

2003-07-13 Thread Wendy Smoak
Craig Berry wrote:
> The jsp page contains an html:form section linked via action mapping to
the EditDeForm type.  
> In it, there is a select/options section that looks like this:
> 
> 
>  property="value"
>   labelProperty="label"/>
>  
> I had thought that this would be enough to make it work.

The docs say that if you don't specify 'name', it will look to the form bean
for 'property'.  

So without the  (definitely not needed) did you try:
 ?

(I'm not sure if you'd still need labelName/labelProperty, I suspect not
since you're using LabelValueBean.)

http://jakarta.apache.org/struts/userGuide/struts-html.html#options

(BTW, you don't need the 'set' method to be a bean, read-only properties are
perfectly acceptable.)

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 


html:options list source question

2003-07-13 Thread Craig Berry
After much googling and head-scratching, I finally have an html:options tag working on 
a jsp.  The problem is that I don't know why one component of the solution is needed, 
and I was hoping someone can explain it to me.
 
My ActionForm subclass, EditDeForm, has a pair of methods to provide the option list 
as part of the form bean:

public Collection getNumFmtOptions() {
  ArrayList list = new ArrayList();
  list.add(new LabelValueBean("None", "0"));
  list.add(new LabelValueBean("Comma separated", "1"));
  list.add(new LabelValueBean("Currency", "2"));
  return list;
}
 
public void setNumFmtOptions(Collection options) {
  // No op, here to satisfy bean-ness.
}

The jsp page contains an html:form section linked via action mapping to the EditDeForm 
type.  In it, there is a select/options section that looks like this:


  
 

I had thought that this would be enough to make it work.  The html:options is in the 
context of an html:form that knows about the current form bean, and the form bean has 
a property numFmtOptions that contains what is needed to populate the options list.  
But when I tried just this, I got a "cannot find bean" error on numFmtOptions.
 
The googling mentioned above finally revealed that I had to add this at the top of my 
jsp:



My question is:  Why?  What is this additional definition for?  What information does 
it supply that isn't already available to html:options inside the html:form context?
 
I'm happy that I have my code working, but I'd be even happier if I knew why it's 
working. :)
 
-- 
Craig Berry
Principal Architect
PortBlue Corp.
 
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: Struggling with html:options

2003-07-09 Thread James Childers
Try this.

In your Action:

ArrayList months = new ArrayList();
months.add(new LabelValueBean("January", 1);
months.add(new LabelValueBean("Februrary", 2);
request.setAttribute("months", months);

In your JSP:





HTH,

-= J

> "sjones" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Good Morning Everyone.
> >
> > I have a List object and i need my JSP page
> > to build a drop down list box using the List as the source
> > for the options.
> >
> > I can do it with a scriplet but i need to one of the struts tags
> > 
> > 
> >
> > can anyone help me with use one of these tags.
> >
> > I am looking at the java.docs but it doesn't really help me.
> >
> > the List is also accessible from a classs name EqualityOperators
> >
> > List o = EqualityOperators.getOperators();

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



Re: Struggling with html:options

2003-07-09 Thread sjones

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>


<%@ page language="java"
 import=" com.ubs.directory.common.DirectoryEqualityOperator, java.util.*"
contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"
%>










<%
List o = DirectoryEqualityOperator.getOperationNames();
request.setAttribute("yerSelectBox", o);
%>








<%
 for (int i=0; i < o.size(); i++) {
String eqt = (String)o.get(i);
%>
<%=eqt %>
<%
 }
%>





I get this error,  can anyone help


[7/9/03 12:50:10:016 EDT] 868b89 WebGroup E SRVE0026E: [Servlet Error]-[No
getter method available for property key for bean under name yerSelectBox]:
javax.servlet.jsp.JspException: No getter method available for property key
for bean under name yerSelectBox
at org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:257)
at
org.apache.jsp._ypEqualityOperatorOptions._jspService(_ypEqualityOperatorOpt
ions.java:163)
at
com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
"sjones" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Good Morning Everyone.
>
> I have a List object and i need my JSP page
> to build a drop down list box using the List as the source
> for the options.
>
> I can do it with a scriplet but i need to one of the struts tags
> 
> 
>
> can anyone help me with use one of these tags.
>
> I am looking at the java.docs but it doesn't really help me.
>
> the List is also accessible from a classs name EqualityOperators
>
> List o = EqualityOperators.getOperators();




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



RE: html:options

2003-07-09 Thread Mathew, Manoj



 


-Original Message-
From: sjones [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 09, 2003 10:43 AM
To: [EMAIL PROTECTED]
Subject: html:options


Good Morning Everyone.

I have a List object and i need my JSP page
to build a drop down list box using the List as the source
for the options.

I can do it with a scriplet but i need to one of the struts tags



can anyone help me with use one of these tags.

I am looking at the java.docs but it doesn't really help me.

the List is also accessible from a classs name EqualityOperators

List o = EqualityOperators.getOperators();





-
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:options

2003-07-09 Thread sjones
Good Morning Everyone.

I have a List object and i need my JSP page
to build a drop down list box using the List as the source
for the options.

I can do it with a scriplet but i need to one of the struts tags



can anyone help me with use one of these tags.

I am looking at the java.docs but it doesn't really help me.

the List is also accessible from a classs name EqualityOperators

List o = EqualityOperators.getOperators();





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



show selected value in html:options field

2003-07-01 Thread Stefan Schaebel
Hello!
I'm using html:select and html:options to display a vector:


 


Now I would like to show the selected option when the options-field is
rendered (the size of the vector is larger than 6), or in other words I
would like to have the scroll bar at the right position to show the
preselected option of the vector.
Is that possible?

Thanks!


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



Re: html:options can not automatically match value

2003-06-16 Thread Aswathy Priyarenj
U can use  tag instead of .
This will retain the selected value .

From: "lcl" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: html:options can not automatically match value
Date: Thu, 5 Jun 2003 10:57:15 +0800
Sakis,

Thank you very much. I have done as you mentioned, but the result has not
changed.
I have tried to changed the collection name to
com_nsk_gs_sales_ClientInfo(of course, do it in action form to set a same
named attribute in session), and add a name attribute in html:selection tag
, which will like :
  
  
  
the output html will like this :

  name1
  name10
  name11
  ...

but no one will be mark as "SELECTED" , WOW!
"Sakis Chatzinikolaou" <[EMAIL PROTECTED]>
[EMAIL PROTECTED]
> Maybe you need to specify the name of the form bean before the
> property="projclieid"
> e.g.
> 
>
> and maybe the collection name should not be the
com.nsk.gs.sales.ClientInfo
>
> but the name you put in the request from the action class before you 
call
> the jsp
>
> 
>   
> property="estateOfficeID"  labelProperty="estateOfficeName" />
> 
>
> The estateOfficesNames is an attribute set in the request from the 
action
> class
> The apartmentForm  is the form bean and the apartmentOffice is a 
property
of
> the bean
>
> Hope this helps
>
> - Original Message -
> From: "lcl" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, June 04, 2003 12:33 PM
> Subject: html:options can not automatically match value
>
>
> > Hi all ,
> >
> > I have using the following code to express a select control in html
using
> > strtus tag:
> >
> > 
> >   
> > labelProperty="cliename"
> > property="clieid" />
> > 
> >
> > When this jsp page is running, all is ok, but the options will not 
match
> > what the "projclieid" is. in the dropdown list, there is one item 
match
> the
> > value,but it is not mark as "selected", what's wrong?
> >
> > And if I manually specific the value,such as 
> > property="projclieid" value="aa">,
> >  it will work fine, it will more surprise me...
> >
> > Please help me, thank you very much.
> > lcl
> >
> >
> >
> >
> > -
> > 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]
_
Gift yourself a holiday. Treat your family like royalty. 
http://www.flexihols.com/2003/index.php

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


html:select and html:options example?

2003-06-15 Thread Stephan Niedermeier
Hello,

who can give me an example, how to use the html:select in conjunction with
html:options? I had already defined an ActionForm and JSP like follows. The
listing of the option-Elements works fine but not the "reshowing" of the
selected elements of the list, because after I have clicked the submit
button I've got an IllegalArgumentException (BeanUtils.populate):

java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.j
ava:1789)
at
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.j
ava:1684)
at
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:17
13)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
{...}

My FormBean looks like this:
{...}
public final class RoleEditForm extends ActionForm {
{...}public void setAllUsers(ArrayList allUsers)
 this.allUsers = allUsers;}public ArrayList getAllUsers()
 return this.allUsers;}
{...}}
The allUsers list contains user objects. The user objects have the accessor
methods getId(), getName().
My JSP looks like this:





After clicking the submit button I've got the Exception. That's wrong?

Thank you very much!
Regards
Stephan



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



RE: Excluding values inside a logic:iterate tag or an html:options tag

2003-06-06 Thread Kamholz, Keith (corp-staff) USX
Yes it is.  Use the logic:equal and logic:notEqual tags to do this.
Let me know if you need more info.


Keith Kamholz
Programming and Architecture
Moog Inc.

Phone: (716) 687-7001

www.buffalo.edu/~kkamholz


-Original Message-
From: Ionel Gardais [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2003 4:08 AM
To: Struts Users Mailing List
Subject: Excluding values inside a logic:iterate tag or an html:options
tag


Hi,

Is it possible to tell these tags that when they hit some values, they 
shouldn't display them ?

Thanks,
ionel



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



Excluding values inside a logic:iterate tag or an html:options tag

2003-06-06 Thread Ionel Gardais
Hi,

Is it possible to tell these tags that when they hit some values, they 
shouldn't display them ?

Thanks,
ionel


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


Can html:options labelProperty made of concatenated bean fields ?

2003-06-06 Thread Ionel Gardais
Hi,

The question's in the subject.
Can the labelProperty of an html:options tag be composed of a 
concatenation of two or more fields ? (like having labelProperty="name + 
surname")

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


Re: html:options can not automatically match value

2003-06-04 Thread Sakis Chatzinikolaou
Maybe you need to specify the name of the form bean before the
property="projclieid"
e.g.


and maybe the collection name should not be the com.nsk.gs.sales.ClientInfo

but the name you put in the request from the action class before you call
the jsp


  


The estateOfficesNames is an attribute set in the request from the action
class
The apartmentForm  is the form bean and the apartmentOffice is a property of
the bean

Hope this helps

- Original Message - 
From: "lcl" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 04, 2003 12:33 PM
Subject: html:options can not automatically match value


> Hi all ,
>
> I have using the following code to express a select control in html using
> strtus tag:
>
> 
>labelProperty="cliename"
> property="clieid" />
> 
>
> When this jsp page is running, all is ok, but the options will not match
> what the "projclieid" is. in the dropdown list, there is one item match
the
> value,but it is not mark as "selected", what's wrong?
>
> And if I manually specific the value,such as  property="projclieid" value="aa">,
>  it will work fine, it will more surprise me...
>
> Please help me, thank you very much.
> lcl
>
>
>
>
> -
> 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:options can not automatically match value

2003-06-04 Thread lcl
Sakis,

Thank you very much. I have done as you mentioned, but the result has not
changed.
I have tried to changed the collection name to
com_nsk_gs_sales_ClientInfo(of course, do it in action form to set a same
named attribute in session), and add a name attribute in html:selection tag
, which will like :
  
  
  

the output html will like this :

  name1
  name10
  name11
  ...

but no one will be mark as "SELECTED" , WOW!

"Sakis Chatzinikolaou" <[EMAIL PROTECTED]>
[EMAIL PROTECTED]
> Maybe you need to specify the name of the form bean before the
> property="projclieid"
> e.g.
> 
>
> and maybe the collection name should not be the
com.nsk.gs.sales.ClientInfo
>
> but the name you put in the request from the action class before you call
> the jsp
>
> 
>property="estateOfficeID"  labelProperty="estateOfficeName" />
> 
>
> The estateOfficesNames is an attribute set in the request from the action
> class
> The apartmentForm  is the form bean and the apartmentOffice is a property
of
> the bean
>
> Hope this helps
>
> - Original Message -
> From: "lcl" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, June 04, 2003 12:33 PM
> Subject: html:options can not automatically match value
>
>
> > Hi all ,
> >
> > I have using the following code to express a select control in html
using
> > strtus tag:
> >
> > 
> >> labelProperty="cliename"
> > property="clieid" />
> > 
> >
> > When this jsp page is running, all is ok, but the options will not match
> > what the "projclieid" is. in the dropdown list, there is one item match
> the
> > value,but it is not mark as "selected", what's wrong?
> >
> > And if I manually specific the value,such as  > property="projclieid" value="aa">,
> >  it will work fine, it will more surprise me...
> >
> > Please help me, thank you very much.
> > lcl
> >
> >
> >
> >
> > -
> > 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:options can not automatically match value

2003-06-04 Thread lcl
Hi all ,

I have using the following code to express a select control in html using
strtus tag:


  


When this jsp page is running, all is ok, but the options will not match
what the "projclieid" is. in the dropdown list, there is one item match the
value,but it is not mark as "selected", what's wrong?

And if I manually specific the value,such as ,
 it will work fine, it will more surprise me...

Please help me, thank you very much.
lcl




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



RE: html:options

2003-05-27 Thread Kandi Potter
hey thanksmaybe I'll try to minimize my code.

-Original Message-
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 12:15 PM
To: Struts Users Mailing List
Subject: RE: html:options


I was able to do it like that. 




  

Thanks a lot all you ppl.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:39 PM
To: [EMAIL PROTECTED]
Subject: RE: html:options


There are other optiosn to use it...
I ahve never used it with Arays but i have used it with Collections...

First i use jsp:useBean tag to get the collection from the form and make it available 
in the page scope and then use html:options with collection="beanName"

where beanName is the eban created through useBean tag..There must eb some way to use 
it with arrays...

Let me know if u dont find anything..May be tomorrow i will find some time to look at 
the doc..
regards,
Shirish

-Original Message-
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 5:44 PM
To: Struts Users Mailing List
Subject: RE: html:options


correct me if I am wrong. 
This would work if getOptionList() returns an array of String.
In my case array is of Objects and one attribute of that object has to be displayed.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:07 PM
To: [EMAIL PROTECTED]
Subject: RE: html:options


check the documentation for the tag...

use name="formBeanName" property="optionList"

-Original Message-
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 5:38 PM
To: Struts Users Mailing List
Subject: RE: html:options


Yea...with collection it works. But what if my collection of objects is obtained from 
the form-bean.
(I dont want to use scripting to first take the collection out of the form-bean.)

-Original Message-
From: Gareth Andrew [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:00 PM
To: Struts Users Mailing List
Subject: Re: html:options


In one of my JSPs I have:



 

where locales is an array of beans with getISOCode() and 
getDisplayName() methods.

Hope this helps,

Gareth


Abhinav (Cognizant) wrote:

>I have one form bean with getter/setters for property List.
>getter returns a vector of objects of type { getID(), getDesc(),  setID(), setDesc() }
> 
>I have to use this vector to populate a select box in html using html:select/options
>somehow i am unable to make out labelProperty, labelName
> 
>Can someone gimme an example how this can be done.
> 
> 
> 
>
>  
>
>
>
>-
>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]




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




 







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



RE: html:options

2003-05-27 Thread Abhinav (Cognizant)
I was able to do it like that. 




  

Thanks a lot all you ppl.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:39 PM
To: [EMAIL PROTECTED]
Subject: RE: html:options


There are other optiosn to use it...
I ahve never used it with Arays but i have used it with Collections...

First i use jsp:useBean tag to get the collection from the form and make it available 
in the page scope and then use html:options with collection="beanName"

where beanName is the eban created through useBean tag..There must eb some way to use 
it with arrays...

Let me know if u dont find anything..May be tomorrow i will find some time to look at 
the doc..
regards,
Shirish

-Original Message-
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 5:44 PM
To: Struts Users Mailing List
Subject: RE: html:options


correct me if I am wrong. 
This would work if getOptionList() returns an array of String.
In my case array is of Objects and one attribute of that object has to be displayed.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:07 PM
To: [EMAIL PROTECTED]
Subject: RE: html:options


check the documentation for the tag...

use name="formBeanName" property="optionList"

-Original Message-
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 5:38 PM
To: Struts Users Mailing List
Subject: RE: html:options


Yea...with collection it works. But what if my collection of objects is obtained from 
the form-bean.
(I dont want to use scripting to first take the collection out of the form-bean.)

-Original Message-
From: Gareth Andrew [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:00 PM
To: Struts Users Mailing List
Subject: Re: html:options


In one of my JSPs I have:



 

where locales is an array of beans with getISOCode() and 
getDisplayName() methods.

Hope this helps,

Gareth


Abhinav (Cognizant) wrote:

>I have one form bean with getter/setters for property List.
>getter returns a vector of objects of type { getID(), getDesc(),  setID(), setDesc() }
> 
>I have to use this vector to populate a select box in html using html:select/options
>somehow i am unable to make out labelProperty, labelName
> 
>Can someone gimme an example how this can be done.
> 
> 
> 
>
>  
>
>
>
>-
>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]



** 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:options

2003-05-27 Thread shirishchandra.sakhare
There are other optiosn to use it...
I ahve never used it with Arays but i have used it with Collections...

First i use jsp:useBean tag to get the collection from the form and make it available 
in the page scope and then use html:options with collection="beanName"

where beanName is the eban created through useBean tag..There must eb some way to use 
it with arrays...

Let me know if u dont find anything..May be tomorrow i will find some time to look at 
the doc..
regards,
Shirish

-Original Message-
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 5:44 PM
To: Struts Users Mailing List
Subject: RE: html:options


correct me if I am wrong. 
This would work if getOptionList() returns an array of String.
In my case array is of Objects and one attribute of that object has to be displayed.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:07 PM
To: [EMAIL PROTECTED]
Subject: RE: html:options


check the documentation for the tag...

use name="formBeanName" property="optionList"

-Original Message-
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 5:38 PM
To: Struts Users Mailing List
Subject: RE: html:options


Yea...with collection it works. But what if my collection of objects is obtained from 
the form-bean.
(I dont want to use scripting to first take the collection out of the form-bean.)

-Original Message-
From: Gareth Andrew [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:00 PM
To: Struts Users Mailing List
Subject: Re: html:options


In one of my JSPs I have:



 

where locales is an array of beans with getISOCode() and 
getDisplayName() methods.

Hope this helps,

Gareth


Abhinav (Cognizant) wrote:

>I have one form bean with getter/setters for property List.
>getter returns a vector of objects of type { getID(), getDesc(),  setID(), setDesc() }
> 
>I have to use this vector to populate a select box in html using html:select/options
>somehow i am unable to make out labelProperty, labelName
> 
>Can someone gimme an example how this can be done.
> 
> 
> 
>
>  
>
>
>
>-
>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

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:







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.




    
   





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




 







-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:Options usage

2003-03-18 Thread e gg

thanks for replying but the solution doesn't work, so I changed it  a bit:











 

and I got this error:

Error Message: No getter method available for property filter0 for bean under name 
org.apache.struts.taglib.html.BEAN
Error Code: 500
Target Servlet: null
Error Stack: 
javax.servlet.jsp.JspException: No getter method available for property filter0 for 
bean under name org.apache.struts.taglib.html.BEAN 
 at org.apache.struts.taglib.html.SelectTag.doStartTag(SelectTag.java:309) 


 

 "du Plessis, Corneil C" <[EMAIL PROTECTED]> wrote:
'>name="filter" label="label" value="value"/>


-Original Message-
From: e gg [mailto:[EMAIL PROTECTED]
Sent: 17 March, 2003 15:16
To: [EMAIL PROTECTED]
Subject: Html:Options usage



Hi, I have a bean class that returns an ArrayList of ArrayLists for my
dropdowns. I am really confused on how to show this dropdowns. Here's my
bean class:

public class UserAccessBean implements java.io.Serializable {


List deptList = new ArrayList();
List brokerList = new ArrayList();
List filters = new ArrayList();


public List getFilters() {
deptList.add(new LabelValueBean("1", "Department1"));
deptList.add(new LabelValueBean("2", "Department2"));
deptList.add(new LabelValueBean("3", "Department3"));


brokerList.add(new LabelValueBean("broker1", "BrokerDepartment1"));
brokerList.add(new LabelValueBean("broker2", "BrokerDepartment2"));
brokerList.add(new LabelValueBean("broker3", "BrokerDepartment3"));

filters.add(deptList);
filters.add(brokerList);
return filters;
}


}

The 'filters' ArrayList can actually return 2 or more ArrayList. Like if
there's 3 ArrayLists, I would like an html output such as:



tia,Emmanuel -Do you Yahoo!?Yahoo! Web Hosting - 
establish your business online__Disclaimer 
and confidentiality noteEverything in this e-mail and any attachments relating to the 
official business of Standard Bank Group Limited is proprietary to the company. It is 
confidential, legally privileged and protected by law. Standard Bank does not own and 
endorse any other content. Views and opinions are those of the sender unless clearly 
stated as being that of Standard Bank. The person addressed in the e-mail is the sole 
authorised recipient. Please notify the sender immediately if it has unintentionally 
reached you and do not read, disclose or use the contentin any way. Standard Bank can 
not assure that the integrity of this communication has been maintained nor that it is 
free of errors, virus, interception or 
interference.__-To
 unsubscribe, e-mail: [EMAIL PROTECTED] additional commands, e-mail: [EMAIL PROTECTED]


-
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

RE: Html:Options usage

2003-03-17 Thread du Plessis, Corneil C




-Original Message-
From: e gg [mailto:[EMAIL PROTECTED]
Sent: 17 March, 2003 15:16
To: [EMAIL PROTECTED]
Subject: Html:Options usage



Hi, I have a bean class that returns an ArrayList of ArrayLists for my
dropdowns. I am really confused on how to show this dropdowns. Here's my
bean class:

public class UserAccessBean implements java.io.Serializable {
 

List deptList  = new ArrayList();
List brokerList = new ArrayList();
List filters = new ArrayList();


 public List getFilters() {
 deptList.add(new LabelValueBean("1", "Department1"));
 deptList.add(new LabelValueBean("2", "Department2"));
 deptList.add(new LabelValueBean("3", "Department3"));


 brokerList.add(new LabelValueBean("broker1", "BrokerDepartment1"));
 brokerList.add(new LabelValueBean("broker2", "BrokerDepartment2"));
 brokerList.add(new LabelValueBean("broker3", "BrokerDepartment3"));
 
  filters.add(deptList);
  filters.add(brokerList);
  return filters;
 }


}

The 'filters' ArrayList can actually return 2 or more ArrayList. Like if
there's 3 ArrayLists, I would like an html output such as:







tia,

Emmanuel

  



-
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online

__

Disclaimer and confidentiality note


Everything in this e-mail and any attachments relating to the official business of 
Standard Bank Group Limited is proprietary to the company. It is confidential, legally 
privileged and protected by law. Standard Bank does not own and endorse any other 
content. 
Views and opinions are those of the sender unless clearly stated as being that of 
Standard Bank. 

The person addressed in the e-mail is the sole authorised recipient. Please notify the 
sender 
immediately if it has unintentionally reached you and do not read, disclose or use the 
content
in any way. 

Standard Bank can not assure that the integrity of this communication has been 
maintained nor 
that it is free of errors, virus, interception or interference.

__

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



Html:Options usage

2003-03-17 Thread e gg

Hi, I have a bean class that returns an ArrayList of ArrayLists for my dropdowns. I am 
really confused on how to show this dropdowns. Here's my bean class:

public class UserAccessBean implements java.io.Serializable {
 

List deptList  = new ArrayList();
List brokerList = new ArrayList();
List filters = new ArrayList();


 public List getFilters() {
 deptList.add(new LabelValueBean("1", "Department1"));
 deptList.add(new LabelValueBean("2", "Department2"));
 deptList.add(new LabelValueBean("3", "Department3"));


 brokerList.add(new LabelValueBean("broker1", "BrokerDepartment1"));
 brokerList.add(new LabelValueBean("broker2", "BrokerDepartment2"));
 brokerList.add(new LabelValueBean("broker3", "BrokerDepartment3"));
 
  filters.add(deptList);
  filters.add(brokerList);
  return filters;
 }


}

The 'filters' ArrayList can actually return 2 or more ArrayList. Like if there's 3 
ArrayLists, I would like an html output such as:







tia,

Emmanuel

  



-
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online

Re: Html:options

2003-03-12 Thread Nicolas De Loof
if you use  with  or , the
option that equals the formbean property value will be automaticaly
selected.

(formbean initialized with name="foo")


foo
bar
nop


will render


Nico.


> Is there a way of obtaining a  element where one of the

> sub-elements has the SELECTED attribute ?
> Thanks
>
> 
> Renato Romano
> Sistemi e Telematica S.p.A.
> Calata Grazie - Vial Al Molo Giano
> 16127 - GENOVA
>
> e-mail: [EMAIL PROTECTED]
> Tel.:   010 2712603
> _
>
>
>
>
> 
-
> 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:options

2003-03-12 Thread Renato Romano
Is there a way of obtaining a  element where one of the 
sub-elements has the SELECTED attribute ?
Thanks


Renato Romano
Sistemi e Telematica S.p.A.
Calata Grazie - Vial Al Molo Giano
16127 - GENOVA

e-mail: [EMAIL PROTECTED]
Tel.:   010 2712603
_




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



html:options and javascript

2003-03-12 Thread Neth
Hello,

I have an existing application which i converted into struts,
however i'm having some problem with regards to option with javascript.
The picture of the user should be reflected whenever his/her user id is
selected from the drop down box.

Below is the working application:


function showimage()
{
if (!document.images)
return
document.images.pictures.src=document.mygallery.userId.options[document.mygallery.userId.selectedIndex].value;

}


 
   <% for (int i=0;i

   <%=LoginManager.getusers(i)%>
   <% } %>
 
 


 
   <% if(LoginManager.getNoUsers()!=0){
   init = "pix\\" + LoginManager.getusers(0) + ".jpg";
  }
   %>

 
 

Conversion into struts not working


function showimage(){
 if (!document.images)
 return
 
document.images.pictures.src=document.forms.userId.options[document.forms.userId.selectedIndex].value;
// error here
}


   
  
 
 
 


Thanks



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



Re: RE: html:options selected attribute

2003-02-12 Thread Jason Vinson
Thanks Sri, the first link had a solution that worked perfectly.  I'll be sure to 
search google and the archives before posting in the future.

Thanks again,
Jason


---Original Message---
From: Sri Sankaran <[EMAIL PROTECTED]>
Sent: 02/12/03 09:48 AM
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: RE: html:options selected attribute

> 
> Take your pick of

http://marc.theaimsgroup.com/?l=struts-user&m=103416927522003&w=2
http://marc.theaimsgroup.com/?l=struts-user&m=103313043614360&w=2
http://marc.theaimsgroup.com/?l=struts-user&m=103254783510467&w=2
http://marc.theaimsgroup.com/?l=struts-user&m=102406536726794&w=2

Or just look at the same application that ships with Struts
(html-select.jsp in struts-exercise-taglib).

Please do search the archives before posting

Sri

-Original Message-
From: Jason Vinson [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 12, 2003 9:25 AM
To: Struts Users Mailing List
Subject: Re: html:options selected attribute


I am not exactly following the logic here.  Could you elaborate a little
more?

Thanks,
Jason


---Original Message---
From: Slobodan Kasterovic <[EMAIL PROTECTED]>
Sent: 02/12/03 08:24 AM
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: AW: html:options selected attribute

> 
> Hi !

Look my sample:
### Form
private ArrayList projektfilterliste;
private String[] projektfilter;

### JSP


 

### Action
ArrayList filterInhalt = new ArrayList();
filterInhalt.add(new LabelValueBean(
getAllProjectsDescription(request),
"One"));
filterInhalt.add(new LabelValueBean(
getAllProjectsDescription(request),
"Two"));
nextForm.setProjektfilterliste(filterInhalt);
request.setAttribute("projektfilterliste",filterInhalt);  // !!! //
Preselection ArrayList preselectedFilter = new ArrayList();
preselectedFilter.add("One"); nextForm.setProjektfilter(
(String[]) preselectedFilter.toArray(new String[0])); // can
multiple to


bye

Slobodan Kasterovic


--> -Ursprungliche Nachricht-
--> Von: Jason Vinson [mailto:[EMAIL PROTECTED]]
--> Gesendet: Mittwoch, 12. Februar 2003 13:51
--> An: Struts Users Mailing List
--> Betreff: html:options selected attribute
-->
-->
--> Hi folks,
-->
-->There my be a simple answer to this that I am overlooking, but I 
--> am populating a pull down select, and I can't figure out a good way 
--> to set the selected attribute to the first element.  I am using a 
--> collection (string
--> array) and my jsp has this code:
-->
-->  
-->  size="1">
-->   
--> 
-->   
-->
--> All I want to do is have the first option selected, and it is 
--> defaulting to the last option.
-->
--> any help?
-->
--> TIA,
--> Jason
-->
--> 
--> -
--> 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]

> 

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




AW: AW: html:options selected attribute

2003-02-12 Thread Slobodan Kasterovic
(in the forefront: Sorry for my english)

ok. I have

### Form
...
private ArrayList all;
private String[] selected;
public ArrayList getAll(){ return all; }
public void setAll(ArrayList all){ this.all = all; }
public String[] getSelected(){ return selected; }
public void setSelected(String[] selected){ this.selected = selected; }
...
### JSP
...



...
### Action
...
import org.apache.struts.util.LabelValueBean;
...
ArrayList allContent = new ArrayList();
allContent.add(new LabelValueBean(
"Label 1",
"Value 1"));
allContent.add(new LabelValueBean(
"Label 2",
"Value 2"));
form.setAll(allContent);
request.setAttribute("all",allContent);  // or ->
request.setAttribute("all",form.getAll());
// Preselection
ArrayList preselectedItems = new ArrayList();
preselectedItems.add("Label 1");
form.setSelected((String[]) preselectedItems.toArray(new String[0])); //
just custing for String[] from ArrayList
...

Selected item is now "Label 1" ! (all items ("Label 1", "Label 2")) !

Now understandable ?


bye

Slobodan Kasterovic


--> -Ursprungliche Nachricht-
--> Von: Jason Vinson [mailto:[EMAIL PROTECTED]]
--> Gesendet: Mittwoch, 12. Februar 2003 15:25
--> An: Struts Users Mailing List
--> Betreff: Re: AW: html:options selected attribute
-->
-->
--> I am not exactly following the logic here.  Could you
--> elaborate a little more?
-->
--> Thanks,
--> Jason
-->
-->
--> ---Original Message---
--> From: Slobodan Kasterovic <[EMAIL PROTECTED]>
--> Sent: 02/12/03 08:24 AM
--> To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
--> Subject: AW: html:options selected attribute
-->
--> >
--> > Hi !
-->
--> Look my sample:
--> ### Form
--> private ArrayList projektfilterliste;
--> private String[] projektfilter;
-->
--> ### JSP
-->
-->  onchange="newProjektfilter()"
--> styleClass="input_area">
-->  labelProperty="label" />
--> 
-->
--> ### Action
--> ArrayList filterInhalt = new ArrayList();
--> filterInhalt.add(new LabelValueBean(
--> getAllProjectsDescription(request),
--> "One"));
--> filterInhalt.add(new LabelValueBean(
--> getAllProjectsDescription(request),
--> "Two"));
--> nextForm.setProjektfilterliste(filterInhalt);
--> request.setAttribute("projektfilterliste",filterInhalt);  // !!!
--> // Preselection
--> ArrayList preselectedFilter = new ArrayList();
--> preselectedFilter.add("One");
--> nextForm.setProjektfilter(
--> (String[]) preselectedFilter.toArray(new
--> String[0])); // can multiple to
-->
-->
--> bye
-->
--> Slobodan Kasterovic
-->
-->
--> --> -Ursprungliche Nachricht-
--> --> Von: Jason Vinson [mailto:[EMAIL PROTECTED]]
--> --> Gesendet: Mittwoch, 12. Februar 2003 13:51
--> --> An: Struts Users Mailing List
--> --> Betreff: html:options selected attribute
--> -->
--> -->
--> --> Hi folks,
--> -->
--> -->There my be a simple answer to this that I am
--> --> overlooking, but I am populating a pull down select, and I
--> --> can't figure out a good way to set the selected attribute
--> --> to the first element.  I am using a collection (string
--> --> array) and my jsp has this code:
--> -->
--> -->  
--> -->  --> property="queuesName" size="1">
--> -->   
--> --> 
--> -->   
--> -->
--> --> All I want to do is have the first option selected, and it
--> --> is defaulting to the last option.
--> -->
--> --> any help?
--> -->
--> --> TIA,
--> --> Jason
--> -->
--> --> 
--> --> -
--> --> 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:options selected attribute

2003-02-12 Thread Sri Sankaran
Take your pick of

http://marc.theaimsgroup.com/?l=struts-user&m=103416927522003&w=2
http://marc.theaimsgroup.com/?l=struts-user&m=103313043614360&w=2
http://marc.theaimsgroup.com/?l=struts-user&m=103254783510467&w=2
http://marc.theaimsgroup.com/?l=struts-user&m=102406536726794&w=2

Or just look at the same application that ships with Struts (html-select.jsp in 
struts-exercise-taglib).

Please do search the archives before posting

Sri

-Original Message-
From: Jason Vinson [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 12, 2003 9:25 AM
To: Struts Users Mailing List
Subject: Re: html:options selected attribute


I am not exactly following the logic here.  Could you elaborate a little more?

Thanks,
Jason


---Original Message---
From: Slobodan Kasterovic <[EMAIL PROTECTED]>
Sent: 02/12/03 08:24 AM
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: AW: html:options selected attribute

> 
> Hi !

Look my sample:
### Form
private ArrayList projektfilterliste;
private String[] projektfilter;

### JSP


 

### Action
ArrayList filterInhalt = new ArrayList();
filterInhalt.add(new LabelValueBean(
getAllProjectsDescription(request),
"One"));
filterInhalt.add(new LabelValueBean(
getAllProjectsDescription(request),
"Two"));
nextForm.setProjektfilterliste(filterInhalt);
request.setAttribute("projektfilterliste",filterInhalt);  // !!! // Preselection 
ArrayList preselectedFilter = new ArrayList();
preselectedFilter.add("One"); nextForm.setProjektfilter(
(String[]) preselectedFilter.toArray(new String[0])); // can multiple 
to


bye

Slobodan Kasterovic


--> -Ursprungliche Nachricht-
--> Von: Jason Vinson [mailto:[EMAIL PROTECTED]]
--> Gesendet: Mittwoch, 12. Februar 2003 13:51
--> An: Struts Users Mailing List
--> Betreff: html:options selected attribute
-->
-->
--> Hi folks,
-->
-->There my be a simple answer to this that I am overlooking, but I 
--> am populating a pull down select, and I can't figure out a good way 
--> to set the selected attribute to the first element.  I am using a 
--> collection (string
--> array) and my jsp has this code:
-->
-->  
-->  size="1">
-->   
--> 
-->   
-->
--> All I want to do is have the first option selected, and it is 
--> defaulting to the last option.
-->
--> any help?
-->
--> TIA,
--> Jason
-->
--> 
--> -
--> 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: AW: html:options selected attribute

2003-02-12 Thread Jason Vinson
I am not exactly following the logic here.  Could you elaborate a little more?

Thanks,
Jason


---Original Message---
From: Slobodan Kasterovic <[EMAIL PROTECTED]>
Sent: 02/12/03 08:24 AM
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: AW: html:options selected attribute

> 
> Hi !

Look my sample:
### Form
private ArrayList projektfilterliste;
private String[] projektfilter;

### JSP





### Action
ArrayList filterInhalt = new ArrayList();
filterInhalt.add(new LabelValueBean(
getAllProjectsDescription(request),
"One"));
filterInhalt.add(new LabelValueBean(
getAllProjectsDescription(request),
"Two"));
nextForm.setProjektfilterliste(filterInhalt);
request.setAttribute("projektfilterliste",filterInhalt);  // !!!
// Preselection
ArrayList preselectedFilter = new ArrayList();
preselectedFilter.add("One");
nextForm.setProjektfilter(
(String[]) preselectedFilter.toArray(new String[0])); // can multiple 
to


bye

Slobodan Kasterovic


--> -Ursprungliche Nachricht-
--> Von: Jason Vinson [mailto:[EMAIL PROTECTED]]
--> Gesendet: Mittwoch, 12. Februar 2003 13:51
--> An: Struts Users Mailing List
--> Betreff: html:options selected attribute
-->
-->
--> Hi folks,
-->
-->There my be a simple answer to this that I am
--> overlooking, but I am populating a pull down select, and I
--> can't figure out a good way to set the selected attribute
--> to the first element.  I am using a collection (string
--> array) and my jsp has this code:
-->
-->  
-->  property="queuesName" size="1">
-->   
--> 
-->   
-->
--> All I want to do is have the first option selected, and it
--> is defaulting to the last option.
-->
--> any help?
-->
--> TIA,
--> Jason
-->
--> 
--> -
--> 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]




AW: html:options selected attribute

2003-02-12 Thread Slobodan Kasterovic
Hi !

Look my sample:
### Form
private ArrayList projektfilterliste;
private String[] projektfilter;

### JSP





### Action
ArrayList filterInhalt = new ArrayList();
filterInhalt.add(new LabelValueBean(
getAllProjectsDescription(request),
"One"));
filterInhalt.add(new LabelValueBean(
getAllProjectsDescription(request),
"Two"));
nextForm.setProjektfilterliste(filterInhalt);
request.setAttribute("projektfilterliste",filterInhalt);  // !!!
// Preselection
ArrayList preselectedFilter = new ArrayList();
preselectedFilter.add("One");
nextForm.setProjektfilter(
(String[]) preselectedFilter.toArray(new String[0])); // can multiple 
to


bye

Slobodan Kasterovic


--> -Ursprungliche Nachricht-
--> Von: Jason Vinson [mailto:[EMAIL PROTECTED]]
--> Gesendet: Mittwoch, 12. Februar 2003 13:51
--> An: Struts Users Mailing List
--> Betreff: html:options selected attribute
-->
-->
--> Hi folks,
-->
-->There my be a simple answer to this that I am
--> overlooking, but I am populating a pull down select, and I
--> can't figure out a good way to set the selected attribute
--> to the first element.  I am using a collection (string
--> array) and my jsp has this code:
-->
-->  
-->  property="queuesName" size="1">
-->   
--> 
-->   
-->
--> All I want to do is have the first option selected, and it
--> is defaulting to the last option.
-->
--> any help?
-->
--> TIA,
--> Jason
-->
--> 
--> -
--> 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:options selected attribute

2003-02-12 Thread Jason Vinson
Hi folks,

   There my be a simple answer to this that I am overlooking, but I am populating a 
pull down select, and I can't figure out a good way to set the selected attribute to 
the first element.  I am using a collection (string array) and my jsp has this code:

 

  

  

All I want to do is have the first option selected, and it is defaulting to the last 
option.

any help?

TIA,
Jason

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




html:options == null after inputForward

2003-02-07 Thread Kersten
Hi,
I have an ActionForm for my JSP with contains one String for the 
"html:select", one String-Array for the options property and one 
String-Array for the optionslabel.
There are getter and setter - Methods for all of these variables.

...
private String pwGruppe_ausgewaehlt = null;
private String pwGruppeID[] = null;
private String pwGruppeLabel[] = null;
...
//I don't want to show the whole getter and setter here...

In my JSP I'm using the following to show a popup-menu:





To show this in my JSP is no problem. But if the ActionForm detect a 
problem (in the validate - methode) in the JSP, it tries to redirect 
to the JSP with the error and the old data from the JSP. But struts seems 
not to be able to catch the data from
the "options". While loading the JSP I get an error that the pwGruppeID is 
null. Is there a way to solve this problem?

ciao Oliver.

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




Re: Need help with html:select and html:options

2003-01-24 Thread Scott Seong
Yes, I do have dyna from-bean defined for "month" and "day" in the
struts-config.xml.


- Original Message -
From: "Suresh Addagalla" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, January 24, 2003 12:03 AM
Subject: RE: Need help with html:select and html:options


> Check if you have month & day properties defined in your form bean.
>
> Suresh
>
> >-Original Message-
> >From: Scott Seong [mailto:[EMAIL PROTECTED]]
> >Sent: Friday, January 24, 2003 11:32 AM
> >To: Struts Users Mailing List
> >Subject: Need help with html:select and html:options
> >
> >
> >Hello,
> >
> >I'm having trouble with html:select and html:options. Basically, I have
> >three select/options pairs in a JSP page, and the result is complaining
> >about "No getter method available for Property month for bean
> >name under
> >org.apache...". Here is the code sample:
> >
> ><%
> >Vector states = new Vector();
> >
> >states.add(new LabelValueBean("Alabama", "AL"));
> >
> >states.add(new LabelValueBean("Alaska", "AK"));
> >
> >...
> >
> >pageContext.setAttribute( "states", states);
> >
> >Vector months = new Vector();
> >
> >months.add(new LabelValueBean("Month", "00"));
> >
> >months.add(new LabelValueBean("January", "01"));
> >
> >...
> >
> >pageContext.setAttribute( "months", months);
> >
> >
> >
> >Vector days = new Vector();
> >
> >days.add(new LabelValueBean("Day", "00"));
> >
> >days.add(new LabelValueBean("1", "01"));
> >
> >...
> >
> >pageContext.setAttribute( "days", days);
> >
> >%>
> >
> >
> >Then, I have html:select and html:options tags as shown below:
> >
> >
> > >labelProperty="label" />
> >
> >
> >
> >
> >
> > >labelProperty="mLabel"
> >/>
> >
> >
> >
> >
> >
> > >labelProperty="dLabel" />
> >
> >
> >
> >
> >
> >The JSP chokes at the 2nd select/options, and I don't know
> >why. If I remove
> >2nd and third pair, the JSP seems to work fine. Can someone help?
> >
> >Thanks,
> >Scott
> >
> >
> >
> >
> >--
> >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]>




RE: Need help with html:select and html:options

2003-01-23 Thread Suresh Addagalla
Check if you have month & day properties defined in your form bean.

Suresh

>-Original Message-
>From: Scott Seong [mailto:[EMAIL PROTECTED]] 
>Sent: Friday, January 24, 2003 11:32 AM
>To: Struts Users Mailing List
>Subject: Need help with html:select and html:options
>
>
>Hello,
>
>I'm having trouble with html:select and html:options. Basically, I have
>three select/options pairs in a JSP page, and the result is complaining
>about "No getter method available for Property month for bean 
>name under
>org.apache...". Here is the code sample:
>
><%
>Vector states = new Vector();
>
>states.add(new LabelValueBean("Alabama", "AL"));
>
>states.add(new LabelValueBean("Alaska", "AK"));
>
>...
>
>pageContext.setAttribute( "states", states);
>
>Vector months = new Vector();
>
>months.add(new LabelValueBean("Month", "00"));
>
>months.add(new LabelValueBean("January", "01"));
>
>...
>
>pageContext.setAttribute( "months", months);
>
>
>
>Vector days = new Vector();
>
>days.add(new LabelValueBean("Day", "00"));
>
>days.add(new LabelValueBean("1", "01"));
>
>...
>
>pageContext.setAttribute( "days", days);
>
>%>
>
>
>Then, I have html:select and html:options tags as shown below:
>
>
>labelProperty="label" />
>
>
>
>
>
>labelProperty="mLabel"
>/>
>
>
>
>
>
>labelProperty="dLabel" />
>
>
>
>
>
>The JSP chokes at the 2nd select/options, and I don't know 
>why. If I remove
>2nd and third pair, the JSP seems to work fine. Can someone help?
>
>Thanks,
>Scott
>
>
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user->[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: <mailto:[EMAIL PROTECTED]>
>


**Disclaimer** 
   
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it 
is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.







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


Need help with html:select and html:options

2003-01-23 Thread Scott Seong
Hello,

I'm having trouble with html:select and html:options. Basically, I have
three select/options pairs in a JSP page, and the result is complaining
about "No getter method available for Property month for bean name under
org.apache...". Here is the code sample:

<%
Vector states = new Vector();

states.add(new LabelValueBean("Alabama", "AL"));

states.add(new LabelValueBean("Alaska", "AK"));

...

pageContext.setAttribute( "states", states);

Vector months = new Vector();

months.add(new LabelValueBean("Month", "00"));

months.add(new LabelValueBean("January", "01"));

...

pageContext.setAttribute( "months", months);



Vector days = new Vector();

days.add(new LabelValueBean("Day", "00"));

days.add(new LabelValueBean("1", "01"));

...

pageContext.setAttribute( "days", days);

%>


Then, I have html:select and html:options tags as shown below:




















The JSP chokes at the 2nd select/options, and I don't know why. If I remove
2nd and third pair, the JSP seems to work fine. Can someone help?

Thanks,
Scott




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




Re: html:options question

2003-01-06 Thread Gus Delgado
Thanks it work!.

-Gus D.
Rick Reumann wrote:


On Monday, January 6, 2003, 2:14:38 PM, Gus wrote:

GD> 
GD> labelProperty="label"/>
GD> 

GD> Example. the options are "Read-only", "Admin", and "Analyst" that's the 
GD> order of the collection, when I edit a user that is Admin, I want the 
GD> drop-down to show with the "Admin" being selected,

GD> How can I accomplish this. Thanks in advanced.

Just make sure "accessType" is set to whatever the value is for
"Admin" in the options. In other words the value fields in
accessTypeList should have "Admin", "Analyst", "Read-only" and
then accessType should also be one of those names as well. (Personally
I usually like to use ints for those values. So that accessType would
be an int value and in the accesTypeList you'd have corresponding
ints for the values and the label would be your String for the title
(Admin, Analyst, etc)). If that doesn't make sense let me know. I
typed this up very quickly:)

 





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: html:options question

2003-01-06 Thread Rick Reumann


On Monday, January 6, 2003, 2:14:38 PM, Gus wrote:

GD> 
GD> labelProperty="label"/>
GD> 

GD> Example. the options are "Read-only", "Admin", and "Analyst" that's the 
GD> order of the collection, when I edit a user that is Admin, I want the 
GD> drop-down to show with the "Admin" being selected,

GD> How can I accomplish this. Thanks in advanced.

Just make sure "accessType" is set to whatever the value is for
"Admin" in the options. In other words the value fields in
accessTypeList should have "Admin", "Analyst", "Read-only" and
then accessType should also be one of those names as well. (Personally
I usually like to use ints for those values. So that accessType would
be an int value and in the accesTypeList you'd have corresponding
ints for the values and the label would be your String for the title
(Admin, Analyst, etc)). If that doesn't make sense let me know. I
typed this up very quickly:)

-- 

Rick
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: html:options question

2003-01-06 Thread Heather Buch
I did something similar, with optionsCollection (which I like).

Here is my code:


 


for optionsCollection, my "property" is the name of my bean, and I think 
you have to pluralize it (example availablecourselabel --> 
availablecourselabels) to indicate that it's a collection. The "label" 
and "value" attributes just
refer to properties of my AvailableCourseLabel bean (get 
availableCourseconcatenated, and getAvailablecourseinstanceid). I hope 
this helps  a little.

Best,

Heather Buch


Gus Delgado wrote:

I populate an html:option tag with a collection. I use the html:option 
to create a new user in my system and to edit a user in my system.


  


When doing an edit I want the html:option to be shown with the current 
accessType of the user I'm editing.

Example. the options are "Read-only", "Admin", and "Analyst" that's 
the order of the collection, when I edit a user that is Admin, I want 
the drop-down to show with the "Admin" being selected,

How can I accomplish this. Thanks in advanced.




--
To unsubscribe, e-mail:   

For additional commands, e-mail: 






--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




html:options question

2003-01-06 Thread Gus Delgado
I populate an html:option tag with a collection. I use the html:option 
to create a new user in my system and to edit a user in my system.


  


When doing an edit I want the html:option to be shown with the current 
accessType of the user I'm editing.

Example. the options are "Read-only", "Admin", and "Analyst" that's the 
order of the collection, when I edit a user that is Admin, I want the 
drop-down to show with the "Admin" being selected,

How can I accomplish this. Thanks in advanced.




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



Re: html:select and html:options

2003-01-03 Thread Jose Luis
RE: html:select and html:optionsnow i have the page www.husted.com/struts/, please 
could you guideme where exactly or moreless?

Thanks
p.s happy new year
  - Original Message - 
  From: Sterin, Ilya 
  To: 'Jose Luis ' ; 'Struts Users Mailing List ' 
  Sent: Friday, January 03, 2003 7:08 PM
  Subject: RE: html:select and html:options


  You can use the LabelValueBean class for that, see www.husted.com for examples. 

  Ilya 

  -Original Message- 
  From: Jose Luis 
  To: Struts Users Mailing List 
  Sent: 1/3/03 11:04 AM 
  Subject: html:select and html:options 

  hi everyone, i have a page whit the following code: 

   

   

   

  where sectorCompany is an ArrayList that i built prior to view the jsp. 
  My problem is: 

  what i really need is to pass to the result action the value which 
  represents the labels that contains the SectorCompany ArrayList, so, How 
  i can build a select that shows labels but that also stores the id 
  (longs representing registers in a RDBMS) to pass this id? 



  Thank everybody in advance. 

  ps. If someOne knows a subject in the mailing list which already solves 
  this plese redirectme to it. 

  José Luis 







RE: html:select and html:options

2003-01-03 Thread Sterin, Ilya
You can use the LabelValueBean class for that, see www.husted.com for
examples.

Ilya

-Original Message-
From: Jose Luis
To: Struts Users Mailing List
Sent: 1/3/03 11:04 AM
Subject: html:select and html:options

hi everyone, i have a page whit the following code:







where sectorCompany is an ArrayList that i built prior to view the jsp.
My problem is:

what i really need is to pass to the result action the value which
represents the labels that contains the SectorCompany ArrayList, so, How
i can build a select that shows labels but that also stores the id
(longs representing registers in a RDBMS) to pass this id?


Thank everybody in advance.

ps. If someOne knows a subject in the mailing list which already solves
this plese redirectme to it.

José Luis






html:select and html:options

2003-01-03 Thread Jose Luis
hi everyone, i have a page whit the following code:







where sectorCompany is an ArrayList that i built prior to view the jsp. My problem is:

what i really need is to pass to the result action the value which represents the 
labels that contains the SectorCompany ArrayList, so, How i can build a select that 
shows labels but that also stores the id (longs representing registers in a RDBMS) to 
pass this id?


Thank everybody in advance.

ps. If someOne knows a subject in the mailing list which already solves this plese 
redirectme to it.

José Luis






RE: Ye olde html:options tag?

2003-01-02 Thread Siggelkow, Bill
Try using the 'collection' attribute instead of 'name' ... otherwise, the tag 
interprets the name/property combination as identifying the collection.



\-Original Message-
From: Michael P [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 02, 2003 4:17 PM
To: [EMAIL PROTECTED]
Subject: Ye olde html:options tag?


I apologize for this basic question, but I'm new to struts and Java web
programming in general, and I really can't get the  tag to
work...

The error I'm getting, specifically, is:
  javax.servlet.jsp.JspException: No getter method available for property
email for bean under name users

My JSP defines a collection like this:
  

Then tries to use it like this:
  

  

My understanding of this is that it will call getUsers() on the
adminLoginForm bean to get a Collection, and then on each item within the
collection, will call getEmail() to retrieve the option property and
label.

Do I need to define a bean somewhere (in some XML file?) for the user
objects contained within the collection or something?  The collection
contains UserView objects that /do/, in fact, have a getEmail() method, so
I can't figure out why this won't work.

I have defined a form-bean for the login form:
  

  

Thanks for any help you can offer...

--
To unsubscribe, e-mail:   <mailto:[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]>




Ye olde html:options tag?

2003-01-02 Thread Michael P
I apologize for this basic question, but I'm new to struts and Java web
programming in general, and I really can't get the  tag to
work...

The error I'm getting, specifically, is:
  javax.servlet.jsp.JspException: No getter method available for property
email for bean under name users

My JSP defines a collection like this:
  

Then tries to use it like this:
  

  

My understanding of this is that it will call getUsers() on the
adminLoginForm bean to get a Collection, and then on each item within the
collection, will call getEmail() to retrieve the option property and
label.

Do I need to define a bean somewhere (in some XML file?) for the user
objects contained within the collection or something?  The collection
contains UserView objects that /do/, in fact, have a getEmail() method, so
I can't figure out why this won't work.

I have defined a form-bean for the login form:
  

  

Thanks for any help you can offer...

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: html:options encoded property

2002-12-10 Thread Kocur, David
Correct me if I'm wrong, but aren't the "e; entries unnecessary?
Couldn't you just remove them?

-Original Message-
From: Nathalie Foures [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 9:52 AM
To: [EMAIL PROTECTED]
Subject: html:options encoded property


Hi!

I wrote a JSP page with the following lines :
...

   

...

where name and url are the String attributes of a bean named Proxy. This
code displays a box, with a list of "names". When I select a name, this
returns the corresponding "url". The problem is that the url is written
with escaped characters, BUT displayed with unescaped characters.

For example, the bean Proxy has the following url linked with the name
"something" : "http://myhome/hello&action="doSomething"";.
But, the resulting html page looks like this :
...

   http://myhome/hello&action="doSomething"";>something
...

The " character is translated. As a result the option value becomes
"http://hello&action="; : it stops at the first ":" character and doesn't
take the whole url! doSomething is forgotten...

I looked for attributes like "filter" for the html:options tag, but I
didn't succeed...Has someone an idea to help me!

Thank you!

Nathalie

--
To unsubscribe, e-mail:
<mailto:[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:options encoded property

2002-12-09 Thread Nathalie Foures
Hi!

I wrote a JSP page with the following lines :
...

   

...

where name and url are the String attributes of a bean named Proxy. This
code displays a box, with a list of "names". When I select a name, this
returns the corresponding "url". The problem is that the url is written
with escaped characters, BUT displayed with unescaped characters.

For example, the bean Proxy has the following url linked with the name
"something" : "http://myhome/hello&action="doSomething"";.
But, the resulting html page looks like this :
...

   http://myhome/hello&action="doSomething"";>something
...

The " character is translated. As a result the option value becomes
"http://hello&action="; : it stops at the first ":" character and doesn't
take the whole url! doSomething is forgotten...

I looked for attributes like "filter" for the html:options tag, but I
didn't succeed...Has someone an idea to help me!

Thank you!

Nathalie

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




RE: displaying an aggregated label for html:options

2002-11-04 Thread Hookom, Jacob John
Add a method to your bean that says "getFullName()" which concats the first name and 
last name.

-Original Message- 
From: Allison Sugar [mailto:allison.sugar@;datastay.com] 
Sent: Mon 11/4/2002 3:16 PM 
To: [EMAIL PROTECTED] 
Cc: 
Subject: displaying an aggregated label for html:options



Hello

I want to display an aggregated label in a combo box but don't know if it's
possible in struts.  Here's the example:

Currently I have -

  

  

which works fine.  But I want to display "lastName, firstName".  Does anyone
know how to do this?

Thanks in advance,
Allison


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




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


displaying an aggregated label for html:options

2002-11-04 Thread Allison Sugar
Hello

I want to display an aggregated label in a combo box but don't know if it's
possible in struts.  Here's the example:

Currently I have -

  

  

which works fine.  But I want to display "lastName, firstName".  Does anyone
know how to do this?

Thanks in advance,
Allison


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: html:options ordering

2002-10-30 Thread Sven Bischoff
Dennis Muhlestein wrote:


I have a hashtable with key/value that get displayed by an html:options
tag. 
Works ok, but they are ordered in reverse order of the id.  That isn't
any performance problem, but it looks a little strange to the user.

For instance, what if you wanted the options in alphabetical order?  In
my case, I need them ordered by the key for each options.


if you're using jdk1.4, try java.util.LinkedHashMap which preserves 
insertion-order.


-Dennis


Sven


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




Re: html:options ordering

2002-10-30 Thread Dennis Muhlestein
Thanks for the comments.  Seems to make more sense not to have 
any ordering functionality in the html:options tag anyway.

On Wed, 2002-10-30 at 10:40, Dennis Muhlestein wrote:
> I have a hashtable with key/value that get displayed by an html:options
> tag.  
> 
> Works ok, but they are ordered in reverse order of the id.  That isn't
> any performance problem, but it looks a little strange to the user.
> 
> For instance, what if you wanted the options in alphabetical order?  In
> my case, I need them ordered by the key for each options.
> 
> Any Suggestions?
> TIA
> -Dennis
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>
> 



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




RE: html:options ordering

2002-10-30 Thread Karr, David
> -Original Message-
> From: Dennis Muhlestein [mailto:dennis@;zserve.com]
> Sent: Wednesday, October 30, 2002 9:41 AM
> 
> I have a hashtable with key/value that get displayed by an 
> html:options
> tag.  
> 
> Works ok, but they are ordered in reverse order of the id.  That isn't
> any performance problem, but it looks a little strange to the user.
> 
> For instance, what if you wanted the options in alphabetical 
> order?  In
> my case, I need them ordered by the key for each options.

I would look into the Commons Collections library.  It appears you could use
either the DoubleOrderedMap or the SequencedHashMap.  I haven't personally
used either of these.

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




Re: html:options ordering

2002-10-30 Thread Danny Mui
Hash Tables don't guarantee order when you pull them out enmasse. 
probably best bet is to store it in a list and sort accordingly 
(Collections.sort).


Dennis Muhlestein wrote:

I have a hashtable with key/value that get displayed by an html:options
tag.  

Works ok, but they are ordered in reverse order of the id.  That isn't
any performance problem, but it looks a little strange to the user.

For instance, what if you wanted the options in alphabetical order?  In
my case, I need them ordered by the key for each options.

Any Suggestions?
TIA
-Dennis


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





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




html:options ordering

2002-10-30 Thread Dennis Muhlestein
I have a hashtable with key/value that get displayed by an html:options
tag.  

Works ok, but they are ordered in reverse order of the id.  That isn't
any performance problem, but it looks a little strange to the user.

For instance, what if you wanted the options in alphabetical order?  In
my case, I need them ordered by the key for each options.

Any Suggestions?
TIA
-Dennis


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




RE: html:options

2002-09-30 Thread Sri Sankaran

The first technique couples your presentation with your business logic more closely 
than does the latter.  So, my preference would be using the .

You can maintain the collection that makes up the options in the form bean for the 
page.  Initialization must be handled via the associated action class.

Sri

-Original Message-
From: Doug Dates [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 29, 2002 8:35 PM
To: Struts Users Mailing List
Subject: html:options


I want to display a dropdown list. The list items are "By First Name", "By Last Name", 
"By Date". I think I can do it by the following way:


 By First Name 
 By Last Name 
 By Date  

Is there any disadvantages to use above approach compared with using 
? If I use  instead of using above individual 
,as following:


   

where should I set myArrayList? in init method of my servlet class, or in my action 
form bean, or somewhere else? I am not quite understand it. Could some one please help 
me?

Thank you

Doug



__ 

Post your free ad now! http://personals.yahoo.ca


--
To unsubscribe, e-mail:   <mailto:[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:options

2002-09-29 Thread Doug Dates

I want to display a dropdown list. The list items are "By First Name", "By
Last Name", "By Date". I think I can do it by the following way:


 By First Name 
 By Last Name 
 By Date 


Is there any disadvantages to use above approach compared with using
? If I use  instead of using above
individual ,as following:


  


where should I set myArrayList? in init method of my servlet class, or in my
action form bean, or somewhere else? I am not quite understand it. Could
some one please help me?

Thank you

Doug



__ 
Post your free ad now! http://personals.yahoo.ca

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: AAAARGH! SOMEONE! How do I set the default selection when I'm using html:options?

2002-09-20 Thread Michael Lee

I figured out what the problem was.
Struts auto sets the default value in an html:select to whatever the
property is in the form bean. Someone said this earlier (thank you).
My problem was, I was getting this value from the database. Our database is
oracle and the fields in question were of type char[x]. These are fixed
length fields that are padded with spaces on a result set! So a state of
"GA" is not equal to "GA "!!
Thanks for everyone's help on this. This was not a struts issue (usually
isn't).
thanks,
Mike

- Original Message -
From: "Eddie Bush" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, September 19, 2002 9:43 AM
Subject: Re: RGH! SOMEONE! How do I set the default selection when I'm
using html:options?


> Yeah, actually this might be your best approach.  Mine would depend on
> Struts.  This approach would be totally independent of Struts.  If
> you're (wasn't it spec 2.3 that brought us these listeners?) on an older
> spec, using the plugin may well be the way to go though.
>
> Robert Taylor wrote:
>
> >javax.servlet.ServletContextListener @since Servlet2.2 spec acts a
> >bootstrap.
> >Prior to Servlet2.2 spec, try a bootstrap  servlet.
> >
> >A quick scan of the mailing list archives and .
> >http://www.mail-archive.com/struts-user@jakarta.apache.org/msg38242.html
> >
> >should help.
> >
> >robert
> >
>
> --
> Eddie Bush
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[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]>




  1   2   3   >