I tried the following and got the same result. Is this what you mean? If I
remove the value="...." then I don't get the compilation error.
<bean:define id="eList" name="ShopWorkOrderFormBean"
property="engineerList"/>
<bean:define id="engineer" name="ShopWorkOrderFormBean"
property="shopWorkOrder.engineerId"/>
<html:select property="shopWorkOrder.engineerId"
value="<%=engineer%>">
<html:options collection="eList" name="ShopWorkOrderFormBean"
property="userId" labelproperty="commonName"/>
</html:select>
cannot resolve symbol
probably occurred due to an error in
/app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp line 93:
<html:select property="shopWorkOrder.engineerId" value="<%=engineer%>">
symbol : method setValue (java.lang.Object)
location: class org.apache.struts.taglib.html.SelectTag
_html_select0.setValue(engineer);
-----Original Message-----
From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 8:44 PM
To: Struts Users Mailing List
Subject: RE: <html:select> question
>>engineerId is an attribute in the dataBean "shopWorkOrder". Can't I
>>reference shopWorkOrder.engineerId inside the <%= %>?
>>
I guess "shopWorkOrder" is the attribute name of the bean.
The <%= %> should contain a java expression.
Use the <bean:define> to define a JSP variable and use it in <%= %>
<bean:define id="engineerId" name="shopWorkOrder" property="engineerId" />
then use <%=engineerId%> in the <html:select>.
-----Original Message-----
From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 4:49 PM
To: 'Struts Users Mailing List'
Subject: RE: <html:select> question
I got a compilation errror after I changed to using <%= %>:
Here's my error:
cannot resolve symbol
probably occurred due to an error in
/app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp line 92: <html:select
property="shopWorkOrder.engineerId"
value="<%=shopWorkOrder.engineerId%>">
My actual segment of JSP:
<bean:define id="eList" name="ShopWorkOrderFormBean"
property="engineerList"/>
<html:select property="shopWorkOrder.engineerId"
value="<%=shopWorkOrder.engineerId%>">
<html:options collection="eList" name="ShopWorkOrderFormBean"
property="userId" labelproperty="commonName"/>
</html:select>
engineerId is an attribute in the dataBean "shopWorkOrder". Can't I
reference shopWorkOrder.engineerId inside the <%= %>?
I want to compare value of "userId" in the collection with
"shopWorkOrder.engineerId".
-----Original Message-----
From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 6:45 PM
To: Struts Users Mailing List
Subject: RE: <html:select> question
Try something like this,
<bean:define id="uList" name="UserFormBean" property="userList"/>
<bean;define id="person" name="person.id" /> <html:select
property="person.id" value="<%=person%>"> <html:options collection="uList"
name="UserFormBean" property="userId"
labelproperty="commonName"/></html:select>
The "value" attribute is RT-Exp, and not name of a bean.
hth
-jayash
-----Original Message-----
From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 3:38 PM
To: '[EMAIL PROTECTED]'
Subject: <html:select> question
Hi:
I need to set a "pre-defined" option in <html:select> using the "value="
attribute, I thought the following will work:
<bean:define id="uList" name="UserFormBean" property="userList"/>
<html:select property="person.id" value="person.id"> <html:options
collection="uList" name="UserFormBean" property="userId"
labelproperty="commonName"/></html:select>
I have a "person" bean. I want to set the "selected" option if
"person.id" matches "userId" . I thought the "value" attribute is to be
compared with for marking an option selected. But the above doesn't work.
It always set the 1st option to be the "selected" option .
Am I misunderstanding the use of "value="?
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]