I have a List-Component and after sending a Form-Request it shows me the error:
java.lang.IllegalStateException: Attempt to set model object on null model of
component: mainPanel:taggingBereich:addTagging:taggingList
at org.apache.wicket.Component.setDefaultModelObject(Component.java:3038)
That's the specific List
// Component
taggingList = new ListMultipleChoice<Integer>("taggingList", choices,
renderer).setMaxRows(10);
taggingList.setOutputMarkupId(true);
// Setting Model
choices.setObject(new ArrayList<Integer>(tagging.keySet()));
// Model-Variable
IModel<List<? extends Integer>> choices;
// IChoiceRenderer
renderer = new IChoiceRenderer<Integer>() {
public Object getDisplayValue(Integer arg0) {
return tagging.get(arg0);
}
public String getIdValue(Integer arg0, int arg1) {
return arg0.toString();
}
};
choices = Model.of((List<Integer>) new ArrayList<Integer>(tagging.keySet()));
The "of" Method is "crossed out" by eclipse due to some reason I can't
recognize -- But it works.
Only after submitting the form I get this error (above)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]