Hi,
good solution, but how does it work using a ListView ??
I tried:
Select select = new Select("selectId");
select.add(new ListView("selGrpId", list) {
OptGroup optGrp = null;
@Override
protected void populateItem(ListItem item) {
MyBean bean = (DachGroupSelectBoxBean)
item.getModelObject();
if (grpSelBean.getType() == NONE)
item.add(new
CustomSelectOption("option", bean.getName()));
else if (grpSelBean.getType() == PARENT)
item.add(optGrp = new
OptGroup("optGroup", bean.getName()));
else if (grpSelBean.getType() == CHILD)
optGrp.add(new
CustomSelectOption("grpOption", bean.getName()));
}
}
);
add(select);
Markup:
<select wicket:id="selectId" >
<div wicket:id="selGrpId">
<option wicket:id="option"/>
<optgroup wicket:id="optGroup">
<option wicket:id="grpOption">DummyText</option>
</optgroup >
</div>
</select>
Error message:
WicketMessage: Unable to find component with id 'optGroup' in
[MarkupContainer [Component id = 0]]. This means that you declared
wicket:id=optGroup in your markup, but that you either did not add the
component to your page at all, or that the hierarchy does not match.
What I'm doing wrong?
Some hints?
Thanks!
Ralph
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Dynamic-Select-and-SelectOptions-tp1872483p3309097.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]