struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre Métras <>
Subject <iterate> and <multibox> usage
Date Wed, 08 Nov 2000 04:53:55 GMT

Can I use the <iterate> tag, combined with <multibox> or <option> to
generate a checkbox list or select options from 2 coupled arrays or
collections (one for values, the other for display)?

This question is cited in the Old TODO, but has someone a reasonable
solution? For instance, can I remove the JSP code from the following extract
and substitute an <iterate> instead?

    String[] languageCodes = preferencesForm.getLanguageCodes();
    String[] languageNames = preferencesForm.getLanguageNames();

    for (int i = 0; i < languageCodes.length; i++)
                        <s:multibox property="spokenLanguages" value="<%=
languageCodes[i] %>" />

Then, is it possible to know where we are in the iteration to manage line
breaks (in the checkbox sample) or row coloring (in a table)?

Pierre Métras

View raw message