[ https://issues.apache.org/jira/browse/WICKET-486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491825 ]
Jean-Baptiste Quenot commented on WICKET-486: --------------------------------------------- As always, a small quickstart, or a unit test is more than welcome. > NullPointerException when using CheckGroup and a Validator > ---------------------------------------------------------- > > Key: WICKET-486 > URL: https://issues.apache.org/jira/browse/WICKET-486 > Project: Wicket > Issue Type: Bug > Components: wicket > Affects Versions: 1.2.5 > Environment: tomcat 5.5, java 1.5 > Reporter: Ivana Cace > > Problem occurs when using a listView with a checkgroup in the same form with > a input Validator. When the Validator detects invalid input *and* no items > from the CheckGroup were selected, Wicket throws a NullPointer Exception on > the first ListView item. > Specifically, in the Check class, the group.getInputAsArray() returns null > and causes the NPE: > if (group.hasRawInput()) { > final String[] input = group.getInputAsArray(); > for (int i = 0; i < input.length; i++) > { .... > > The problem is solved by overriding the isNullable() method for CheckGroup to > return false. > @Override > public boolean isInputNullable() { > return false; > } > Apologies for describing symptoms rather than mechanism. More experienced > programmers in the office think the model for CheckGroup is not attached or > detached properly when used in conjunction with the (Pattern)Validator. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.