You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Harald Schwarz <ha...@openforce.com> on 2010/06/21 16:05:14 UTC

Extension of ChoiceSelector

I try to extend FormTester$ChoiceSelector to support an 
org.apache.wicket.extensions.markup.html.form.select.Select SelectBox 
which uses two different kinds of SelectOptions (one for Categories and 
one for the actual object to be selected).
To set the value of the SelectBox I call:

wicketTester.getServletRequest().setParameter(
                        formComponent.getInputName(), 
"0:vehicle:category:group:1:option:1");


as can be seen in 
org.apache.wicket.util.tester.FormTester.setFormComponentValue(FormComponent<?>, 
String)

My problem is now that 
org.apache.wicket.extensions.markup.html.form.select.Select.convertInput() 
throws an Exception when the FormComponent is validated.
The method call (SelectOption)get(path) in Select.convertInput() returns 
null and that triggers the Exception.
Strangely that same call with identical path works within the application.
Is it possibly that paths are differing when working with WicketTester? 
As I don't know what else may be my mistake here.

Harald