Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problems with select

 
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>
 
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 html:option tag before the html:optionsCollection tag.

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