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: how to set selectedIndex at html:select

2004-02-27 Thread Mark Lowe
set the value of the form property that you wish to select.

On 27 Feb 2004, at 17:40, Daniel wrote:

How can change the "selectedIndex" of dropdown values



obrigado
Daniel S.


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


how to set selectedIndex at html:select

2004-02-27 Thread Daniel
How can change the "selectedIndex" of dropdown values



obrigado
Daniel S.

RE: html:select

2004-02-17 Thread Wendy Smoak
> From: Gonzalez, Sergio Eduardo [mailto:[EMAIL PROTECTED] 
> I need to send the value and text dispayed  to  the server 

Now I have to ask, why?  Presumably you're generating the selections
from something, maybe a Map?  All you need is the value, they key, and
you can pull the value out of the Map without having it sent from the
browser.  

There are ways, you could use JavaScript to set a hidden form field, or
just concatenate the value & text:

  Some Text

and then parse it when it arrives at the server.  (For the record,
that's not a recommendation, just an option!)

But it would help if you'd post the code from the JSP that you're using.
Right now I don't know if you're using  or if you're
'manually' writing out the  tags.

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

2004-02-17 Thread Nick Heudecker
Yeah, what I do is just use a LabelValueBean form property to pass the value and
txt back to the server.  I set the text property using the onBlur javascript event.  

On 2004-Feb-17 17:02, Gonzalez, Sergio Eduardo wrote:
> I need to send the value and text dispayed  to  the server 
> 
> -Mensaje original-
> De: Wendy Smoak [mailto:[EMAIL PROTECTED] 
> Enviado el: martes, 17 de febrero de 2004 17:39
> Para: Struts Users Mailing List
> Asunto: RE: html:select
> 
> > From: Gonzalez, Sergio Eduardo [mailto:[EMAIL PROTECTED] 
> > How can I do to send the value displayed ? 
> 
> Can you post the code from the JSP the way it is now?  Someone can
> probably help you change it so that it does what you want.
> 
> -- 
> Wendy Smoak
> Application Systems Analyst, Sr.
> ASU IA Information Resources Management 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> Aquest missatge electronic pot  contenir informacio confidencial o privilegiada.
> Si voste no es el destinatari del  missatge, o l'ha rebut per error, si us plau
> notifiqui-ho al remitent i destrueixi el missatge amb tot el seu contingut.
> Esta completament  prohibida  qualsevol  copia, us o distribucio no autoritzada
> del contingut d'aquest missatge electronic.
> 
> Este mensaje electronico puede contener informacion confidencial o privilegiada.
> Si usted  no es  el destinatario de este mensaje o lo ha recibido por error, por
> favor notifiquelo al remitente y destruya el mensaje con todo su contenido.
> Queda  expresamente  prohibida  cualquier  copia, utilizacion o  distribucion no
> autorizada del contenido de este mensaje electronico.
> 
> This e-mail may contain confidential and/or privileged information.
> If you  are  not the  intended recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy this e-mail.
> Any  unauthorized  copying,  disclosure  or distribution of the material in this
> e-mail is strictly forbidden.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Nick Heudecker
System Mobile, Inc.
Email: [EMAIL PROTECTED]
Phone: 734.604.9192
Web: http://www.systemmobile.com

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



RE: html:select

2004-02-17 Thread Paul McCulloch
Surely your application is responsible for creating the options in the first
place? Why not create a map of the key,value pairs at that time & refer to
it later?

Paul

> -Original Message-
> From: Gonzalez, Sergio Eduardo [mailto:[EMAIL PROTECTED]
> Sent: 17 February 2004 16:13
> To: Struts Users Mailing List
> Subject: html:select 
> 
> 
> 
> Hello . 
> I have to get the description  from a html:select  example  in html 
> 
> 
> z
> 
> 
> how can I do to get the "z" value ???  ( using struts ) 
> 
> 
> thamks .. 
> 
> serge
> 
> 
> --
> --
> Aquest missatge electronic pot  contenir informacio 
> confidencial o privilegiada.
> Si voste no es el destinatari del  missatge, o l'ha rebut per 
> error, si us plau
> notifiqui-ho al remitent i destrueixi el missatge amb tot el 
> seu contingut.
> Esta completament  prohibida  qualsevol  copia, us o 
> distribucio no autoritzada
> del contingut d'aquest missatge electronic.
> --
> --
> Este mensaje electronico puede contener informacion 
> confidencial o privilegiada.
> Si usted  no es  el destinatario de este mensaje o lo ha 
> recibido por error, por
> favor notifiquelo al remitente y destruya el mensaje con todo 
> su contenido.
> Queda  expresamente  prohibida  cualquier  copia, utilizacion 
> o  distribucion no
> autorizada del contenido de este mensaje electronico.
> --
> --
> This e-mail may contain confidential and/or privileged information.
> If you  are  not the  intended recipient (or have received 
> this e-mail in error)
> please notify the sender immediately and destroy this e-mail.
> Any  unauthorized  copying,  disclosure  or distribution of 
> the material in this
> e-mail is strictly forbidden.
> --
> --
> 
> -
> 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]



Re: html:select

2004-02-17 Thread Geeta Ramani
Well, I guess that's what Wendy was suggesting in the first place: make the value
and the text the same, that way sending one is tatamount to sending both.. The other
option is to use a hidden field and javascript (onSelect fill hidden field kind of
thing along with the form.blah-blah[selectedIndex].value that another person
suggested earlier..)

Geeta

"Gonzalez, Sergio Eduardo" wrote:

> I need to send the value and text dispayed  to  the server


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



RE: html:select

2004-02-17 Thread Gonzalez, Sergio Eduardo
I need to send the value and text dispayed  to  the server 

-Mensaje original-
De: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 17 de febrero de 2004 17:39
Para: Struts Users Mailing List
Asunto: RE: html:select

> From: Gonzalez, Sergio Eduardo [mailto:[EMAIL PROTECTED] 
> How can I do to send the value displayed ? 

Can you post the code from the JSP the way it is now?  Someone can
probably help you change it so that it does what you want.

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

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




Aquest missatge electronic pot  contenir informacio confidencial o privilegiada.
Si voste no es el destinatari del  missatge, o l'ha rebut per error, si us plau
notifiqui-ho al remitent i destrueixi el missatge amb tot el seu contingut.
Esta completament  prohibida  qualsevol  copia, us o distribucio no autoritzada
del contingut d'aquest missatge electronic.

Este mensaje electronico puede contener informacion confidencial o privilegiada.
Si usted  no es  el destinatario de este mensaje o lo ha recibido por error, por
favor notifiquelo al remitente y destruya el mensaje con todo su contenido.
Queda  expresamente  prohibida  cualquier  copia, utilizacion o  distribucion no
autorizada del contenido de este mensaje electronico.

This e-mail may contain confidential and/or privileged information.
If you  are  not the  intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any  unauthorized  copying,  disclosure  or distribution of the material in this
e-mail is strictly forbidden.


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



RE: html:select

2004-02-17 Thread Wendy Smoak
> From: Gonzalez, Sergio Eduardo [mailto:[EMAIL PROTECTED] 
> How can I do to send the value displayed ? 

Can you post the code from the JSP the way it is now?  Someone can
probably help you change it so that it does what you want.

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

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



RV: html:select

2004-02-17 Thread Gonzalez, Sergio Eduardo



Ok . 
How can I do to send the value displayed ? 


-Mensaje original-
De: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 17 de febrero de 2004 17:25
Para: Struts Users Mailing List
Asunto: RE: html:select

> From: Gonzalez, Sergio Eduardo [mailto:[EMAIL PROTECTED] 
> I have to get the description  from a html:select  example  in html 
> 
> z
> 
> how can I do to get the "z" value ???  ( using struts ) 

Make the tag look like this instead:

  z


It's the 'value' that will get sent to the server, not the displayed
text.

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

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




Aquest missatge electronic pot  contenir informacio confidencial o privilegiada.
Si voste no es el destinatari del  missatge, o l'ha rebut per error, si us plau
notifiqui-ho al remitent i destrueixi el missatge amb tot el seu contingut.
Esta completament  prohibida  qualsevol  copia, us o distribucio no autoritzada
del contingut d'aquest missatge electronic.

Este mensaje electronico puede contener informacion confidencial o privilegiada.
Si usted  no es  el destinatario de este mensaje o lo ha recibido por error, por
favor notifiquelo al remitente y destruya el mensaje con todo su contenido.
Queda  expresamente  prohibida  cualquier  copia, utilizacion o  distribucion no
autorizada del contenido de este mensaje electronico.

This e-mail may contain confidential and/or privileged information.
If you  are  not the  intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any  unauthorized  copying,  disclosure  or distribution of the material in this
e-mail is strictly forbidden.


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



Re: html:select

2004-02-17 Thread Nick Heudecker
form.xx.options[form.xx.selectedIndex].text;

On 2004-Feb-17 17:02, Gonzalez, Sergio Eduardo wrote:
> 
> Hello . 
> I have to get the description  from a html:select  example  in html 
> 
> 
> z
> 
> 
> how can I do to get the "z" value ???  ( using struts ) 
> 

-- 
Nick Heudecker
System Mobile, Inc.
Email: [EMAIL PROTECTED]
Web: http://www.systemmobile.com

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



RE: html:select

2004-02-17 Thread Wendy Smoak
> From: Gonzalez, Sergio Eduardo [mailto:[EMAIL PROTECTED] 
> I have to get the description  from a html:select  example  in html 
> 
> z
> 
> how can I do to get the "z" value ???  ( using struts ) 

Make the tag look like this instead:

  z


It's the 'value' that will get sent to the server, not the displayed
text.

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

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



html:select

2004-02-17 Thread Gonzalez, Sergio Eduardo

Hello . 
I have to get the description  from a html:select  example  in html 


z


how can I do to get the "z" value ???  ( using struts ) 


thamks .. 

serge



Aquest missatge electronic pot  contenir informacio confidencial o privilegiada.
Si voste no es el destinatari del  missatge, o l'ha rebut per error, si us plau
notifiqui-ho al remitent i destrueixi el missatge amb tot el seu contingut.
Esta completament  prohibida  qualsevol  copia, us o distribucio no autoritzada
del contingut d'aquest missatge electronic.

Este mensaje electronico puede contener informacion confidencial o privilegiada.
Si usted  no es  el destinatario de este mensaje o lo ha recibido por error, por
favor notifiquelo al remitente y destruya el mensaje con todo su contenido.
Queda  expresamente  prohibida  cualquier  copia, utilizacion o  distribucion no
autorizada del contenido de este mensaje electronico.

This e-mail may contain confidential and/or privileged information.
If you  are  not the  intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any  unauthorized  copying,  disclosure  or distribution of the material in this
e-mail is strictly forbidden.


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



Re: Using a java.util.List with a HTML:SELECT

2004-02-13 Thread sean jones

i am aware of this option but DAO only returns a list of Strings and i prefer 
that to a list of beans.  The reason is i am more interested in the role name 
than the role_id.  

I plan to delete all the roles then put them back with a batchupdate.

This allows the user to selected all the roles to get rid of in one shot -vs- 
one at a time. 

Also roles cannot be deleted if they are in use (USER_ROLES - {user_id, 
role_id})

Maybe i am wrong, and should change the DAO to return a List 
of  LabelValueBeans




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



Re: Using a java.util.List with a HTML:SELECT

2004-02-13 Thread Niall Pemberton
The  and  tags expect a
collection of beans - not String values.

If you put the values in beans then you it goes something like


 



So you store the list of roles in your action form under the property
"roleList" and that contains a List of beans which
have roleName and roleId properties.

Niall

- Original Message - 
From: "sean jones" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 13, 2004 5:00 PM
Subject: Using a java.util.List with a HTML:SELECT


>
> is it possible to use a java.util.List object with an HTML:SELECT control.
>
> import java.util.List;
> import java.util.ArrayList;
>
> public final class Roles extends Ojbect {
> public Roles() {}
> public static List getRoles() {
>  List r = new ArrayList();
>  r.add("ADMIN");
>  r.add("SUPERADMIN");
>  r.add("CLERK");
>  r.add("SUPERCLERK");
>  return r;
> }
> }
>
> in jsp
>
> i would use
> 
> 
>
> 
> 
> 
> 
>
>
>
> -
> 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: Using a java.util.List with a HTML:SELECT

2004-02-13 Thread Oliver Thiel
Hi, 

You can try something like this:

1. Instead of return r ---> request.setAttribute("formprop",r);

2. In your JSP 


  ">
 
   

If you want your property|value pair to be different, 
you should use a HashMap.


Oliver



> 
> is it possible to use a java.util.List object with an HTML:SELECT control.
> 
> import java.util.List;
> import java.util.ArrayList;
> 
> public final class Roles extends Ojbect {
> public Roles() {}
> public static List getRoles() {
>  List r = new ArrayList();
>  r.add("ADMIN");
>  r.add("SUPERADMIN");
>  r.add("CLERK");
>  r.add("SUPERCLERK");
>  return r;
> }
> }
> 
> in jsp 
> 
> i would use
> 
> 
> 
> 
>  
> 
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel +++


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



Using a java.util.List with a HTML:SELECT

2004-02-13 Thread sean jones

is it possible to use a java.util.List object with an HTML:SELECT control.

import java.util.List;
import java.util.ArrayList;

public final class Roles extends Ojbect {
public Roles() {}
public static List getRoles() {
 List r = new ArrayList();
 r.add("ADMIN");
 r.add("SUPERADMIN");
 r.add("CLERK");
 r.add("SUPERCLERK");
 return r;
}
}

in jsp 

i would use









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



html:select with multiple selections

2004-02-04 Thread Otto, Frank
Hi,
 
I have a html:select tag with multiple selections. Fist I select two elements. After 
this I deselect this elements, but If I come back to this site, the two elements will 
be selected again. I don't know why.
 
I think the property for the select box is not set by populating the form, so it are 
the old values.
 
I use session as sope.
 
Has anyone an idea?
 
 
Regards,
 
Frank 


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
 


RE: html:select multiple="true" question

2004-01-21 Thread Mathew, Manoj
I used the same property name for select and Options tag..it worked in a dynaaction 
form.

Thank-you,
Manoj Mathew
GIS 515-362-0539


-Original Message-
From: Morten [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 6:00 AM
To: [EMAIL PROTECTED]
Subject: html:select multiple="true" question


Hi.

I have a bean stored in page scope with id "active". It returns
a String[] on getIds() and getLabels(). I use the following to render
a multiple select box:


   


What's wrong with this approach? I wish to have all elements
selected. All elements show and have the proper value/label,
but they do not get selected.

Can anyone please tell me how the property attribute of the select
tag determines what options get set as selected? Thanks.

Br,

Morten




-
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 multiple="true" question

2004-01-21 Thread Morten
Hi.

I have a bean stored in page scope with id "active". It returns
a String[] on getIds() and getLabels(). I use the following to render
a multiple select box:

  

What's wrong with this approach? I wish to have all elements
selected. All elements show and have the proper value/label,
but they do not get selected.
Can anyone please tell me how the property attribute of the select
tag determines what options get set as selected? Thanks.
Br,

Morten



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


Re: html:select example

2003-12-30 Thread Carl
some working examples, but I'm not expert ;-)


normal
gras
italique
gras-italique






For the second one, It seems that there is other way to do the same, 
using html:options or html:optioncollection, but I've never used it.

Good luck

Carl

Otávio Augusto wrote:

Would someone show me a very simple example of the use of an html:select tag? I did not understand its use.

I'd appreciate any simple example.

Thanks 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:select example

2003-12-30 Thread Steve Raeburn
I have some examples of Struts tags, including html:select, at
http://www.ninsky.com/struts

Various other examples are listed at
http://struts.sourceforge.net/community/examples.html

Steve

Sorry if this is a duplicate message, sent the first one from the wrong
address :-(

> -Original Message-
> From: Otavio Augusto [mailto:[EMAIL PROTECTED]
> Sent: December 30, 2003 8:41 AM
> To: [EMAIL PROTECTED]
> Subject: html:select example
>
>
> Would someone show me a very simple example of the use of an
> html:select tag? I did not understand its use.
>
> I'd appreciate any simple example.
>
> Thanks 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:select example

2003-12-30 Thread Daniel Lipofsky
> Would someone show me a very simple example of the use of an 
> html:select tag? I did not understand its use.
> 
> I'd appreciate any simple example.


  
  


The select tag can contain a list of option tags, or an options or
optionsCollection tag or any combination.  Here I use 1 option tag to
provide a blank default and a optionsCollection tag with a collection
of LabelValueBean objects to provide the rest of the list (the fact
that the collection contains LabelValueBean objects makes the syntax
much simplier as you don't have to specify the label or value
properties.  The value that matches the value of "someProperty"
will automatically be selected.

- Dan

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



html:select example

2003-12-30 Thread Otávio Augusto
Would someone show me a very simple example of the use of an html:select tag? I did 
not understand its use.

I'd appreciate any simple example.

Thanks a lot.

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



RE: html:select default value problem

2003-12-18 Thread Robert Taylor
Try this:


 0 - INACTIVE
 1 - ACTIVE


The regular HTML  element doesn't "communicate" with 
Struts. You need to use 

robert

> -Original Message-
> From: Keith C. Klopfer [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 18, 2003 6:12 AM
> To: [EMAIL PROTECTED]
> Subject: html:select default value problem
> 
> 
> Hi,
> 
> I know this has been talked about before, and I'm pretty sure I 
> understand the concept, but I don't know why this is not
> working.  The default option for an html:select is not being 
> displayed.  I have an ActionForm in request scope called
> "BusinessForm" that is populated.  The "status" property has a 
> value of "1" as verified by sticking in a bean:write, but
> the select list shows the value="0" option as the default item 
> when I load the page.  I have twelve other html elements on
> the page, and they all show the correct defaults, except for this 
> html:select.  Am I not seeing something in the code
> below...
> 
> thanks...keith
> 
> ---
> 
>  type="BusinessForm">
> 
> 
> 
> 
> 
> 0 - INACTIVE
> 1 - ACTIVE
> 
> 
> ...
> 
>  
> -
> 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 default value problem

2003-12-18 Thread Keith C. Klopfer
Hi,

I know this has been talked about before, and I'm pretty sure I understand the 
concept, but I don't know why this is not
working.  The default option for an html:select is not being displayed.  I have an 
ActionForm in request scope called
"BusinessForm" that is populated.  The "status" property has a value of "1" as 
verified by sticking in a bean:write, but
the select list shows the value="0" option as the default item when I load the page.  
I have twelve other html elements on
the page, and they all show the correct defaults, except for this html:select.  Am I 
not seeing something in the code
below...

thanks...keith

---







0 - INACTIVE
1 - ACTIVE


...



RES: html:select tag or logic:iterate

2003-12-15 Thread Tiago Henrique Costa Rodrigues Alves
Inside the struts-exercise-taglib.war that comes with struts 1.1 you will
find a pratical example to solve your problem...

You should not do a logic:iterate inside html:select, insteat of
logic:iterate use the option:optionsCollection and pass your collection to
it...

look the jsp example 

  Vector options = new Vector();
  options.add(new LabelValueBean("Label 0", "Value 0"));
  options.add(new LabelValueBean("Label 1", "Value 1"));
  options.add(new LabelValueBean("Label 2", "Value 2"));
  options.add(new LabelValueBean("Label 3", "Value 3"));
  options.add(new LabelValueBean("Label 4", "Value 4"));
  options.add(new LabelValueBean("Label 5", "Value 5"));
  options.add(new LabelValueBean("Label 6", "Value 6"));
  options.add(new LabelValueBean("Label 7", "Value 7"));
  options.add(new LabelValueBean("Label 8", "Value 8"));
  options.add(new LabelValueBean("Label 9", "Value 9"));
  pageContext.setAttribute("options", options);


  

  

or 



  

  


Tiago Henrique C. R. Alves

-Mensagem original-
De: Marco Mistroni [mailto:[EMAIL PROTECTED]
Enviada em: segunda-feira, 15 de dezembro de 2003 10:00
Para: 'Struts Users Mailing List'
Assunto: html:select tag or logic:iterate


Hi all,
I am quite new to struts tag library and I need an advice.
In the HttpSession I have an object of type Collection, which stores
a list of MyObject.
MyOBject has two properties, description and id.

Out of this Collection of MyObject I must generate a selectable list
Which displays MyObject names,  (wity MyObject.id as value)

I have tried to embed the html:select inside a logic:iterate, but my
editor (websphere studio)complaints for following code


  " id="container">
  ">


  


the error is  'Attribute container has no value'

anyone has a suggestion on how to solve my problem?

Fact is that the Collection is stored in the session, not in a
JavaBean..

Thanks and regards
marco




-
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 tag or logic:iterate

2003-12-15 Thread Firat TIRYAKI
try this,







F.

- Original Message - 
From: "Marco Mistroni" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Monday, December 15, 2003 3:00 PM
Subject: html:select tag or logic:iterate


> Hi all,
> I am quite new to struts tag library and I need an advice.
> In the HttpSession I have an object of type Collection, which stores
> a list of MyObject.
> MyOBject has two properties, description and id.
>
> Out of this Collection of MyObject I must generate a selectable list
> Which displays MyObject names,  (wity MyObject.id as value)
>
> I have tried to embed the html:select inside a logic:iterate, but my
> editor (websphere studio)complaints for following code
>
> 
>   " id="container">
>property="type"/>">
>  property="description"/>
> 
>   
> 
>
> the error is  'Attribute container has no value'
>
> anyone has a suggestion on how to solve my problem?
>
> Fact is that the Collection is stored in the session, not in a
> JavaBean..
>
> Thanks and regards
> marco
>
>
>
>
> -
> 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 tag or logic:iterate

2003-12-15 Thread Marco Mistroni
Hi all,
I am quite new to struts tag library and I need an advice.
In the HttpSession I have an object of type Collection, which stores
a list of MyObject.
MyOBject has two properties, description and id.

Out of this Collection of MyObject I must generate a selectable list
Which displays MyObject names,  (wity MyObject.id as value)

I have tried to embed the html:select inside a logic:iterate, but my
editor (websphere studio)complaints for following code


  " id="container">
  ">


  


the error is  'Attribute container has no value'

anyone has a suggestion on how to solve my problem?

Fact is that the Collection is stored in the session, not in a
JavaBean..

Thanks and regards
marco




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



RE: Problem with html:select tag calling set method in form

2003-11-04 Thread damian_bradicich




We have a couple of pages which use the same form (advanced and basic
search), so the reset method can't be used to clear the fields (as you
would for any normal pages).

I was hoping that the setter would be called to reset the field, so I am
putting javascript in to null out the field in the form so that the changes
will be saved properly
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Tel: (603) 471-4712
Email: [EMAIL PROTECTED]
Web Site: www.stchome.com
"Advancing Public Health Through Information Technology"
___


|-+>
| | |
| ||
| |   11/04/2003 11:09 AM  |
| |   Please respond to|
| |   "Struts Users Mailing|
| |   List"|
| ||
|-+>
  
>--|
  |
  |
  |To:  <[EMAIL PROTECTED]>
 |
  |cc: 
  |
  |    Subject: RE: Problem with html:select tag calling set method in form
  |
  
>--|




what is it you are trying to do?I mean why the setter should be caled when
nothing is selected?

Just curious :-))

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 4:41 PM
To: Struts Users Mailing List
Subject: RE: Problem with html:select tag calling set method in form






I was thinking that was the case, but was hoping otherwise, I'll have to
come up w/ a javascript solution.

thx for the help Shirish
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Tel: (603) 471-4712
Email: [EMAIL PROTECTED]
Web Site: www.stchome.com
"Advancing Public Health Through Information Technology"
___


|-+>
| | |
| ||
| |   11/04/2003 09:35 AM  |
| |   Please respond to|
| |   "Struts Users Mailing|
| |   List"|
| ||
|-+>

>--|

  |
|
  |To:  <[EMAIL PROTECTED]>
|
  |cc:
|
  |Subject: RE: Problem with html:select tag calling set method in
form  |

>--|





This looke like correct to me.Because if you do not select anything, that
also means that there wont be any value sent for that request parameter.And
so the setter will not be called.

You can runa  simple check.Check by calling request.getParameter if any
parameter with the name for the select box is being sent in request.I am
sure you wont find any...

HTH.

regards,
Shirish

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 3:21 PM
To: Struts Users Mailing List
Subject: Re: Problem with html:select tag calling set method in form






Is this the correct functionallity of struts??

if you have a multiple selection list box, and everything is deselected,
the setter method in the form object is not getting called.

It only gets called if there are 1 or more entries in the list box selected
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Tel: (603) 471-4712
Email: [EMAIL PROTECTED]
Web Site: www.stchome.com
"Advancing Public Health Through Information Technology"
___


|-+>
| |   damian_bradicich@|
| |   stchome.com  |
| ||
| |

RE: Problem with html:select tag calling set method in form

2003-11-04 Thread shirishchandra.sakhare
what is it you are trying to do?I mean why the setter should be caled when nothing is 
selected?

Just curious :-))

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 4:41 PM
To: Struts Users Mailing List
Subject: RE: Problem with html:select tag calling set method in form






I was thinking that was the case, but was hoping otherwise, I'll have to
come up w/ a javascript solution.

thx for the help Shirish
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Tel: (603) 471-4712
Email: [EMAIL PROTECTED]
Web Site: www.stchome.com
"Advancing Public Health Through Information Technology"
___


|-+>
| | |
| ||
| |   11/04/2003 09:35 AM  |
| |   Please respond to|
| |   "Struts Users Mailing|
| |   List"|
| ||
|-+>
  
>--|
  |
  |
  |To:  <[EMAIL PROTECTED]>
 |
  |cc: 
  |
  |    Subject: RE: Problem with html:select tag calling set method in form
  |
  
>--|




This looke like correct to me.Because if you do not select anything, that
also means that there wont be any value sent for that request parameter.And
so the setter will not be called.

You can runa  simple check.Check by calling request.getParameter if any
parameter with the name for the select box is being sent in request.I am
sure you wont find any...

HTH.

regards,
Shirish

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 3:21 PM
To: Struts Users Mailing List
Subject: Re: Problem with html:select tag calling set method in form






Is this the correct functionallity of struts??

if you have a multiple selection list box, and everything is deselected,
the setter method in the form object is not getting called.

It only gets called if there are 1 or more entries in the list box selected
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Tel: (603) 471-4712
Email: [EMAIL PROTECTED]
Web Site: www.stchome.com
"Advancing Public Health Through Information Technology"
___


|-+>
| |   damian_bradicich@|
| |   stchome.com  |
| ||
| |   10/30/2003 10:44 |
| |   AM   |
| |   Please respond to|
| |   "Struts Users|
| |   Mailing List"|
| ||
|-+>

>--|

  |
|
  |To:  "Struts Users Mailing List"
<[EMAIL PROTECTED]>
|
  |cc:
|
  |Subject: Problem with html:select tag calling set method in form
|

>--|









I have a jsp that creates a select tag w/ size = 2 and multiple also true,
which gives me a list box w/ multi selection.

So, I open up the page, and I see all the data fine, I select a couple of
items in the list box and save, everything is great, my setter in the form
is getting called.  However, if i deselect all entries in the list box, and
save, the setter method in the form is not being called, has anyone else
noticed this?  If so, does anyone have a workaround?
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Web Site: www.stchome.com
"Advancing Public Health Core Capacities While Leveraging the Resources of
a Community"
___


--

RE: Problem with html:select tag calling set method in form

2003-11-04 Thread damian_bradicich




I was thinking that was the case, but was hoping otherwise, I'll have to
come up w/ a javascript solution.

thx for the help Shirish
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Tel: (603) 471-4712
Email: [EMAIL PROTECTED]
Web Site: www.stchome.com
"Advancing Public Health Through Information Technology"
___


|-+>
| | |
| ||
| |   11/04/2003 09:35 AM  |
| |   Please respond to|
| |   "Struts Users Mailing|
| |   List"|
| ||
|-+>
  
>--|
  |
  |
  |To:  <[EMAIL PROTECTED]>
 |
  |cc: 
  |
  |    Subject: RE: Problem with html:select tag calling set method in form
  |
  
>--|




This looke like correct to me.Because if you do not select anything, that
also means that there wont be any value sent for that request parameter.And
so the setter will not be called.

You can runa  simple check.Check by calling request.getParameter if any
parameter with the name for the select box is being sent in request.I am
sure you wont find any...

HTH.

regards,
Shirish

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 3:21 PM
To: Struts Users Mailing List
Subject: Re: Problem with html:select tag calling set method in form






Is this the correct functionallity of struts??

if you have a multiple selection list box, and everything is deselected,
the setter method in the form object is not getting called.

It only gets called if there are 1 or more entries in the list box selected
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Tel: (603) 471-4712
Email: [EMAIL PROTECTED]
Web Site: www.stchome.com
"Advancing Public Health Through Information Technology"
___


|-+>
| |   damian_bradicich@|
| |   stchome.com  |
| ||
| |   10/30/2003 10:44 |
| |   AM   |
| |   Please respond to|
| |   "Struts Users|
| |   Mailing List"|
| ||
|-+>

>--|

  |
|
  |To:  "Struts Users Mailing List"
<[EMAIL PROTECTED]>
|
  |cc:
|
  |Subject: Problem with html:select tag calling set method in form
|

>--|









I have a jsp that creates a select tag w/ size = 2 and multiple also true,
which gives me a list box w/ multi selection.

So, I open up the page, and I see all the data fine, I select a couple of
items in the list box and save, everything is great, my setter in the form
is getting called.  However, if i deselect all entries in the list box, and
save, the setter method in the form is not being called, has anyone else
noticed this?  If so, does anyone have a workaround?
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Web Site: www.stchome.com
"Advancing Public Health Core Capacities While Leveraging the Resources of
a Community"
___


-
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: Problem with html:select tag calling set method in form

2003-11-04 Thread shirishchandra.sakhare
This looke like correct to me.Because if you do not select anything, that also means 
that there wont be any value sent for that request parameter.And so the setter will 
not be called.

You can runa  simple check.Check by calling request.getParameter if any parameter with 
the name for the select box is being sent in request.I am sure you wont find any...

HTH.

regards,
Shirish

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 3:21 PM
To: Struts Users Mailing List
Subject: Re: Problem with html:select tag calling set method in form






Is this the correct functionallity of struts??

if you have a multiple selection list box, and everything is deselected,
the setter method in the form object is not getting called.

It only gets called if there are 1 or more entries in the list box selected
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Tel: (603) 471-4712
Email: [EMAIL PROTECTED]
Web Site: www.stchome.com
"Advancing Public Health Through Information Technology"
___


|-+>
| |   damian_bradicich@|
| |   stchome.com  |
| ||
| |   10/30/2003 10:44 |
| |   AM   |
| |   Please respond to|
| |   "Struts Users|
| |   Mailing List"|
| ||
|-+>
  
>--|
  |
  |
  |To:  "Struts Users Mailing List" <[EMAIL PROTECTED]>
 |
  |cc: 
  |
  |Subject: Problem with html:select tag calling set method in form
  |
  
>--|








I have a jsp that creates a select tag w/ size = 2 and multiple also true,
which gives me a list box w/ multi selection.

So, I open up the page, and I see all the data fine, I select a couple of
items in the list box and save, everything is great, my setter in the form
is getting called.  However, if i deselect all entries in the list box, and
save, the setter method in the form is not being called, has anyone else
noticed this?  If so, does anyone have a workaround?
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Web Site: www.stchome.com
"Advancing Public Health Core Capacities While Leveraging the Resources of
a Community"
___


-
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: Problem with html:select tag calling set method in form

2003-11-04 Thread damian_bradicich




Is this the correct functionallity of struts??

if you have a multiple selection list box, and everything is deselected,
the setter method in the form object is not getting called.

It only gets called if there are 1 or more entries in the list box selected
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Tel: (603) 471-4712
Email: [EMAIL PROTECTED]
Web Site: www.stchome.com
"Advancing Public Health Through Information Technology"
___


|-+>
| |   damian_bradicich@|
| |   stchome.com  |
| ||
| |   10/30/2003 10:44 |
| |   AM   |
| |   Please respond to|
| |   "Struts Users|
| |   Mailing List"|
| ||
|-+>
  
>--|
  |
  |
  |To:  "Struts Users Mailing List" <[EMAIL PROTECTED]>
 |
  |cc: 
  |
  |Subject: Problem with html:select tag calling set method in form
  |
  
>--|








I have a jsp that creates a select tag w/ size = 2 and multiple also true,
which gives me a list box w/ multi selection.

So, I open up the page, and I see all the data fine, I select a couple of
items in the list box and save, everything is great, my setter in the form
is getting called.  However, if i deselect all entries in the list box, and
save, the setter method in the form is not being called, has anyone else
noticed this?  If so, does anyone have a workaround?
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Web Site: www.stchome.com
"Advancing Public Health Core Capacities While Leveraging the Resources of
a Community"
___


-
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

2003-10-30 Thread Rhet Behler
set the country in the action before the page if null

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 30, 2003 1:41 PM
Subject: html:select


> how can i default a countrylist, i mean set the selected country ?
> I want the selected to be 'BE'
>
> my code:
>
> 
>  
> 
>
>
> Thanks !
>
>
> -
> 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

2003-10-30 Thread [EMAIL PROTECTED]
how can i default a countrylist, i mean set the selected country ?
I want the selected to be 'BE'

my code:


 



Thanks !


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



Problem with html:select tag calling set method in form

2003-10-30 Thread damian_bradicich




I have a jsp that creates a select tag w/ size = 2 and multiple also true,
which gives me a list box w/ multi selection.

So, I open up the page, and I see all the data fine, I select a couple of
items in the list box and save, everything is great, my setter in the form
is getting called.  However, if i deselect all entries in the list box, and
save, the setter method in the form is not being called, has anyone else
noticed this?  If so, does anyone have a workaround?
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Web Site: www.stchome.com
"Advancing Public Health Core Capacities While Leveraging the Resources of
a Community"
___


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



Pre-populating html:select from request object

2003-10-29 Thread Leon King
I'm trying to pass data between different struts forms.  Below I've tried to
pre-populate a select statement from data stored in the request but I get a
compilation error (" Attribute outageEndDateFromMonth has no value " ).

" >




Any suggestions on how this can be achieved?

Thanks

Leon


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



Re: html:select onchange

2003-10-29 Thread Mark Lowe
In fact ignore my suggestion, I was silly and assumed the userId was 
taken somewhere else but the form.



On Wednesday, October 29, 2003, at 11:33 AM, Mark Lowe wrote:

Perhaps you don't need to pass the id in as an argument. I'd just wrap 
the action in a js function

function setupUserForm() {
	alert( 'setUpUsersForm.do?action=retrieve&userId=  '  );
}

onchange="setupUserForm()" ..



On Wednesday, October 29, 2003, at 11:12 AM, struts wrote:

Problem how can i pass the userId ? so that i can do a 
request.getParameter("userId")  ?

example:













Thanks !


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

2003-10-29 Thread Mark Lowe
Perhaps you don't need to pass the id in as an argument. I'd just wrap 
the action in a js function

function setupUserForm() {
	alert( 'setUpUsersForm.do?action=retrieve&userId=  '  );
}

onchange="setupUserForm()" ..



On Wednesday, October 29, 2003, at 11:12 AM, struts wrote:

Problem how can i pass the userId ? so that i can do a 
request.getParameter("userId")  ?

example:













Thanks !


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


Re: html:select onchange

2003-10-29 Thread James Mitchell
Change your custom JavaScript function.

Here's an example of what I mean: (change it to fit your needs)


 
  value1
  value2
  value3
 


function setAction(form) {
 selectCtl = form.elements["users.userAccount"];
 form.action = "dosomething.do?users.userAccount=";
 form.action += selectCtl.options[selectCtl.selectedIndex].value;
}










--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017
770.822.3359
AIM:jmitchtx



- Original Message - 
From: "struts" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, October 29, 2003 6:12 AM
Subject: html:select onchange


Problem how can i pass the userId ? so that i can do a
request.getParameter("userId")  ?

example:













Thanks !


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



html:select onchange

2003-10-29 Thread struts
Problem how can i pass the userId ? so that i can do a request.getParameter("userId")  
?

example:







 





Thanks !


logic:iterate tag with html:select

2003-10-14 Thread Xiuyu Zhang
Hi all,

I am try it to do a list in the action class and pass
it to a jsp page as the html:select options.  I am
using Strut 1.0.

in the action class, I do this:


ArrayList codes = new ArrayList();
codes.add("--select one--");

request.setAttribute("CODES", codes);

in jsp, I try to do:








submit  
 


I got the following errors:

Compilation of
'C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_hesm_dir_hesm\jsp_servlet\__hospitalsearch.java'
failed:


C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_hesm_dir_hesm\jsp_servlet\__hospitalsearch.java:319:
cannot resolve symbol
probably occurred due to an error in
/hospitalsearch.jsp line 52:




Full compiler error(s):
C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_hesm_dir_hesm\jsp_servlet\__hospitalsearch.java:319:
cannot resolve symbol
symbol  : method setValue (java.lang.Object)
location: class
org.apache.struts.taglib.html.OptionTag
 
_html_option0.setValue(code.get(ctr.intValue())); //[
/hospitalsearch.jsp; Line: 52]
   ^
1 error



Do you know how can I make it right?

Thanks,
katlyn


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



RE: How can I compute data for html:select choices?

2003-10-13 Thread Wiebe de Jong
For a simple select like this one (months of the year), I use the following
code in my work. 

There is one file, AppStart.java, which contains a servlet that executes at
application start. The second part of the code shows what to add to web.xml
to make this execute. The last piece of code shows how to use the collection
in a jsp page.

Wiebe
http://frontierj.blogspot.com

--
AppStart.java:

package com.myco.myapp;

import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;

import org.apache.struts.util.LabelValueBean;

public class AppStart extends HttpServlet {

// a static representation of the MONTHS table
  private LabelValueBean[] monthTable = {
new LabelValueBean("January", "1"),
new LabelValueBean("February", "2"),
new LabelValueBean("March", "3"),
new LabelValueBean("April", "4"),
new LabelValueBean("May", "5"),
new LabelValueBean("June", "6"),
new LabelValueBean("July", "7"),
new LabelValueBean("August", "8"),
new LabelValueBean("September", "9"),
new LabelValueBean("October", "10"),
new LabelValueBean("November", "11"),
new LabelValueBean("December", "12")
  };
 
  // this will execute at startup
  public void init() throws ServletException {

// month list
ArrayList monthList = new ArrayList();
for (int i = 0; i < monthTable.length; i++)
  monthList.add(i, monthTable[i]);
getServletContext().setAttribute("appMonthList", monthList);
  }
}

--
web.xml:

  
appstart
com.myco.myapp.AppStart

  debug
  0

5
  

--
page.jsp:


  Month:
  

  


--

-Original Message-
From: Bob Langford [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 11, 2003 10:35 AM
To: [EMAIL PROTECTED]
Subject: How can I compute data for html:select choices?

Hi,  I can't seem to understand how to declare things correctly to do
what I want to do.  Can anyone tell me where I am going wrong?

I'm trying to use a simple Java method as the source of the choices
in a html:select box in a form.  The method returns a java.util.List,
where each item is a org.apache.struts.util.ValueLabelBean object, just
what I need for this.  Here's one way I tried to use it:
=
<%@ page import="foo.bar.MyUtils" %>

<%  months = MyUtils.getMonthsList();   %>
   ...

  

=
The problem is that "useBean" looks up the attribute "months" in the page
context, and since it can't find it, throws an exception.  But without
the "useBean" tag, the "html:options" tag can't find the data it needs.
I've read the docs until my eyes hurt, and I can't find any technique to
tell "useBean" to merely create a new bean, not fetch an existing one.
This seems so easy, I can't believe I haven't done it before, but I can't
find an example in any of my previous code.

What am I missing? Thanks in advance...

--
Bob Langford
Silicon Masters Consulting, Inc.8207 Stone River Court, Richmond, VA
23235
phone:  804-674-1253  fax:  804-745-6650 
http://www.silicon-masters.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: How can I compute data for html:select choices?

2003-10-11 Thread Ramakrishna_Nk
i am not sure if you have tried this out:

<%@ page import="foo.bar.MyUtils" %>

<%  months = MyUtils.getMonthsList();   %>
   ...

  


Cheers !
Ram
 







-Original Message-
From: Bob Langford [ mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ]
Sent: Saturday, October 11, 2003 11:05 PM
To: [EMAIL PROTECTED]
Subject: How can I compute data for html:select choices?


Hi,  I can't seem to understand how to declare things correctly to do
what I want to do.  Can anyone tell me where I am going wrong?

I'm trying to use a simple Java method as the source of the choices
in a html:select box in a form.  The method returns a java.util.List,
where each item is a org.apache.struts.util.ValueLabelBean object, just
what I need for this.  Here's one way I tried to use it:
=
<%@ page import="foo.bar.MyUtils" %>

<%  months = MyUtils.getMonthsList();   %>
   ...

  

=
The problem is that "useBean" looks up the attribute "months" in the page
context, and since it can't find it, throws an exception.  But without
the "useBean" tag, the "html:options" tag can't find the data it needs.
I've read the docs until my eyes hurt, and I can't find any technique to
tell "useBean" to merely create a new bean, not fetch an existing one.
This seems so easy, I can't believe I haven't done it before, but I can't
find an example in any of my previous code.

What am I missing? Thanks in advance...

--
Bob Langford
Silicon Masters Consulting, Inc.8207 Stone River Court, Richmond, VA
23235
phone:  804-674-1253  fax:  804-745-6650
http://www.silicon-masters.com/ <http://www.silicon-masters.com/>  



-
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 compute data for html:select choices?

2003-10-11 Thread Vic Cekvenich
The point of MVC is to pre-populate the bean in Action.

You should unit test the bean in the model layer, once it works, put it 
in Struts. (MVC layered aproach allows for unit testing of a layer)
So if you say something like:
MyBean b = new MyBean();
b.populate();
Collection c = b.getOptions();
out.println(b);
-what do you get?
.V

A bean that does not work outside of Struts, will not work once you put 
it in Struts.

Daniel H. F. e Silva wrote:
Hi Bob,
 I think you could try  or, better, JSTL tag .
I'm not a JSTL expert but i know you can determine scope to be used by .
And i'm not sure, but i think you can do that also with .
 Hope it helped you.
Regards,
 Daniel.
--- Bob Langford <[EMAIL PROTECTED]> wrote:

Hi,  I can't seem to understand how to declare things correctly to do
what I want to do.  Can anyone tell me where I am going wrong?
I'm trying to use a simple Java method as the source of the choices
in a html:select box in a form.  The method returns a java.util.List,
where each item is a org.apache.struts.util.ValueLabelBean object, just
what I need for this.  Here's one way I tried to use it:
=
<%@ page import="foo.bar.MyUtils" %>

<%  months = MyUtils.getMonthsList();   %>
  ...
   
 
   
=
The problem is that "useBean" looks up the attribute "months" in the page
context, and since it can't find it, throws an exception.  But without
the "useBean" tag, the "html:options" tag can't find the data it needs.
I've read the docs until my eyes hurt, and I can't find any technique to
tell "useBean" to merely create a new bean, not fetch an existing one.
This seems so easy, I can't believe I haven't done it before, but I can't
find an example in any of my previous code.

What am I missing? Thanks in advance...

--
Bob Langford
Silicon Masters Consulting, Inc.8207 Stone River Court, Richmond, VA  23235
phone:  804-674-1253  fax:  804-745-6650 
http://www.silicon-masters.com/  



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


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
--
Victor Cekvenich,
Struts Instructor
(215) 312-9146
Advanced Struts Training
<http://basebeans.com/do/cmsPg?content=TRAINING> Server Side Java
training with Rich UI, mentoring, designs, samples and project recovery
in North East.
Simple best practice basic Portal, a Struts CMS, Membership, Forums,
Shopping and Credit processing, <http://basicportal.com> software, ready
to develop/customize; requires a db to run.


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


Re: How can I compute data for html:select choices?

2003-10-11 Thread Daniel H. F. e Silva
Hi Bob,
 I think you could try  or, better, JSTL tag .
I'm not a JSTL expert but i know you can determine scope to be used by .
And i'm not sure, but i think you can do that also with .
 Hope it helped you.

Regards,
 Daniel.

--- Bob Langford <[EMAIL PROTECTED]> wrote:
> Hi,  I can't seem to understand how to declare things correctly to do
> what I want to do.  Can anyone tell me where I am going wrong?
> 
> I'm trying to use a simple Java method as the source of the choices
> in a html:select box in a form.  The method returns a java.util.List,
> where each item is a org.apache.struts.util.ValueLabelBean object, just
> what I need for this.  Here's one way I tried to use it:
> =
> <%@ page import="foo.bar.MyUtils" %>
> 
> <%  months = MyUtils.getMonthsList();   %>
>...
> 
>labelProperty="label" />
> 
> =
> The problem is that "useBean" looks up the attribute "months" in the page
> context, and since it can't find it, throws an exception.  But without
> the "useBean" tag, the "html:options" tag can't find the data it needs.
> I've read the docs until my eyes hurt, and I can't find any technique to
> tell "useBean" to merely create a new bean, not fetch an existing one.
> This seems so easy, I can't believe I haven't done it before, but I can't
> find an example in any of my previous code.
> 
> What am I missing? Thanks in advance...
> 
> --
> Bob Langford
> Silicon Masters Consulting, Inc.8207 Stone River Court, Richmond, VA  23235
> phone:  804-674-1253  fax:  804-745-6650 
> http://www.silicon-masters.com/  
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



How can I compute data for html:select choices?

2003-10-11 Thread Bob Langford
Hi,  I can't seem to understand how to declare things correctly to do
what I want to do.  Can anyone tell me where I am going wrong?
I'm trying to use a simple Java method as the source of the choices
in a html:select box in a form.  The method returns a java.util.List,
where each item is a org.apache.struts.util.ValueLabelBean object, just
what I need for this.  Here's one way I tried to use it:
=
<%@ page import="foo.bar.MyUtils" %>

<%  months = MyUtils.getMonthsList();   %>
  ...
   
 
   
=
The problem is that "useBean" looks up the attribute "months" in the page
context, and since it can't find it, throws an exception.  But without
the "useBean" tag, the "html:options" tag can't find the data it needs.
I've read the docs until my eyes hurt, and I can't find any technique to
tell "useBean" to merely create a new bean, not fetch an existing one.
This seems so easy, I can't believe I haven't done it before, but I can't
find an example in any of my previous code.

What am I missing? Thanks in advance...

--
Bob Langford
Silicon Masters Consulting, Inc.8207 Stone River Court, Richmond, VA  23235
phone:  804-674-1253  fax:  804-745-6650 
http://www.silicon-masters.com/  



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


RE: problem using html:select

2003-10-01 Thread Greg Dunn

The 'property' attribute of the select tag is the form property submitted.
You don't need to use the name property in the select tag, it's used there
to indicate which bean to get a value from in order to pre-select an item in
the options.

Try this:


  


or


  


If you do want to pre-select an option add the 'value' attribute to the
select tag.


Greg


-Original Message-
From: carlos manuel llona aris [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 01, 2003 2:07 PM
To: [EMAIL PROTECTED]
Subject: Re: problem using html:select


the problem is that now using the combo I cant obtein the value selected
when I submit - the user form cant recive the value, and I dont know why!!

I dont know how to connect my combobox with one variable of the user form,
before I used the atribute property using a hmlt:text, now I dont know how
to match

:(

>From: [EMAIL PROTECTED]
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: Re: problem using html:select
>Date: Wed, 1 Oct 2003 12:46:10 -0400
>
>What is the error message you are getting?
>
>
>- Original Message -
>From: "Carlos Llona" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, October 01, 2003 11:57 AM
>Subject: problem using html:select
>
>
> > Hello:
> >
> > This is my litle problem
> >
> > I make a sample in struts that register data from the users, this
> > data is save in one table ("Users"), the JSP have a field
> > call "Cargo" (I'm from southamerica - cargo is like a ocupation), in
> > this field the user enter the ocupation manualy, but now I want that
> > the user select the Cargo(ocupation - this ocupations are in another
> > table) from a combo, I can show the combobox with the data from de
> > table ocupations using a bean and the tag html:select.
> >
> > 
> >
> > 
> > --select--
> >  > value='codigo' property='cargos' />
> > 
> >
> > but now I cant recive tha value selected in the combo in my User
> > form. I think that the problem was the value of the atribute property
> > of tha select tag, but when i change the value of the property
> > entering a name of the variable for my user form occurs a error,
> > because property just accept the name of a variable of my Cargo bean.
> >
> > Whats is the problem with this???
> >
> >
> > -
> > 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]
>

_
¿Estás buscando un auto nuevo?  http://www.yupimsn.com/autos/


-
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: problem using html:select

2003-10-01 Thread carlos manuel llona aris
the problem is that now using the combo I cant obtein the value selected 
when I submit - the user form cant recive the value, and I dont know why!!

I dont know how to connect my combobox with one variable of the user form, 
before I used the atribute property using a hmlt:text, now I dont know how 
to match

:(

From: [EMAIL PROTECTED]
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Re: problem using html:select
Date: Wed, 1 Oct 2003 12:46:10 -0400
What is the error message you are getting?

- Original Message -
From: "Carlos Llona" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 01, 2003 11:57 AM
Subject: problem using html:select
> Hello:
>
> This is my litle problem
>
> I make a sample in struts that register data from the users, this
> data is save in one table ("Users"), the JSP have a field
> call "Cargo" (I'm from southamerica - cargo is like a ocupation), in
> this field the user enter the ocupation manualy, but now I want that
> the user select the Cargo(ocupation - this ocupations are in another
> table) from a combo, I can show the combobox with the data from de
> table ocupations using a bean and the tag html:select.
>
> 
>
> 
> --select--
>  value='codigo' property='cargos' />
> 
>
> but now I cant recive tha value selected in the combo in my User
> form. I think that the problem was the value of the atribute property
> of tha select tag, but when i change the value of the property
> entering a name of the variable for my user form occurs a error,
> because property just accept the name of a variable of my Cargo bean.
>
> Whats is the problem with this???
>
>
> -
> 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]
_
¿Estás buscando un auto nuevo?  http://www.yupimsn.com/autos/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: problem using html:select

2003-10-01 Thread denis
What is the error message you are getting?


- Original Message - 
From: "Carlos Llona" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 01, 2003 11:57 AM
Subject: problem using html:select


> Hello:
> 
> This is my litle problem
> 
> I make a sample in struts that register data from the users, this 
> data is save in one table ("Users"), the JSP have a field 
> call "Cargo" (I'm from southamerica - cargo is like a ocupation), in 
> this field the user enter the ocupation manualy, but now I want that 
> the user select the Cargo(ocupation - this ocupations are in another 
> table) from a combo, I can show the combobox with the data from de 
> table ocupations using a bean and the tag html:select.
> 
> 
> 
> 
> --select--
>  value='codigo' property='cargos' />
> 
> 
> but now I cant recive tha value selected in the combo in my User 
> form. I think that the problem was the value of the atribute property 
> of tha select tag, but when i change the value of the property 
> entering a name of the variable for my user form occurs a error, 
> because property just accept the name of a variable of my Cargo bean.
> 
> Whats is the problem with this???
> 
> 
> -
> 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]



problem using html:select

2003-10-01 Thread Carlos Llona
Hello:

This is my litle problem

I make a sample in struts that register data from the users, this 
data is save in one table ("Users"), the JSP have a field 
call "Cargo" (I'm from southamerica - cargo is like a ocupation), in 
this field the user enter the ocupation manualy, but now I want that 
the user select the Cargo(ocupation - this ocupations are in another 
table) from a combo, I can show the combobox with the data from de 
table ocupations using a bean and the tag html:select.




--select--



but now I cant recive tha value selected in the combo in my User 
form. I think that the problem was the value of the atribute property 
of tha select tag, but when i change the value of the property 
entering a name of the variable for my user form occurs a error, 
because property just accept the name of a variable of my Cargo bean.

Whats is the problem with this???


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



RE: Problem updating values from html:select

2003-09-19 Thread Hajratwala, Nayan (N.)
Yep, that was the ticket ... Seems kind of odd ... Ah well, I'm happy =)
Thanks Mike!!

---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com


-Original Message-
From: Michael Ruppin [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 19, 2003 2:09 PM
To: Struts Users Mailing List
Subject: RE: Problem updating values from html:select


I'm fairly certain your ActionForm needs an indexed setter for the Device Objects, as 
well.  Give it a try.
 
m

"Hajratwala, Nayan (N.)" <[EMAIL PROTECTED]> wrote:
Not directly on my form, but on the Device object, I have the following methods:

public String getDeviceParameterValue(int parameterId)
public void setDeviceParameterValue(int parameterId, String value)

---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com


-Original Message-
From: Michael Ruppin [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 19, 2003 12:42 PM
To: Struts Users Mailing List
Subject: Re: Problem updating values from html:select



You did make the indexed setters in your Form, right? 

m

Hajratwala, Nayan (N.)" wrote: 
Folks, I have the following jsp that is giving me a headache.

My ActionForm contains a Collection of Device objects. The outer loop iterates over 
each device.

Each Device contains a Collection of Parameter objects. The inner loop iterates over 
each parameter.

The problem comes in the The values are displaying properly on the screen, but they 
are not updating during the submit.

I am not getting any errors or anything .. Just no updated values.

Can anyone provide some insight?

Thanks!






Device Name: 

Device Type: 


Settings:




:


'>









[input] " name=currentDevice>







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


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

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


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

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



RE: Problem updating values from html:select

2003-09-19 Thread Michael Ruppin
I'm fairly certain your ActionForm needs an indexed setter for the Device Objects, as 
well.  Give it a try.
 
m

"Hajratwala, Nayan (N.)" <[EMAIL PROTECTED]> wrote:
Not directly on my form, but on the Device object, I have the following methods:

public String getDeviceParameterValue(int parameterId)
public void setDeviceParameterValue(int parameterId, String value)

---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com


-Original Message-
From: Michael Ruppin [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 19, 2003 12:42 PM
To: Struts Users Mailing List
Subject: Re: Problem updating values from html:select



You did make the indexed setters in your Form, right? 

m

Hajratwala, Nayan (N.)" wrote: 
Folks, I have the following jsp that is giving me a headache.

My ActionForm contains a Collection of Device objects. The outer loop iterates over 
each device.

Each Device contains a Collection of Parameter objects. The inner loop iterates over 
each parameter.

The problem comes in the The values are displaying properly on the screen, but they 
are not updating during the submit.

I am not getting any errors or anything .. Just no updated values.

Can anyone provide some insight?

Thanks!






Device Name: 

Device Type: 


Settings:




:


'>









[input] " name=currentDevice>







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


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

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


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

RE: Problem updating values from html:select

2003-09-19 Thread Hajratwala, Nayan (N.)
Not directly on my form, but on the Device object, I have the following methods:

public String getDeviceParameterValue(int parameterId)
public void setDeviceParameterValue(int parameterId, String value)

---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com


-Original Message-
From: Michael Ruppin [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 19, 2003 12:42 PM
To: Struts Users Mailing List
Subject: Re: Problem updating values from html:select



You did make the indexed setters in your Form, right? 

m

Hajratwala, Nayan (N.)" <[EMAIL PROTECTED]>wrote: 
Folks, I have the following jsp that is giving me a headache.

My ActionForm contains a Collection of Device objects. The outer loop iterates over 
each device.

Each Device contains a Collection of Parameter objects. The inner loop iterates over 
each parameter.

The problem comes in the The values are displaying properly on the screen, but they 
are not updating during the submit.

I am not getting any errors or anything .. Just no updated values.

Can anyone provide some insight?

Thanks!






Device Name: 

Device Type: 


Settings:




:


'>









 [input] " name=currentDevice>







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


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

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



Re: Problem updating values from html:select

2003-09-19 Thread Michael Ruppin

You did make the indexed setters in your Form, right? 

m

Hajratwala, Nayan (N.)" <[EMAIL PROTECTED]>wrote: 
Folks, I have the following jsp that is giving me a headache.

My ActionForm contains a Collection of Device objects. The outer loop iterates over 
each device.

Each Device contains a Collection of Parameter objects. The inner loop iterates over 
each parameter.

The problem comes in the The values are displaying properly on the screen, but they 
are not updating during the submit.

I am not getting any errors or anything .. Just no updated values.

Can anyone provide some insight?

Thanks!






Device Name: 

Device Type: 


Settings:




:


'>









 [input] " name=currentDevice>







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


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Problem updating values from html:select

2003-09-19 Thread Hajratwala, Nayan (N.)
Folks, I have the following jsp that is giving me a headache.

My ActionForm contains a Collection of Device objects.  The outer loop iterates over 
each device.

Each Device contains a Collection of Parameter objects.  The inner loop iterates over 
each parameter.

The problem comes in the   The values are displaying properly on the 
screen, but they are not updating during the submit.

I am not getting any errors or anything .. Just no updated values.

Can anyone provide some insight?

Thanks!


  



Device Name: 
Device Type: 
  
Settings:

  


  :
  
  

  


  

  
  








  

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



Re: html:select multiple="true" and ActionForm

2003-09-17 Thread Ian Joyce
Minor correction:

public String[] getSelectedProductValues() should be
public ArrayList getSelectedProductValues()


Ian Joyce
Internet Systems Programmer/Analyst
American Academy of Family Physicians
Research and Information Services
Interactive Media
11400 Tomahawk Creek Parkway
Leawood, KS  66211-2672
Phone:  800-274-2237 ext 4219
Fax:  913-906-6271
E-mail:  [EMAIL PROTECTED]
>>> [EMAIL PROTECTED] 09/18/03 01:06 AM >>>
I've looked in the archives and googled but haven't come up with a solution yet.

I have a html:select multiple="true" form element.  When the form is submitted what 
setter should be called in the ActionForm?

My form
8<---8<---

  

8<---8<---

my ActionForm ( not working )
8<---8<---
public final class ProductsForm extends ActionForm {
   private ArrayList selectedProductValues = null;

   public void setSelectedProductValues(ArrayList selectedProductValues) {
  this.selectedProductValues = selectedProductValues;
   }

   public String[] getSelectedProductValues() {
  return this.selectedProductValues;
   }
}
8<---8<---

Thanks for any help...

-
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 multiple="true" and ActionForm

2003-09-17 Thread Ian Joyce
I've looked in the archives and googled but haven't come up with a solution yet.

I have a html:select multiple="true" form element.  When the form is submitted what 
setter should be called in the ActionForm?

My form
8<---8<---

  

8<---8<---

my ActionForm ( not working )
8<---8<---
public final class ProductsForm extends ActionForm {
   private ArrayList selectedProductValues = null;

   public void setSelectedProductValues(ArrayList selectedProductValues) {
  this.selectedProductValues = selectedProductValues;
   }

   public String[] getSelectedProductValues() {
  return this.selectedProductValues;
   }
}
8<---8<---

Thanks for any help...

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



html:select and Validation with IndexedPropertyList

2003-09-15 Thread George Amaya
I am having a problem with the Validator.  I am not getting my messages
back when I have a List of html:selects.  The first error message is at
property[0].message, but it does not show up for the next select boxes.

Any thoughts?

jsp:







 
Yes
No




   






   











Validator:


   


   



maxlength
${descMaxLen}





   



maxlength
12
   

min
0



   





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



html:select within logic:iterate

2003-09-10 Thread Tobias Salem

Hello,

I have a problem with auto-updating some properties with html:selects within
an iterate-tag.
The JSP is a classic view/edit cart page where you view and possibly edit
your shopping cart. The form is called CartForm and only have one instance
variable called trade (an own-written class Trade), through which all
relevant data is retrieved and/or updated.

The Trade object contains a list of products which are part of the trade.
For these the title and price should be displayed (no problem here), and the
quantity and deliveryMethod should be displayed and "updateable" through
html:selects. The problem is how to write the correct html:select syntax to
map to the correct methods in the CartForm (which just translates/forwards
the call). Everything except the html:selects are working fine. I have read
alot of forums/articles and tried over 20 syntax variants but still with no
luck. :(

Here is the relevant code:

/**
 * Class representing the form used to view/edit the cart,
 * subclassing the CustomerForm (extends ActionForm)
 * What differs in this CartForm is that it has Trade info
 * (the tradeProducts of the Trade are what constitutes the 'cart').
 *
 */
public class CartForm extends CustomerForm  {

private static Logger logger = Logger.getLogger( CartForm.class);

protected Trade trade;

public Trade getTrade() {
return trade;
}

public void setTrade(Trade t) {
trade = t;
List l = trade.getTradeProducts();
logger.debug("CartForm.setTrade(Trade t) called");
logger.debug("This CartForm now has " +l.size() + " nr of TradeProducts " +
l);
}

// returns the list of TradeProducts which are part of the trade/cart
public List getTradeProducts() {
return trade.getTradeProducts();
}

// Methods added from similar example at
http://jakarta.apache.org/struts/userGuide/building_controller.html
// but Are these getters and setter really needed?
// The get/set methods should IMHO be called directly on the
TradeProduct objects
public int getQty(int i) {
logger.debug("Getting qty on TradeProduct nr " +i+ ".");
TradeProduct tp = (TradeProduct) trade.getTradeProducts().get(i);
return tp.getQty();
}

public void setQty(int i, int value) {
logger.debug("Changed qty on TradeProduct nr " +i+ " to value " + value);
TradeProduct tp = (TradeProduct) trade.getTradeProducts().get(i);
tp.setQty(value);
}

public String getDeliveryMethod(int i) {
TradeProduct tp = (TradeProduct) trade.getTradeProducts().get(i);
return tp.getDeliveryMethod();
}

public void setDeliveryMethod(int i, String value) {
logger.debug("Changed setDeliveryMethod on TradeProduct nr " +i+ " to value
" + value);
TradeProduct tp = (TradeProduct) trade.getTradeProducts().get(i);
tp.setDeliveryMethod(value);
}

}

/**
 * This class models a TradeProduct.
 * A Trade respesents one "purchase-event" and can consist of one or many
TradeProducts.
 * A TradeProduct is a Product which belongs to a specific Trade, with
information
 * such as quantity, deliveryMethod and deliveryDate.
 *
 */
public class TradeProduct extends DatabaseObject {
  private int qty = 1;
  private String deliveryMethod = "";

public int getQty() {
return qty;
}
public void setQty(int _qty) {
qty = _qty;
}

public String getDeliveryMethod() {
return deliveryMethod;
}
public void setDeliveryMethod(String _deliveryMethod) {
deliveryMethod = _deliveryMethod;
}
...
}

viewCart.jsp

...
  



  
  

  

  

  
...

...

With this syntax no error occurs but no update of the qty or deliveryMethod
occurs. If I remove the indexed="true" it says that setter methods for qty
and deliveryMethod is missing, which is a lie since a TradeProduct has
those, and tp points to a TradeProduct.
Any help is much appreciated. A complete example html:selects withing a
logic:iterate which auto-update properties in the form (or classes
referenced by the form) would be great.

Thanks in advance.

Best Regards /Tobias


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



RE: Html:select

2003-08-29 Thread Seshadhri Srinivasan
Hi,
Can someone help out with the usage of html:select. The API just gives the
syntax ans the parameters that can be used with place.
I understand that it can be used with combo boxes. I have to poulate a combo
box using this.
Thanks,
Seshadhri Srinivasan 

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



RE: html:select Not 'Selecting' My Item

2003-08-18 Thread Wendy Smoak
> For some reason (not immediately sure why), I thought I could have 
> the contents of 'value' evaluated (i.e. value='${myOtherProperty}').
> You're saying that this is not the case?
> If that's true, how would I get the effect I require?

You can... If you switch to the EL tags.  Look in the 'contrib' directory,
and get the .jar files in there.  Read the README file.  Change your
<@taglib> at the top to:

<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el";
prefix="html-el" %>

Then use the syntax you have above, something like:



>From memory... play with syntax and spelling as necessary to get it to do
what you want.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM 


RE: html:select Not 'Selecting' My Item

2003-08-18 Thread Yee, Richard K,,DMDCWEST
Hunter,
In your Action, if you set the value of associatedSalesperson =
getEncodeAssociatedSalespersonID(), then it should fix your problem. Once
the form gets submitted, you can then do some processing on the value of
associatedSalesperson before writing the value to your database. Either way,
associatedSalesperson is going to get the one of the values
("Jobs-8","Bob-7","Bob-27", or "Bob-32").

Regards,

Richard

-Original Message-
From: Hunter Hillegas [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 18, 2003 2:21 PM
To: Struts List
Subject: Re: html:select Not 'Selecting' My Item


This may be the crux of my problem.

For some reason (not immediately sure why), I thought I could have the
contents of 'value' evaluated (i.e. value='${myOtherProperty}').

You're saying that this is not the case?

If that's true, how would I get the effect I require?

Thanks very much for your help.

Hunter

> From: Wendy Smoak <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Mon, 18 Aug 2003 14:09:22 -0700
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Subject: RE: html:select Not 'Selecting' My Item
> 
> No, 'value' is where you would put the literal value of the option you 
> want to be selected.
> 
> Take a look here: 
> http://jakarta.apache.org/struts/userGuide/struts-html.html#select
> 
> For 'value' it says: "The value to compare with for marking an option 
> selected."
> 
> Nothing about using whatever you put in value as the name of a 
> different form property.  Where did you get that idea?


-
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 Not 'Selecting' My Item

2003-08-18 Thread Hunter Hillegas
This may be the crux of my problem.

For some reason (not immediately sure why), I thought I could have the
contents of 'value' evaluated (i.e. value='${myOtherProperty}').

You're saying that this is not the case?

If that's true, how would I get the effect I require?

Thanks very much for your help.

Hunter

> From: Wendy Smoak <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Mon, 18 Aug 2003 14:09:22 -0700
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Subject: RE: html:select Not 'Selecting' My Item
> 
> No, 'value' is where you would put the literal value of the option you want
> to be selected.  
> 
> Take a look here:
> http://jakarta.apache.org/struts/userGuide/struts-html.html#select
> 
> For 'value' it says: "The value to compare with for marking an option
> selected."
> 
> Nothing about using whatever you put in value as the name of a different
> form property.  Where did you get that idea?


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



Re: html:select Not 'Selecting' My Item

2003-08-18 Thread Hunter Hillegas


> From: Wendy Smoak <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Mon, 18 Aug 2003 14:06:06 -0700
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Subject: RE: html:select Not 'Selecting' My Item
> 
> Hunter wrote:
>> The HTML generated for the  looks as follows:
>>  
>> None of the options are selected. In this example the
>> getEncodeAssociatedSalespersonID() returns Bob-7.
>> I also tried it retunring 'Bob, Darin'. Still, the item is not selected.
> 
> Those names don't match!  Change the name of the 'get' method to
> 'getAssociatedSalesperson' and see if things improve.

I thought I could use value to override what property was being used to
determine which item was selected. I cannot use associatedSalesperson as my
matching item. It won't match. We do some processing on the input before we
put it in our database... That's what I want to use the other method to
output a string that will match.
 
> 
> In an earlier message, you wrote:
>> >name="sampleRequestCompleteForm"
>> value="encodeAssociatedSalespersonID">
> 
> The 'property' in the  tag needs to match the get/set methods.
> You DO NOT need to use the 'value' attribute, Struts will automatically
> pre-select the right value based on what's in the Form bean.
> 
> (I'm almost certain I answered this last week... Hopefully I haven't
> contradicted myself!)

I thought I could use value to override. I don't want the default behavior
here. Please see above.

Thanks,
Hunter


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



RE: html:select Not 'Selecting' My Item

2003-08-18 Thread Wendy Smoak
> I was hoping the value attribute would let me override which property of
my 
> form bean was being used to check for the match. Is that not the case?

No, 'value' is where you would put the literal value of the option you want
to be selected.  

Take a look here:
http://jakarta.apache.org/struts/userGuide/struts-html.html#select

For 'value' it says: "The value to compare with for marking an option
selected."

Nothing about using whatever you put in value as the name of a different
form property.  Where did you get that idea?

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM 


RE: html:select Not 'Selecting' My Item

2003-08-18 Thread Wendy Smoak
Hunter wrote:
> The HTML generated for the  looks as follows:
>  
> None of the options are selected. In this example the
> getEncodeAssociatedSalespersonID() returns Bob-7. 
> I also tried it retunring 'Bob, Darin'. Still, the item is not selected.

Those names don't match!  Change the name of the 'get' method to
'getAssociatedSalesperson' and see if things improve.  

In an earlier message, you wrote:
> name="sampleRequestCompleteForm" 
> value="encodeAssociatedSalespersonID">

The 'property' in the  tag needs to match the get/set methods.
You DO NOT need to use the 'value' attribute, Struts will automatically
pre-select the right value based on what's in the Form bean.

(I'm almost certain I answered this last week... Hopefully I haven't
contradicted myself!)

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM 



Re: html:select Not 'Selecting' My Item

2003-08-18 Thread Hunter Hillegas
Richard,

Yes, I do.

I was hoping the value attribute would let me override which property of my
form bean was being used to check for the match. Is that not the case?

Thanks,
Hunter

> From: "Yee, Richard K,,DMDCWEST" <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Mon, 18 Aug 2003 16:52:06 -0400
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Subject: RE: html:select Not 'Selecting' My Item
> 
> Hunter,
> Do you have an associatedSalesperson attribute in your FormBean? If so, what
> is it's value? You shouldn't really have to use the value attribute if you
> set the associatedSalesperson attribute to the desired id in
> associatedSalesPeople.
> 
> -Richard
> 
> -Original Message-----
> From: Hunter Hillegas [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 15, 2003 9:04 AM
> To: Struts List
> Subject: html:select Not 'Selecting' My Item
> 
> 
> I have an html:select tag that isn't playing along...
> 
> I pre-populate a form in an action. I also create a TreeMap and add it to
> the request scope.
> 
> I have the following in my JSP:
> 
>  name="sampleRequestCompleteForm" value="encodeAssociatedSalespersonID">
> 
>  labelProperty="value"/>
> 
> 
> 
> The problem is not that the map doesn't display as options, they do, that is
> fine. The problem is that the correct item isn't highlighted. No item is
> highlighted (default, top item).
> 
> I have a println() in my getEncodeAssociatedSalespersonID() method in my
> ActionForm and it doesn't appear that it is being called. Isn't this
> supposed to be evaluated.
> 
> My understanding is that if the key of the option matches the evaluated
> value of the 'value' attribute of the html:select, it should show as
> SELECTED.
> 
> Is that true? What am I doing wrong?
> 
> TIA,
> hunter
> 
> 
> -
> 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 Not 'Selecting' My Item

2003-08-18 Thread Hunter Hillegas
The HTML generated for the  looks as follows:

 
Jobs, Steve
Bob, Darin
Bob, Philip
Bob, Glenn
 

None of the options are selected. In this example the
getEncodeAssociatedSalespersonID() returns Bob-7. I also tried it retunring
'Bob, Darin'. Still, the item is not selected.

> From: "James Childers" <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Mon, 18 Aug 2003 14:44:53 -0500
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Subject: RE: html:select Not 'Selecting' My Item
> 
> Don't rely on debug output when dealing with getters and setters for Forms.
> It's been my experience that this can be deceptive, since Struts apparently
> uses reflection when dealing with Form member variables.
> 
> What HTML is being generated for your  tag, and are any of the
> associated  tags set to selected="selected"?
> 
> -= J
> 
>> -Original Message-
>> From: Hunter Hillegas [mailto:[EMAIL PROTECTED]
>> Sent: Monday, August 18, 2003 2:37 PM
>> To: Struts List; Craig Margenau
>> Subject: Re: html:select Not 'Selecting' My Item
>> 
>> 
>> Yes, associatedSalespeople is set in an Action. The list
>> displays properly,
>> that's not a problem.
>> 
>> The only issue is that the correct item isn't selected.
>> 
>> associatedSalespeople is a TreeMap with key/value pairs. The value of
>> 'encodeAssociatedSalespersonID' matches one of the keys but
>> it doesn't seem
>> that this property is evaluated at all since the debug output is never
>> printed to the log.
>> 
>> Hunter
>> 
>>> From: Craig Margenau <[EMAIL PROTECTED]>
>>> Reply-To: "Struts Users Mailing List"
>> <[EMAIL PROTECTED]>
>>> Date: Mon, 18 Aug 2003 15:16:13 -0400
>>> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>>> Subject: Re: Re: html:select Not 'Selecting' My Item
>>> 
>>> Looks like you are doing the same thing I am just in a
>> slightly different
>>> manner.  I prepopulate default values for my action form in
>> my action class,
>>> including an ArrayList named statusList to hold dropdown
>> values, rather than
>>> using a separate request attribute..that being the only
>> difference that I can
>>> see.
>>> 
>>> My statusList ArrayList hold an array of a simple "Status"
>> class that defines
>>> an "id" and "value" attribute.  One of my action form
>> attributes is "statusId"
>>> and is the value I prepopulate in my action calss and wish
>> to be selected when
>>> my form is displayed.
>>> 
>>> 
>>> The object 'assocatedSalespeople" that your  html:option
>> collection param is
>>> referring to is supposed to be a jsp scripting
>> variable...I'm assuming you've
>>> set this elsewhere in your jsp's code?
> 
> -
> 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 Not 'Selecting' My Item

2003-08-18 Thread Yee, Richard K,,DMDCWEST
Hunter,
Do you have an associatedSalesperson attribute in your FormBean? If so, what
is it's value? You shouldn't really have to use the value attribute if you
set the associatedSalesperson attribute to the desired id in 
associatedSalesPeople.

-Richard

-Original Message-
From: Hunter Hillegas [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 15, 2003 9:04 AM
To: Struts List
Subject: html:select Not 'Selecting' My Item


I have an html:select tag that isn't playing along...

I pre-populate a form in an action. I also create a TreeMap and add it to
the request scope.

I have the following in my JSP:







The problem is not that the map doesn't display as options, they do, that is
fine. The problem is that the correct item isn't highlighted. No item is
highlighted (default, top item).

I have a println() in my getEncodeAssociatedSalespersonID() method in my
ActionForm and it doesn't appear that it is being called. Isn't this
supposed to be evaluated.

My understanding is that if the key of the option matches the evaluated
value of the 'value' attribute of the html:select, it should show as
SELECTED.

Is that true? What am I doing wrong?

TIA,
hunter


-
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 Not 'Selecting' My Item

2003-08-18 Thread Craig R. McClanahan
On Mon, 18 Aug 2003, James Childers wrote:

>
> Don't rely on debug output when dealing with getters and setters for
> Forms. It's been my experience that this can be deceptive, since Struts
> apparently uses reflection when dealing with Form member variables.
>

While it is true that reflection is used, the property getter and setter
methods are still called.  Struts does not introspect the instance
variables of the bean; indeed, it does not care whether there even is such
a thing.  All it cares about is the getter and setter Method values
returned in the PropertyDescriptor for a particular property.

Craig

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



RE: html:select Not 'Selecting' My Item

2003-08-18 Thread James Childers
Don't rely on debug output when dealing with getters and setters for Forms. It's been 
my experience that this can be deceptive, since Struts apparently uses reflection when 
dealing with Form member variables.

What HTML is being generated for your  tag, and are any of the associated 
 tags set to selected="selected"?

-= J

> -Original Message-
> From: Hunter Hillegas [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 18, 2003 2:37 PM
> To: Struts List; Craig Margenau
> Subject: Re: html:select Not 'Selecting' My Item
> 
> 
> Yes, associatedSalespeople is set in an Action. The list 
> displays properly,
> that's not a problem.
> 
> The only issue is that the correct item isn't selected.
> 
> associatedSalespeople is a TreeMap with key/value pairs. The value of
> 'encodeAssociatedSalespersonID' matches one of the keys but 
> it doesn't seem
> that this property is evaluated at all since the debug output is never
> printed to the log.
> 
> Hunter
> 
> > From: Craig Margenau <[EMAIL PROTECTED]>
> > Reply-To: "Struts Users Mailing List" 
> <[EMAIL PROTECTED]>
> > Date: Mon, 18 Aug 2003 15:16:13 -0400
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Subject: Re: Re: html:select Not 'Selecting' My Item
> > 
> > Looks like you are doing the same thing I am just in a 
> slightly different
> > manner.  I prepopulate default values for my action form in 
> my action class,
> > including an ArrayList named statusList to hold dropdown 
> values, rather than
> > using a separate request attribute..that being the only 
> difference that I can
> > see.
> > 
> > My statusList ArrayList hold an array of a simple "Status" 
> class that defines
> > an "id" and "value" attribute.  One of my action form 
> attributes is "statusId"
> > and is the value I prepopulate in my action calss and wish 
> to be selected when
> > my form is displayed.
> > 
> > 
> > The object 'assocatedSalespeople" that your  html:option 
> collection param is
> > referring to is supposed to be a jsp scripting 
> variable...I'm assuming you've
> > set this elsewhere in your jsp's code?

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



Re: html:select Not 'Selecting' My Item

2003-08-18 Thread Hunter Hillegas
Yes, associatedSalespeople is set in an Action. The list displays properly,
that's not a problem.

The only issue is that the correct item isn't selected.

associatedSalespeople is a TreeMap with key/value pairs. The value of
'encodeAssociatedSalespersonID' matches one of the keys but it doesn't seem
that this property is evaluated at all since the debug output is never
printed to the log.

Hunter

> From: Craig Margenau <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Mon, 18 Aug 2003 15:16:13 -0400
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Subject: Re: Re: html:select Not 'Selecting' My Item
> 
> Looks like you are doing the same thing I am just in a slightly different
> manner.  I prepopulate default values for my action form in my action class,
> including an ArrayList named statusList to hold dropdown values, rather than
> using a separate request attribute..that being the only difference that I can
> see.
> 
> My statusList ArrayList hold an array of a simple "Status" class that defines
> an "id" and "value" attribute.  One of my action form attributes is "statusId"
> and is the value I prepopulate in my action calss and wish to be selected when
> my form is displayed.
> 
> 
> The object 'assocatedSalespeople" that your  html:option collection param is
> referring to is supposed to be a jsp scripting variable...I'm assuming you've
> set this elsewhere in your jsp's code?
> 
> 
> -
> 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: Re: html:select Not 'Selecting' My Item

2003-08-18 Thread Craig Margenau
Looks like you are doing the same thing I am just in a slightly different manner.  I 
prepopulate default values for my action form in my action class, including an 
ArrayList named statusList to hold dropdown values, rather than using a separate 
request attribute..that being the only difference that I can see.

My statusList ArrayList hold an array of a simple "Status" class that defines an "id" 
and "value" attribute.  One of my action form attributes is "statusId" and is the 
value I prepopulate in my action calss and wish to be selected when my form is 
displayed.


The object 'assocatedSalespeople" that your  html:option collection param is referring 
to is supposed to be a jsp scripting variable...I'm assuming you've set this elsewhere 
in your jsp's code?


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



Re: html:select Not 'Selecting' My Item

2003-08-18 Thread Hunter Hillegas
Thanks but I think I am trying to do something a little different.

The method I need called to evaluate which item is selected isn't getting
called... getEncodeAssociatedSalespersonID() has some logging stuff in it
that never gets printed...

Any idea what I am doing wrong?

> From: Craig Margenau <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Mon, 18 Aug 2003 11:47:08 -0400
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Subject: Re: html:select Not 'Selecting' My Item
> 
> I do mine like this, haven't had a problem yet.
> 
>  />
> 
> 
> 
> 
> 
>> 
>> From: Hunter Hillegas <[EMAIL PROTECTED]>
>> Date: 2003/08/18 Mon AM 11:38:10 EDT
>> To: Struts List <[EMAIL PROTECTED]>
>> Subject: html:select Not 'Selecting' My Item
>> 
>> I sent a similar question to the list last week and didn't see any
>> responses. I'm resending as I'm still having this problem.
>> 
>> I have an html:select tag that isn't playing along...
>> 
>> I pre-populate a form in an action. I also create a TreeMap and add it to
>> the request scope.
>> 
>> I have the following in my JSP:
>> 
>> > name="sampleRequestCompleteForm" value="encodeAssociatedSalespersonID">
>> 
>> > labelProperty="value"/>
>> 
>> 
>> 
>> The problem is not that the map doesn't display as options, they do, that is
>> fine. The problem is that the correct item isn't highlighted. No item is
>> highlighted (default, top item).
>> 
>> I have a println() in my getEncodeAssociatedSalespersonID() method in my
>> ActionForm and it doesn't appear that it is being called. Isn't this
>> supposed to be evaluated?
>> 
>> My understanding is that if the key of the option matches the evaluated
>> value of the 'value' attribute of the html:select, it should show as
>> SELECTED.
>> 
>> Is that true? What am I doing wrong?
>> 
>> TIA,
>> hunter
>> 
>> 
>> -
>> 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 Not 'Selecting' My Item

2003-08-18 Thread Craig Margenau
I do mine like this, haven't had a problem yet.




  


> 
> From: Hunter Hillegas <[EMAIL PROTECTED]>
> Date: 2003/08/18 Mon AM 11:38:10 EDT
> To: Struts List <[EMAIL PROTECTED]>
> Subject: html:select Not 'Selecting' My Item
> 
> I sent a similar question to the list last week and didn't see any
> responses. I'm resending as I'm still having this problem.
> 
> I have an html:select tag that isn't playing along...
> 
> I pre-populate a form in an action. I also create a TreeMap and add it to
> the request scope.
> 
> I have the following in my JSP:
> 
>  name="sampleRequestCompleteForm" value="encodeAssociatedSalespersonID">
> 
>  labelProperty="value"/>
> 
> 
> 
> The problem is not that the map doesn't display as options, they do, that is
> fine. The problem is that the correct item isn't highlighted. No item is
> highlighted (default, top item).
> 
> I have a println() in my getEncodeAssociatedSalespersonID() method in my
> ActionForm and it doesn't appear that it is being called. Isn't this
> supposed to be evaluated?
> 
> My understanding is that if the key of the option matches the evaluated
> value of the 'value' attribute of the html:select, it should show as
> SELECTED.
> 
> Is that true? What am I doing wrong?
> 
> TIA,
> hunter
> 
> 
> -
> 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 Not 'Selecting' My Item

2003-08-18 Thread Hunter Hillegas
I sent a similar question to the list last week and didn't see any
responses. I'm resending as I'm still having this problem.

I have an html:select tag that isn't playing along...

I pre-populate a form in an action. I also create a TreeMap and add it to
the request scope.

I have the following in my JSP:







The problem is not that the map doesn't display as options, they do, that is
fine. The problem is that the correct item isn't highlighted. No item is
highlighted (default, top item).

I have a println() in my getEncodeAssociatedSalespersonID() method in my
ActionForm and it doesn't appear that it is being called. Isn't this
supposed to be evaluated?

My understanding is that if the key of the option matches the evaluated
value of the 'value' attribute of the html:select, it should show as
SELECTED.

Is that true? What am I doing wrong?

TIA,
hunter


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



html:select Not 'Selecting' My Item

2003-08-15 Thread Hunter Hillegas
I have an html:select tag that isn't playing along...

I pre-populate a form in an action. I also create a TreeMap and add it to
the request scope.

I have the following in my JSP:







The problem is not that the map doesn't display as options, they do, that is
fine. The problem is that the correct item isn't highlighted. No item is
highlighted (default, top item).

I have a println() in my getEncodeAssociatedSalespersonID() method in my
ActionForm and it doesn't appear that it is being called. Isn't this
supposed to be evaluated.

My understanding is that if the key of the option matches the evaluated
value of the 'value' attribute of the html:select, it should show as
SELECTED.

Is that true? What am I doing wrong?

TIA,
hunter


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



Re: RE: validating a html:select box

2003-08-14 Thread David G. Friedman
Erez,

In that field validation, you can overload the sentence given back on that error.  
After  add something like:



Then just add an application resource line such as:
month.too.short=Please select a valid month.
Or
month.too.short=Please select a valid {0}
to show the field name you put as arg0 in your validations xml configuration file.

Regards,
David

---Original Message---
From: Erez Efrati <[EMAIL PROTECTED]>
Sent: 08/06/03 03:06 PM
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: RE: validating a html:select box

> 
> I guess I'd have to change the msg key to something else than the
default message telling the value is out of range. 
What happens with html:radio? Is this also the way also to validate
radio options? If no radio is selected (and I know this is off topic,
well a bit) would the browser send a value?

Thanks,
Erez

-Original Message-
From: David G. Friedman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 4:59 PM
To: Struts Users Mailing List
Subject: Re: validating a html:select box

Erez,

The Struts Validator has an intRange function.  It's in the Validator
User Guide: 
http://jakarta.apache.org/struts/userGuide/dev_validator.html

Here's an example from that page so you can set your min & max as 1 & 12
to prevent the zero (label "month"?) from being submitted:






min
10


max
20




---Original Message---
From: Erez Efrati <[EMAIL PROTECTED]>
Sent: 08/06/03 02:41 PM
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: validating a html:select box

> 
> I have a selection box with options where the first is valued 0 (=not
selected) with some label saying: "month". How can I use the Struts
validator to validate the user has actually chosen a value other than 0?
Do I have to write one of my own? I wish the validwhen was around...

By the way the 'birthMonth' is an int (not a string).

Here is a snip of my page:















Thanks a lot,
Erez



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



iterate over collection a show the inner collection as html:select - how ?

2003-08-14 Thread Stefan Berger
Hi,
 
I guess this problem is many time solved but i cant find the solution.
 
I put into the session a collection. Each members is a class. In this
class i have normal member like
name, street, and this class has another collection ! 
 
 
Now i want to iterate over the main - collection and the second (inner
collection) i want to present
as a html:select:
 
The simple String i can write but i cant show the selection, what i do
wrong.
Sorry for my easy question, i don't see the solution.
 
Thanks for hints !!!
 
Regards Stefan
 
 
[CODE]
 


 





  



















 Kb





Re: Trouble With html:select

2003-08-14 Thread Hunter Hillegas
I was under the impression that the value tag was used to determine which
option to match up...

Hunter

> From: Wendy Smoak <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Thu, 14 Aug 2003 16:38:05 -0700
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Subject: RE: Trouble With html:select
> 
> Hunter wrote:
>> I have an html:select tag that isn't playing along...
>> > I have a println() in my getEncodeAssociatedSalespersonID() method
> 
> Wouldn't that method need to be getAssociatedSalesperson() ?  Or else change
> the property in the  to match.
> 
> -- 
> Wendy Smoak
> Applications Systems Analyst, Sr.
> Arizona State University, PA, IRM
> 


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



RE: Trouble With html:select

2003-08-14 Thread Wendy Smoak
Hunter wrote:
> I have an html:select tag that isn't playing along...
>  I have a println() in my getEncodeAssociatedSalespersonID() method 

Wouldn't that method need to be getAssociatedSalesperson() ?  Or else change
the property in the  to match.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM 


Trouble With html:select

2003-08-14 Thread Hunter Hillegas
I have an html:select tag that isn't playing along...

I pre-populate a form in an action. I also create a TreeMap and add it to
the request scope.

I have the following in my JSP:







The problem is not that the map doesn't display as options, they do, that is
fine. The problem is that the correct item isn't highlighted. No item is
highlighted (default, top item).

I have a println() in my getEncodeAssociatedSalespersonID() method in my
ActionForm and it doesn't appear that it is being called.

What am I doing wrong?

TIA,
hunter


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



Re: iterate over collection a show the inner collection as html:select - how ?

2003-08-14 Thread Julie . Huang
I think something wrong with your selection code. I assume you want to 
present a selection of email list.

try the following:

[CODE]
 


 



==> change to :  

 

 ==> change to   

 






















"Stefan Berger" <[EMAIL PROTECTED]>
08/12/03 09:22 AM
Please respond to "Struts Users Mailing List"

 
To: <[EMAIL PROTECTED]>
cc: 
Subject:iterate over collection a show the inner collection as 
html:select - how ?


Hi,
 
I guess this problem is many time solved but i cant find the solution.
 
I put into the session a collection. Each members is a class. In this
class i have normal member like
name, street, and this class has another collection ! 
 
 
Now i want to iterate over the main - collection and the second (inner
collection) i want to present
as a html:select:
 
The simple String i can write but i cant show the selection, what i do
wrong.
Sorry for my easy question, i don't see the solution.
 
Thanks for hints !!!
 
Regards Stefan
 
 
[CODE]
 


 



==> change to :  

 

 ==> change to   

 



















 Kb










"Stefan Berger" <[EMAIL PROTECTED]>
08/12/03 09:22 AM
Please respond to "Struts Users Mailing List"

 
To: <[EMAIL PROTECTED]>
cc: 
Subject:iterate over collection a show the inner collection as 
html:select - how ?


Hi,
 
I guess this problem is many time solved but i cant find the solution.
 
I put into the session a collection. Each members is a class. In this
class i have normal member like
name, street, and this class has another collection ! 
 
 
Now i want to iterate over the main - collection and the second (inner
collection) i want to present
as a html:select:
 
The simple String i can write but i cant show the selection, what i do
wrong.
Sorry for my easy question, i don't see the solution.
 
Thanks for hints !!!
 
Regards Stefan
 
 
[CODE]
 


 



==> change to :  

 

 ==> change to   

 



















 Kb







= = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = 
This transmittal and any attachments may contain confidential, privileged or sensitive 
information and is solely for the use of the intended recipient. If you are not 
intended recipient, you are hereby notified that you have received this transmittal 
and any such attachments in error and any review, dissemination, distribution or 
copying thereof is strictly prohibited. If you have received this transmittal and any 
attachments in error please notify the sender and immediately destroy the message and 
all its attachments. Any opinions herein expressed may be those of the author and not 
necessarily of Mizuho Corporate Bank, Ltd (the "Bank"). The Bank accepts no 
responsibility for the accuracy or completeness of any information herein contained.
= = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = 



RE: validating a html:select box

2003-08-14 Thread Erez Efrati
I guess I'd have to change the msg key to something else than the
default message telling the value is out of range. 
What happens with html:radio? Is this also the way also to validate
radio options? If no radio is selected (and I know this is off topic,
well a bit) would the browser send a value?

Thanks,
Erez

-Original Message-
From: David G. Friedman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 4:59 PM
To: Struts Users Mailing List
Subject: Re: validating a html:select box

Erez,

The Struts Validator has an intRange function.  It's in the Validator
User Guide: 
http://jakarta.apache.org/struts/userGuide/dev_validator.html

Here's an example from that page so you can set your min & max as 1 & 12
to prevent the zero (label "month"?) from being submitted:






min
10


max
20




---Original Message---
From: Erez Efrati <[EMAIL PROTECTED]>
Sent: 08/06/03 02:41 PM
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: validating a html:select box

> 
> I have a selection box with options where the first is valued 0 (=not
selected) with some label saying: "month". How can I use the Struts
validator to validate the user has actually chosen a value other than 0?
Do I have to write one of my own? I wish the validwhen was around...

By the way the 'birthMonth' is an int (not a string).

Here is a snip of my page:















Thanks a lot,
Erez



-
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: validating a html:select box

2003-08-14 Thread David G. Friedman
Erez,

The Struts Validator has an intRange function.  It's in the Validator User Guide: 
http://jakarta.apache.org/struts/userGuide/dev_validator.html

Here's an example from that page so you can set your min & max as 1 & 12 to prevent 
the zero (label "month"?) from being submitted:






min
10


max
20




---Original Message---
From: Erez Efrati <[EMAIL PROTECTED]>
Sent: 08/06/03 02:41 PM
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: validating a html:select box

> 
> I have a selection box with options where the first is valued 0 (=not
selected) with some label saying: "month". How can I use the Struts
validator to validate the user has actually chosen a value other than 0?
Do I have to write one of my own? I wish the validwhen was around...

By the way the 'birthMonth' is an int (not a string).

Here is a snip of my page:















Thanks a lot,
Erez



-
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: RE: RE: validating a html:select box

2003-08-14 Thread David G. Friedman
Erez,

Good point, a number of validator-rules.xml entries seem skewed toward text or 
textarea, not necessarily the other types.  I've updated my validator-rules.xml and 
got it to work for a single choice "select" with one problem:
The error message is pulling null in for the min and max so it's reading like: 
Month must be in the range null through null.

For now, I've overloaded that using a message resource that only asks for {0} (the 
field name) not the min/max.

If you want my validator-rules.xml that does this single-choice (not multiple) selects 
for intRange, email me off-list.

Note: Tiles maintainers, can you drop me a line so I can submit this after I test it 
on a few more browsers (not just my IE but Opera and Netscape) for possible inclusion 
in the next nightly build - Does tiles do nightly builds?

Regards,
David

---Original Message---
From: Erez Efrati <[EMAIL PROTECTED]>
Sent: 08/06/03 03:38 PM
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: RE: RE: validating a html:select box

> 
> For some reason, the javascript for intRange is not working if the
property is a selection . I looked in the javascript code
(I am new to that still) but I saw that it only checks for the range if
the field is a text or textarea. Is this true? How can I perform the
client validation for selection boxes? Change the javascript?

Erez

-Original Message-
From: David G. Friedman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 5:22 PM
To: Struts Users Mailing List
Subject: Re: RE: validating a html:select box

Erez,

In that field validation, you can overload the sentence given back on
that error.  After  add something like:



Then just add an application resource line such as:
month.too.short=Please select a valid month.
Or
month.too.short=Please select a valid {0}
to show the field name you put as arg0 in your validations xml
configuration file.

Regards,
David

---Original Message---
From: Erez Efrati <[EMAIL PROTECTED]>
Sent: 08/06/03 03:06 PM
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: RE: validating a html:select box

> 
> I guess I'd have to change the msg key to something else than the
default message telling the value is out of range. 
What happens with html:radio? Is this also the way also to validate
radio options? If no radio is selected (and I know this is off topic,
well a bit) would the browser send a value?

Thanks,
Erez

-Original Message-
From: David G. Friedman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 4:59 PM
To: Struts Users Mailing List
Subject: Re: validating a html:select box

Erez,

The Struts Validator has an intRange function.  It's in the Validator
User Guide: 
http://jakarta.apache.org/struts/userGuide/dev_validator.html

Here's an example from that page so you can set your min & max as 1 & 12
to prevent the zero (label "month"?) from being submitted:

---Original Message---
From: Erez Efrati <[EMAIL PROTECTED]>
Sent: 08/06/03 02:41 PM
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: validating a html:select box

> 
> I have a selection box with options where the first is valued 0 (=not
selected) with some label saying: "month". How can I use the Struts
validator to validate the user has actually chosen a value other than 0?
Do I have to write one of my own? I wish the validwhen was around...

By the way the 'birthMonth' is an int (not a string).

Here is a snip of my page:











   
 






Thanks a lot,
Erez



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

  1   2   3   4   >