You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marcus Biel <Ma...@bmw.de> on 2002/10/16 12:08:30 UTC

dynamic select box

Hi,

I am still trying to get this dynamic select box created.

Well, now I had a CLOSE look at the Struts documentation about
<html:options tag.

The collection attribute is interpreted as the name of a JSP bean, in
some scope, that itself represents a collection of individual beans, one
per option value to be rendered. 

If the collection attribute is not specified:
The collection of values actually selected depends on the presence or
absence of the name and property attributes. The following combinations
are allowed:

·       Only name is specified - The value of this attribute is the name
of a
	JSP bean in some scope that is the collection. 

·       Only property is specified - The value of this attribute is the
name
	of a property of the ActionForm bean associated with our form, which
	will return the collection. 

·       Both name and property are specified - The value of the name
attribute
	identifies a JSP bean in some scope. The value of the property
attribute
	is the name of some property of that bean which will return the
	collection. 

I think that means that I will need:


a bean, that is a collection.
	how can a bean be a collection ???
or an ActionForm, that contains an getArrayList method
	how can I use that ActionFor without using form
	action="getWerke.do", that only works, when someone hit the submit
button, even though the
	select box must be created BEFORE someone hits this button.
or using a Bean, that gots a getArrayList method.

I tried the last possibility, as I don't know how to do the other cases.
I wrote a Bean that returns the ArrayList, then I wrote this in my jsp
<html:select property="werkAuswahl" size="1">
  <html:options name="WerkeListBean" property="werkeList"/>
</html:select>

And got the following error:
javax.servlet.ServletException: Cannot find bean under name
org.apache.struts.taglib.html.BEAN

I am desperate!!! Anyone, plz help me out how to get this damn dynamical
select box created!

bye, 
Marcus

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>