Re: Is fireModelChanged mandatory ?

Franck Routier <[email protected]> Thu, 29 Sep 2005 13:43:21 +0200
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
This is a multi-part message in MIME format...

------------=_1127994251-26976-46
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

[email protected] a =E9crit :

>4) Then my last proposition would be to add this method to FormUtil :
>=20=20
>
Initial code is wrong, since what I want is to retrieve keys and values=20
out of the elements of the FormMap (of out of statemap).

So this would do the trick (eliminating tigerism as well) :

    public static Map getKeysAndValues(FormMap fm) {
    Map keyValuesMap =3D new HashMap();
        Set keys =3D fm.getElements().keySet();
        Iterator it =3D keys.iterator();
        while (it.hasNext()) {
            String key =3D (String) it.next();
            FormElement el =3D fm.getElement(key);
        if (el.allowMultiples()) {
        keyValuesMap.put(key, el.getVals());
        } else {
                keyValuesMap.put(key, el.getVal());
        }
    }
    return keyValuesMap;
    }


Franck


------------=_1127994251-26976-46
Content-Type: text/plain; name="message-footer.txt"
Content-Disposition: inline; filename="message-footer.txt"
Content-Transfer-Encoding: 8bit



--

Barracuda mailing list

[email protected]

http://www.objectweb.org/wws/lists/projects/barracuda


------------=_1127994251-26976-46--