Use a For component to wrap a Checkbox component instead of printing
static HTML checkboxes. Your "MyComponent" will contain the For and
Checkbox components and can still take the set of values as a parameter
(and you won't need a custom renderComponent implementation).
-Ryan
Ovidiu Hurducas wrote:
Hi,
I’ve built a custom component that looks like this:
public class MyComponent extends AbstractComponent {
public abstract Set<String> getMySet();
public void renderComponent(IMarkupWriter writer, IRequestCycle cycle) {
for(String v: getMySet()) {
. . .
writer.begin("input");
writer.attribute("type","checkbox");
. . .
}
}
}
the jwc file looks like this:
<component-specification class="…MyComponent " allow-body="no">
<parameter name="mySet" required="yes"/>
</component-specification>
So I have an AbstractComponent that renders some checkboxes using a
Set of strings. The question is:
How to update the parameter, based on the selected checkboxes, to
force a change to the bound page property?
In the documentation said that the parameter uses an instance of
IBinding that it is used to read or update the property. Can you point
me to an example how to do this parameter updating?
How can I read the values from the rendered checkboxes to update the
parameter?
Thanks!
Ovidiu
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]