Hi,
My requirement is to pass the values of the selected checkboxes from a form to a PCA method. I have tried using getRequest().getParameter(“param”), but that does not seem to return me the checkbox values. Please assit.
Thanks & Regards,
Rumki
Make sure you use a jsp portlet:controller tag to draw the form. Optionally, you can use a ui:propertyLine or ui:propertyEditor tag to draw the checkboxes:
<portlet:controller method=“myPcaMethod” context=“form”>
Make sure you use a jsp portlet:controller tag to draw the form. Optionally, you can use a ui:propertyline or ui:propertyeditor tag to draw the checkboxes:
<portlet:controller method=“myPcaMethod” context=“form”>
ui:propertyline
<util:param name=“property_line_title”>My Checkboxes Title</util:param>
<util:param name=“property_line_type” value=“checkbox-multiple” />
<util:param name=“property_line_name” value=“myCheckboxes” />
<util:param name=“property_line_value” value=“foo” />
<util:param name=“values” value=“foo,bar,baz” />
<util:param name=“titles”>Foo,Bar,Baz</util:param>
</ui:propertyLine>
</portlet:controller>
In your pca method, use the portlet bean’s getProperty() method to get the form parameter values:
public void myPcaMethod() throws Exception {
Object myCheckboxes = getProperty(“myCheckboxes”);
// …
}
If I remember correctly, the myCheckboxes property should be a comma-separated list of selected checkbox values.</ui:propertyEditor></ui:propertyLine></portlet:controller>