Bug 26914 - not value created in option list if value is equal to key
Summary: not value created in option list if value is equal to key
Status: RESOLVED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Input Taglib (show other bugs)
Version: unspecified
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-13 13:52 UTC by Massimo Ferrario
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Massimo Ferrario 2004-02-13 13:52:07 UTC
Hi,
this is the problem:
I  created a Map of number; every key is equal to value.
Using this map inside the <input:select> tag I saw that no values are created.
Looking at the tablib source code I have noticed that there is an explicit line 
of code (approx line 222 of org.apache.taglibs.input.java) where test if key 
equals value, in this cause value is not written.
This, in my opinion, could generate problem if there is, in jsp page, a 
javascript validation funciont related to select box. 
No problem, instead, if I submit the form without validation.

This is a piece of my code:

Map m = new Hashtable();
m.put("1","1");
m.put("2","2");
m.put("3","3");

<input:select name="choice" options="<%= m %>"/>

Thanks in advance for suggestion to solve this problem.
Massimo
Comment 1 Karl von Randow 2004-10-26 23:15:09 UTC
Sorry for the extremely slow response. This has been fixed and committed to 
the CVS. The value will now be output unless no value is provided (ie. null, 
or missing value attribute on input:option tag).