Discussion:
Replacement for IOnChangeListeer.INTERFACE
Manfred Bergmann
2018-09-29 15:01:59 UTC
Permalink
Hi.

We’ve tested Ajax components by code like this in Wicket 7:

val languageChoice = tester.getComponentFromLastRenderedPage("languageChoice").asInstanceOf[DropDownChoice[Locale]]
tester.getRequest.getPostParameters.setParameterValue(languageChoice.getInputName, "0")
tester.invokeListener(languageChoice, IOnChangeListener.INTERFACE)
assert(testPage.getLocale == Locales.supportedLocales.head)


In Wicket 8, IOnChangeListener.INTERFACE is not available anymore.
What is the recommended equivalent for this test?



Regards,
Manfred
Sven Meier
2018-09-29 15:40:58 UTC
Permalink
Hi Manfred,

you probably already migrated from
#wantOnSelectionChangedNotifications() to a FormComponentUpdatingBehavior.

So you have to use that behavior as a listener now:

tester.invokeListener(languageChoice.getBehaviors(FormComponentUpdatingBehavior.class).get(0));

Hope this helps
Sven
Post by Manfred Bergmann
Hi.
val languageChoice = tester.getComponentFromLastRenderedPage("languageChoice").asInstanceOf[DropDownChoice[Locale]]
tester.getRequest.getPostParameters.setParameterValue(languageChoice.getInputName, "0")
tester.invokeListener(languageChoice, IOnChangeListener.INTERFACE)
assert(testPage.getLocale == Locales.supportedLocales.head)
In Wicket 8, IOnChangeListener.INTERFACE is not available anymore.
What is the recommended equivalent for this test?
Regards,
Manfred
---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Manfred Bergmann
2018-10-01 15:09:26 UTC
Permalink
Hi Sven.

I'm using the Kendo widgets. In particular the AjaxDropDownList.
It inherits from the Wicket standard DropDownChoice and hence I can add the
FormComponentUpdatingBehavior.
But that will throw a different error in the test:




Any ideas on that one?


Manfred

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Manfred Bergmann
2018-10-01 15:18:10 UTC
Permalink
OK, sorry. Forget that.
It seems to be working when adding the FormComponentUpdatingBehavior.
4 of 5 uses work. The last error I posted is probably due to something else,
model related.


Thanks,
Manfred

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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

Loading...