You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ernesto Reinaldo Barreiro <re...@gmail.com> on 2010/06/29 22:39:54 UTC

Re: Testing CheckBox.onSelectionChanged(Object newSelection) using FormTester

Isn't CheckBox using JavaScript, executed on the client, to generate
the "onclick" callback? See CheckBox.onComponentTag... e.g.

tag.put("onclick", "window.location.href='" + url +
					(url.toString().indexOf('?') > -1 ? "&amp;" : "?") + getInputName() +
					"=' + this.checked;");
Ernesto


On Tue, Jun 29, 2010 at 10:00 PM, Michael Small
<mi...@gmail.com> wrote:
>
> I'm currently trying to test my implementation of
> CheckBox.onSelectionChanged(Object newSelection) ... I've created my
> CheckBox as follows ...
>
> item.add(new CheckBox("checkBoxId") // note that model object comes thru
> compound property model
> {
>    @Override
>    protected void onSelectionChanged(final Object newSelection)
>    {
>        // my implementation code is here
>    }
>
>    @Override
>    protected boolean wantOnSelectionChangedNotifications()
>    {
>        return(true);
>    }
> });
>
> In my test, however, I can't seem to get the onSelectionChanged to fire ...
>
> formTester.setValue("checkBoxId", true);
>
> I would assume that call would result in my onSelectionChanged method being
> invoked, but that is not the case.  Any ideas?
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Testing-CheckBox-onSelectionChanged-Object-newSelection-using-FormTester-tp2272641p2272641.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org