pre-selecting html input object values

2003-10-15 Thread Manav Gupta
Hi,

Is there a standard way to pre-select HTML input object values (such as
select, text, checkbox, etc) using struts taglibs?

Thanks
M

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



RE: HashMap with options

2003-10-14 Thread Manav Gupta
Thanks Michael, you've been a great help... 

Regards,
m

 -Original Message-
 From: Michael D. Norman [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, October 14, 2003 6:37 AM
 To: 'Struts Users Mailing List'
 Subject: RE: HashMap with options
 
 
  Could you elaborate what happens when I specify the name along with
 the
  property attribute? 
 
 The name attribute tells the bean:define/ tag what key to 
 use in the
 page/request/session/application scope.  Without it, you're trying to
 get a property from nothing.
 
  Does struts iterate through each item in the Map,
  calling get(key) and get(value) on each item in the Map?
 
 The html:options/ tag iterates over the Map's entrySet().  It then
 calls getKey() and getValue() on each Map.Entry for the options.
 
  Is there any link/website where I can read more about this?
 
 I honestly don't know.  I usually just read the source.
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 _
 This e-mail has been scanned for viruses by MCI's Internet 
 Managed Scanning Services - powered by MessageLabs. For 
 further information visit http://www.mci.com
 

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



RE: HashMap with options

2003-10-13 Thread Manav Gupta
Hi Michael,

Thanks for your reply - I'll definitely give it a go!

Could you elaborate what happens when I specify the name along with the
property attribute? Does struts iterate through each item in the Map,
calling get(key) and get(value) on each item in the Map? Is there any
link/website where I can read more about this?

Many Thanks
M

 -Original Message-
 From: Michael D. Norman [mailto:[EMAIL PROTECTED]
 Sent: Saturday, October 11, 2003 3:31 AM
 To: Struts Users Mailing List
 Subject: Re: HashMap with options
 
 
  Manav wrote:
 
  Can i use HashMap with options?
 
  something like:
 
  bean:define id=statusFilters property=statusFilters
  type=java.util.HashMap /
  html:options collection=statusFilters property=key
  labelProperty=value/
 
 Manav,
 
 Yes, you should be able to use any Map as the collection, with the
 attributes you have defined above for html:options.../.  
 However, your
 bean:define.../ needs a name attribute if you're going to 
 use the property
 attribute.
 
 -- Michael D. Norman
ProbuSoft - Custom Software Development
http://www.probusoft.com/
913-390-6951
[EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 _
 This e-mail has been scanned for viruses by MCI's Internet 
 Managed Scanning Services - powered by MessageLabs. For 
 further information visit http://www.mci.com
 

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



HashMap with options

2003-10-10 Thread Manav Gupta
Hi
 
Can i use HashMap with options?
 
something like:
 
bean:define id=statusFilters property=statusFilters
type=java.util.HashMap /
html:options collection=statusFilters property=key
labelProperty=value/
 
such that the option value is the key and the labelProperty is the value?
 
thanks
M


FW: retrieving values from multiple=true select box

2003-10-07 Thread Manav Gupta
No takers for this?

M

-Original Message-
From: Manav Gupta 
Sent: Monday, October 06, 2003 5:42 PM
To: 
Subject: retrieving values from multiple=true select box


Hi,

I'm sure this has been resolved by a thousand ppl before me, but I'm unable
to find an answer to it. I did google, but I'm at a loss I'm afraid.

So here goes: I need to retrieve all selected values from a HTML select
object, that has multiple=true set.

Here's my form bean snippet:
===
private final class TheFormBean {
 private String[] circuitTypeIDs;

  public  void setCircuitTypeIDs(String[] circuitTypeIDs)
  {
  this.circuitTypeIDs = circuitTypeIDs;
  }

  public  String[] getCircuitTypeIDs() {
   return this.circuitTypeIDs;
  }
}

  
The JSP:
===
html:select name=CircuitForm property=circuitTypeIDs multiple=true
size=3 
html:options collection=CircuitTypes property=ID
labelProperty=name/ 
/html:select


I do set the collection 'CircuitTypes' in the request in the action class
that forwards to the JSP above. 
The form-bea 'CircuitForm' has been declared in struts-config.xml (and I do
understand I don't need to mention the name of that form in the JSP).

However, when it retrieves only the *first* selected value in the select
box. What am I missing?

Deeply stressed,
M

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



retrieving values from multiple=true select box

2003-10-06 Thread Manav Gupta
Hi,
 
I'm sure this has been resolved by a thousand ppl before me, but I'm unable
to find an answer to it. I did google, but I'm at a loss I'm afraid.
 
So here goes: I need to retrieve all selected values from a HTML select
object, that has multiple=true set.
 
Here's my form bean snippet:
===
private final class TheFormBean {
 private String[] circuitTypeIDs;
 
  public  void setCircuitTypeIDs(String[] circuitTypeIDs)
  {
  this.circuitTypeIDs = circuitTypeIDs;
  }
 
  public  String[] getCircuitTypeIDs() {
   return this.circuitTypeIDs;
  }
}
 
  
The JSP:
===
html:select name=CircuitForm property=circuitTypeIDs multiple=true
size=3 
html:options collection=CircuitTypes property=ID
labelProperty=name/ 
/html:select
 
 
I do set the collection 'CircuitTypes' in the request in the action class
that forwards to the JSP above. 
The form-bea 'CircuitForm' has been declared in struts-config.xml (and I do
understand I don't need to mention the name of that form in the JSP).
 
However, when it retrieves only the *first* selected value in the select
box. What am I missing?
 
Deeply stressed,
M