DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14780>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14780

Utility class FIFO name value pair collection





------- Additional Comments From [EMAIL PROTECTED]  2002-11-26 18:28 -------
Here is a sample of how to use the functions.  They are useful for the 
optionsCollection tag and a bean:write tag change I will be submitting (the 
bean:write change can use generic objects as well.

    private static LabelValueList creditcodes = null;
    /**
     * calculation for credit code values
     */
    public LabelValueList getCreditcodes() {
        if (creditcodes != null)
            return creditcodes;
        creditcodes = new LabelValueList();
        creditcodes.add("","Credit is OK");
        creditcodes.add("B","Credit is Bad");
        return creditcodes;
    }

    validate(ActionMapping mapping, HttpServletRequest request) {
          if (!getCreditCodes.contains(creditFormField)) {
                ... add the error ...
          }
    }


In JSP, I don't know or use EL (I don't use scriptlet either so I have no 
particular bias) will output the label corresponding to value.

    <%= LVL.lookup(value) %>


I find all of this useful and since Craig went to the trouble to create a place 
holder LabelValueBean, it seem to make sense to flesh it out.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to