Au-Yeung, Stella H wrote:
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]