Details
-
Task
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
1.4.18
-
None
Description
Wickettester always submits the value of a formcomponent.
see: BaseWickettTester:1459
Its not possible to override this behavior.
Selectcomponent (wicket extension) for example expects the optionpath(s) to convert the browser input to modelvalue. The value (modelvalue) doesnt match this so unittests crash at Select:132 with IndexOutOfBoundException
please let developers override the "getValueBehavior" depending on the formcomponent:
...
String name = formComponent.getInputName();
//String value = formComponent.getValue();
String value = getRequestParameterValueForComponent(formComponent);
...
protected String getRequestParameterValueForComponent(FormComponent<?> formComponent){
return formComponent.getValue();
}
so developers can overide the method to support individual components:
protected String getRequestParameterValueForComponent(FormComponent<?> formComponent){
if (formComponent instanceof xxxx)
else
{ return super.getRequestParameterValueForComponent(formComponent); }}
Attachments
Issue Links
- duplicates
-
WICKET-4058 RadioGroup WicktTester with a AjaxSubmitLink fails
- Resolved