Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompoundPropertyModel and BootstrapCheckbox(String id) constructor #686

Open
vrozkovec opened this issue Jul 10, 2017 · 4 comments
Open

Comments

@vrozkovec
Copy link
Contributor

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());
}
@martin-g
Copy link
Owner

I'll take a look soon!

@martin-g martin-g reopened this Jul 26, 2017
@martin-g
Copy link
Owner

It seems I've fat fingered the commit message. This commit was about #687 .

@vrozkovec
Copy link
Contributor Author

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.

@martin-g
Copy link
Owner

martin-g commented Aug 4, 2017

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants