ACTION CLASS { ArrayList testList = DaoClass.getArrayList(); request.setAttribute("testList",testList);
}
DAO CLASS { ArrayList testList; TestFormBean testFormBean;
while(next) { testFormBean = new TestFormBean(); testFormBean.setName(rs.get('name')); testFormBean.setId(rs.get('id'));
testList.add(testFormBean);
} return testList }
so arrayList contains objects of formbean. i am not getting what to write in all thease props..which make drop down list of db values and when user submit this dropdown it will automatically sets the formbeans values so we can get the user selected value...
The "collection" attribute is the name of the collection bean, in your case, "testList". It's not clear to me what values are in that array list, which make the remaining attributes somewhat suspicious: when using the "collection" attribute normally you'd use the "property" and "labelProperty" to identify the value and text for each option.
I didn't even know the options tag had a "value" attribute; are you sure that it does? The "name" attribute is (IIRC) only used if you're not using the ActionForm to hold the selected values.
The html:select tag "property" attribute generally identifies the ActionForm property corresponding to the input tag (again, IIRC).
I'd probably check out the documentation a little bit, also searching the web for something like "struts 1 html options tag" will show several tutorials.
casinova guy
Greenhorn
Joined: Dec 04, 2008
Posts: 4
posted
0
thanks for reply..
arraylist contain the the object of formbean ...and form bean has different attributes..
FormBean formBean = new FormBean(); formBean.setHealthSupplyCode(rs.getInt("db_column_1")); testArrayList.add(formBean);
If that was intended to give me more information with which to help, it really didn't. I believe between what I supplied and the documentation I linked to (it's more or less the same in S1.3, IIRC) there should be enough to accomplish what you need to get done.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: html:select and html:options or html:optionsCollection