Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with select

 
Giomar Guevara
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to add an option named "Any Value" into a select, apart from the values already contained in an object.
I don't know how to do so...I tried to get the object from the request but it doesn't exist on it,just the "attributeList" object.

this is the select:

<nested:select property="../value" styleId="attributesSelectBoxId" title="Select an option to search attribute" accesskey="D">
<nested ptions property="../possibleValuesAsStringArray"/>
</nested:select>


----------------------------

This is the piece of the jsp where the select is displayed.

<nested resent property="attributeList">
<nested:iterate property="attributeList" indexId="counter">
<tr>
<td valign="middle" align="left" height="20">
<font class="default">
<img src="../images/spacer.gif" width="1"/><span
title="<nested:write property="fullname" />"> <nested:write property="name"/></span>
</font>
</td>
<nested:nest property="attributeType">
<input type="hidden" name="attrib" value="<nested:write property="../attributeId"/>">
<nested:equal property="name" value="single line text area">
<td valign="middle" align="left">
<nested:text property="../value" size="9" title="Enter value attribute" accesskey="T"/>
<input id="<nested:write property="../attributeId"/>" type="hidden" name="matchcase" value="">
</td>
</nested:equal>
<nested:equal property="name" value="multi line text area">
<td valign="middle" align="left">
<nested:text property="../value" size="9" title="Enter value attribute" accesskey="T"/>
<input id="<nested:write property="../attributeId"/>" type="hidden" name="matchcase" value="">
</td>
</nested:equal>
<nested:equal property="name" value="drop down menu">
<td valign="middle" align="left">
<nested:lessThan name="counter" value="5">
<nested:select property="../value" onmouseup="javascript:checkAttrib(this);" styleId="attributesSelectBoxId" title="Select an option to search attribute" accesskey="D">
<nested ptions property="../possibleValuesAsStringArray"/>
</nested:select>
</nested:lessThan>
<nested:greaterEqual name="counter" value="5">
<nested:select property="../value" title="Select an option to search attribute" accesskey="D">
<nested ptions property="../possibleValuesAsStringArray"/>
</nested:select>

</nested:greaterEqual>
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not use the nested tags, so I don't know exactly how they differ from the html tags. The two solutions that I have used for similar behavior are 1) when I populate the list on the form I add an extra entry to the front of the list or 2) in the jsp file just add a htmlption tag before the htmlptionsCollection tag.

- Brent
 
Giomar Guevara
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks! that worked out...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic