jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grant Jokerst" <gr...@jokerst.com>
Subject Adding sort to <input:select> tag
Date Tue, 13 Aug 2002 17:35:21 GMT
   I would like to add a few enhancements to the input taglib.  I am using
the input tags to simplify building context based form elements as the user
enters data by refreshing page (and retaining entered values).  Currently
the <input:select> tag interates through the hash's keys without sorting.
This results in a random ordering of the dropdown list.  I would like to add
the following to org.apache.taglibs.input.Select.java (Select.java source
   // actually print the <option> tags (line 138)
      if (options != null) {
         Vector vecOpts = new Vector(options.keySet()); // add
         Collections.sort(vecOpts);                     // add
         Iterator i = vecOpts.iterator();               // add
         //Iterator i = options.keySet().iterator();    // replace
         while (i.hasNext()) {
            Object oKey = i.next();

I would also like to either add or change the "attributes" attribute for the
tags to accept a string of the atttributes (ex: "size=30
onchange="javascript:someFunc();").  This is easier and less clunky than
having to define a Hashtable for the "attributes" with scriptlets.  I have
other ideas too if I am given Commiter priviledges.


View raw message