select tag and options tag. How do I use the same info, but different variables?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   josef_richberg
Posted On:   Tuesday, February 5, 2002 11:13 AM

I followed the example previously given by Ted, allowing me to fill an options tag from a database, use helper classes. I have a situation where two select/option tags are filled from the same bean call. The following code is just under my type="java.util.Collection"/> type="java.util.Collection"/> below I have the following: Specialty #1 labelProperty="label"/> Specialty #2 labelProperty="label"/> I need to differentiate between Specialty#1 and Specialty#2. How can I do this? If I change the select property it tells me it cannot find t   More>>

I followed the example previously given by Ted, allowing me to fill an options tag from a database, use helper classes. I have a situation where two select/option tags are filled from the same bean call.

The following code is just under my

			

type="java.util.Collection"/>

type="java.util.Collection"/>


below I have the following:


			
Specialty #1


labelProperty="label"/>


Specialty #2


labelProperty="label"/>



I need to differentiate between Specialty#1 and Specialty#2. How can I do this? If I change the select property it tells me it cannot find the getter method. Must I have two different methods simply to allow me to pass two different pieces of information? If I leave it the way it is, I get two "spec" variables in my "GET".    <<Less

Re: select tag and options tag. How do I use the same info, but different variables?

Posted By:   Ted_Husted  
Posted On:   Tuesday, February 12, 2002 04:35 PM

HTML does allow parameters with duplicate name,
and Struts will captures those like any other property
if an array is used.



private String[] spec = {"",""};
public String[] getSpec() {
return this.spec;
}
public void setSpec(String spec[]) {
this.spec = spec;
}

HTH -Ted

About | Sitemap | Contact