You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thies Edeling <th...@rrm.net> on 2009/02/18 14:45:36 UTC
FormTester.setValue accepting invalid component id's
Would it be possible for the FormTester setValue/selectMultiple etc
methods to throw a WicketRuntimeException whenever the provided id
doesn't exist?
The setValue method's source happily allows invalid formComponentId
since there's no null check, only instanceof's:
Component component = workingForm.get(formComponentId);
if (component instanceof IFormSubmittingComponent)
{
setFormSubmittingComponentValue((IFormSubmittingComponent)component, value);
}
else if (component instanceof FormComponent)
{
setFormComponentValue((FormComponent)component, value);
}
I assume that when a call to formTester.setValue is succesful the value
is set in the model but apparently it is not.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: FormTester.setValue accepting invalid component id's
Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Wed, 18 Feb 2009, Thies Edeling wrote:
> Would it be possible for the FormTester setValue/selectMultiple etc
> methods to throw a WicketRuntimeException whenever the provided id
> doesn't exist?
Yes, that would be a very good idea. For the current
versions it could still be disableable for backwards
compatibility, but from 1.5 onwards not.
Could you please file a Jira issue? Even better if it's with
a patch ;)
Best wishes,
Timo
--
Timo Rantalaiho
Reaktor Innovations Oy <URL: http://www.ri.fi/ >
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org