wicket-bootstrap
wicket-bootstrap copied to clipboard
CompoundPropertyModel and BootstrapCheckbox(String id) constructor
When using BootstrapCheckbox with id only constructor and having set CompoundPropertyModel to the parent form, exception is thrown:
org.apache.wicket.WicketRuntimeException: Property could not be resolved for class: class cz.jaclean.pojo.Nabidka expression: checkbox
Problem is, that when no models are passed, setting check-box's model in the constructor triggers lookup by id for checkbox. Same goes for label with id post-label.
This change fixes the problem, please let me know if this change is ok and I will make a pull request.
protected void onInitialize() {
super.onInitialize();
checkbox.setModel(getModel());
if(checkbox.getLabel()!=null)
wrapper.get("label:post-label").setDefaultModel(checkbox.getLabel());
}
I'll take a look soon!
It seems I've fat fingered the commit message. This commit was about #687 .
Hi, sorry to bother, did you have a time to look into this issue? I solved it by extending the class and using the fix stated above, so no problem for me.
I guess I didn't look into it yet because I know you have a workaround and it is not urgent for you :-) Lately I'm either on vacation or busy with other things. I'll address it before the next release!