Reputation: 7423
We user Wicket 6 and usually are fine with POJO objects and PropertyModel to access model attributes. Now instead of a POJO I want to use a Map, how can I do that?
Instead of
form.add(new TextField<String>("fieldName", new PropertyModel<String>(pojo, "fieldName")));
I want to use something like
form.add(new TextField<String>("fieldName", new MapModel<String>(map, "field.name")));
Is there any Wicket class to do that?
Upvotes: 1
Views: 1702
Reputation: 17513
I think the following should do the job:
form.add(new TextField<String>("fieldName", new PropertyModel<String>(map, "keyName")));
Upvotes: 2