I'm trying to implement a parameter style that allows the user to select multiple items in a list. The list is populated with data from a database. I am subclassing VelocityParameterPresentationStyle to populate the Velocity context with the database's data. So far, I can get the list box to appear with data in it and I can select multiple items in the list. But when I click the Update button at the bottom of the customization portlet, I notice that only the first item of the selection gets sent to my parameter style when I try customizing my portlet again.
The Velocity template that accompanies the parameter style generates a list of the format:
<select name="listname" size="5" multiple="multiple">
<option selected>value1</option>
<option>value2</option>
<option selected>value3</option>
...
</select>From what I understand, when a list with multiple selections (like the HTML above) is submitted in a form, the values are multiple values are comma-separated. So for the list above, the submitted form would have the following line:
listname=value1,value3
My question is why does Jetspeed only return the first selected item instead of all of them in the parameter style's value attribute? In particular, I am referring to the value parameter in the VelocityParameterPresentationStyle's buildNormalContext(rundata, name, value, parms, context) method. Is there a way to get the data that gets submitted to the customizer portlet's form before it gets processed (and possibly altered) by Jetspeed? Basically, I'm trying to get the same behavior as the ListBox parameter style, but the list's items must come from a database and not be manually typed into the registry.
Any help or advice would be greatly appreciated. Thanks in advance.
- Michael James
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
