You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Maxim Solodovnik <so...@gmail.com> on 2015/11/06 12:36:16 UTC

How to set multi value in wicket tester

Hello All,

I'm currently trying to write tests for Select2MultiChoice wicketstuff
component.

Previously there was an option to set multiple values like this:
formTester.setValue(page.country, "CA,BE");

In previous version this component was based on HiddenField and everything
was working
In select2 4.0 the preferred way is to use <select> component
How can I set multiple values for select component in wickettester?
(I can't use *selectMultiple *due to option list is being opened on
component open only)

-- 
WBR
Maxim aka solomax

Re: How to set multi value in wicket tester

Posted by Maxim Solodovnik <so...@gmail.com>.
My bad, sorry, search formTester for this :(
Thanks again!

On Fri, Nov 6, 2015 at 6:29 PM, Martin Grigorov <mg...@apache.org>
wrote:

> How so?
> Your test creates the tester (WicketTester) and later uses it to create the
> FormTester: tester.newFormTester(...)
> So it is reachable
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Nov 6, 2015 at 1:26 PM, Maxim Solodovnik <so...@gmail.com>
> wrote:
>
> > The only issue with this approach: tester is private :(
> >
> > On Fri, Nov 6, 2015 at 6:22 PM, Maxim Solodovnik <so...@gmail.com>
> > wrote:
> >
> > > Great, thanks a lot!
> > >
> > > On Fri, Nov 6, 2015 at 6:21 PM, Martin Grigorov <mg...@apache.org>
> > > wrote:
> > >
> > >> Hi Maxim,
> > >>
> > >> You can use
> > >> tester.getRequest().addParameter(select2.getInputName(), "CA")
> > >> tester.getRequest().addParameter(select2.getInputName(), "BE")
> > >>
> > >> Martin Grigorov
> > >> Wicket Training and Consulting
> > >> https://twitter.com/mtgrigorov
> > >>
> > >> On Fri, Nov 6, 2015 at 12:56 PM, Maxim Solodovnik <
> solomax666@gmail.com
> > >
> > >> wrote:
> > >>
> > >> > Actually I feel I need method like:
> > >> > formTester.setValue(page.country, new String[]{"CA","BE"});
> > >> >
> > >> > Maybe someone knows how this can be done/work-arounded?
> > >> >
> > >> > On Fri, Nov 6, 2015 at 5:36 PM, Maxim Solodovnik <
> > solomax666@gmail.com>
> > >> > wrote:
> > >> >
> > >> > > Hello All,
> > >> > >
> > >> > > I'm currently trying to write tests for Select2MultiChoice
> > wicketstuff
> > >> > > component.
> > >> > >
> > >> > > Previously there was an option to set multiple values like this:
> > >> > > formTester.setValue(page.country, "CA,BE");
> > >> > >
> > >> > > In previous version this component was based on HiddenField and
> > >> > everything
> > >> > > was working
> > >> > > In select2 4.0 the preferred way is to use <select> component
> > >> > > How can I set multiple values for select component in
> wickettester?
> > >> > > (I can't use *selectMultiple *due to option list is being opened
> on
> > >> > > component open only)
> > >> > >
> > >> > > --
> > >> > > WBR
> > >> > > Maxim aka solomax
> > >> > >
> > >> >
> > >> >
> > >> >
> > >> > --
> > >> > WBR
> > >> > Maxim aka solomax
> > >> >
> > >>
> > >
> > >
> > >
> > > --
> > > WBR
> > > Maxim aka solomax
> > >
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>



-- 
WBR
Maxim aka solomax

Re: How to set multi value in wicket tester

Posted by Martin Grigorov <mg...@apache.org>.
How so?
Your test creates the tester (WicketTester) and later uses it to create the
FormTester: tester.newFormTester(...)
So it is reachable

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Nov 6, 2015 at 1:26 PM, Maxim Solodovnik <so...@gmail.com>
wrote:

> The only issue with this approach: tester is private :(
>
> On Fri, Nov 6, 2015 at 6:22 PM, Maxim Solodovnik <so...@gmail.com>
> wrote:
>
> > Great, thanks a lot!
> >
> > On Fri, Nov 6, 2015 at 6:21 PM, Martin Grigorov <mg...@apache.org>
> > wrote:
> >
> >> Hi Maxim,
> >>
> >> You can use
> >> tester.getRequest().addParameter(select2.getInputName(), "CA")
> >> tester.getRequest().addParameter(select2.getInputName(), "BE")
> >>
> >> Martin Grigorov
> >> Wicket Training and Consulting
> >> https://twitter.com/mtgrigorov
> >>
> >> On Fri, Nov 6, 2015 at 12:56 PM, Maxim Solodovnik <solomax666@gmail.com
> >
> >> wrote:
> >>
> >> > Actually I feel I need method like:
> >> > formTester.setValue(page.country, new String[]{"CA","BE"});
> >> >
> >> > Maybe someone knows how this can be done/work-arounded?
> >> >
> >> > On Fri, Nov 6, 2015 at 5:36 PM, Maxim Solodovnik <
> solomax666@gmail.com>
> >> > wrote:
> >> >
> >> > > Hello All,
> >> > >
> >> > > I'm currently trying to write tests for Select2MultiChoice
> wicketstuff
> >> > > component.
> >> > >
> >> > > Previously there was an option to set multiple values like this:
> >> > > formTester.setValue(page.country, "CA,BE");
> >> > >
> >> > > In previous version this component was based on HiddenField and
> >> > everything
> >> > > was working
> >> > > In select2 4.0 the preferred way is to use <select> component
> >> > > How can I set multiple values for select component in wickettester?
> >> > > (I can't use *selectMultiple *due to option list is being opened on
> >> > > component open only)
> >> > >
> >> > > --
> >> > > WBR
> >> > > Maxim aka solomax
> >> > >
> >> >
> >> >
> >> >
> >> > --
> >> > WBR
> >> > Maxim aka solomax
> >> >
> >>
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>
>
>
> --
> WBR
> Maxim aka solomax
>

Re: How to set multi value in wicket tester

Posted by Maxim Solodovnik <so...@gmail.com>.
The only issue with this approach: tester is private :(

On Fri, Nov 6, 2015 at 6:22 PM, Maxim Solodovnik <so...@gmail.com>
wrote:

> Great, thanks a lot!
>
> On Fri, Nov 6, 2015 at 6:21 PM, Martin Grigorov <mg...@apache.org>
> wrote:
>
>> Hi Maxim,
>>
>> You can use
>> tester.getRequest().addParameter(select2.getInputName(), "CA")
>> tester.getRequest().addParameter(select2.getInputName(), "BE")
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Fri, Nov 6, 2015 at 12:56 PM, Maxim Solodovnik <so...@gmail.com>
>> wrote:
>>
>> > Actually I feel I need method like:
>> > formTester.setValue(page.country, new String[]{"CA","BE"});
>> >
>> > Maybe someone knows how this can be done/work-arounded?
>> >
>> > On Fri, Nov 6, 2015 at 5:36 PM, Maxim Solodovnik <so...@gmail.com>
>> > wrote:
>> >
>> > > Hello All,
>> > >
>> > > I'm currently trying to write tests for Select2MultiChoice wicketstuff
>> > > component.
>> > >
>> > > Previously there was an option to set multiple values like this:
>> > > formTester.setValue(page.country, "CA,BE");
>> > >
>> > > In previous version this component was based on HiddenField and
>> > everything
>> > > was working
>> > > In select2 4.0 the preferred way is to use <select> component
>> > > How can I set multiple values for select component in wickettester?
>> > > (I can't use *selectMultiple *due to option list is being opened on
>> > > component open only)
>> > >
>> > > --
>> > > WBR
>> > > Maxim aka solomax
>> > >
>> >
>> >
>> >
>> > --
>> > WBR
>> > Maxim aka solomax
>> >
>>
>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
WBR
Maxim aka solomax

Re: How to set multi value in wicket tester

Posted by Maxim Solodovnik <so...@gmail.com>.
Great, thanks a lot!

On Fri, Nov 6, 2015 at 6:21 PM, Martin Grigorov <mg...@apache.org>
wrote:

> Hi Maxim,
>
> You can use
> tester.getRequest().addParameter(select2.getInputName(), "CA")
> tester.getRequest().addParameter(select2.getInputName(), "BE")
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Nov 6, 2015 at 12:56 PM, Maxim Solodovnik <so...@gmail.com>
> wrote:
>
> > Actually I feel I need method like:
> > formTester.setValue(page.country, new String[]{"CA","BE"});
> >
> > Maybe someone knows how this can be done/work-arounded?
> >
> > On Fri, Nov 6, 2015 at 5:36 PM, Maxim Solodovnik <so...@gmail.com>
> > wrote:
> >
> > > Hello All,
> > >
> > > I'm currently trying to write tests for Select2MultiChoice wicketstuff
> > > component.
> > >
> > > Previously there was an option to set multiple values like this:
> > > formTester.setValue(page.country, "CA,BE");
> > >
> > > In previous version this component was based on HiddenField and
> > everything
> > > was working
> > > In select2 4.0 the preferred way is to use <select> component
> > > How can I set multiple values for select component in wickettester?
> > > (I can't use *selectMultiple *due to option list is being opened on
> > > component open only)
> > >
> > > --
> > > WBR
> > > Maxim aka solomax
> > >
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>



-- 
WBR
Maxim aka solomax

Re: How to set multi value in wicket tester

Posted by Martin Grigorov <mg...@apache.org>.
Hi Maxim,

You can use
tester.getRequest().addParameter(select2.getInputName(), "CA")
tester.getRequest().addParameter(select2.getInputName(), "BE")

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Nov 6, 2015 at 12:56 PM, Maxim Solodovnik <so...@gmail.com>
wrote:

> Actually I feel I need method like:
> formTester.setValue(page.country, new String[]{"CA","BE"});
>
> Maybe someone knows how this can be done/work-arounded?
>
> On Fri, Nov 6, 2015 at 5:36 PM, Maxim Solodovnik <so...@gmail.com>
> wrote:
>
> > Hello All,
> >
> > I'm currently trying to write tests for Select2MultiChoice wicketstuff
> > component.
> >
> > Previously there was an option to set multiple values like this:
> > formTester.setValue(page.country, "CA,BE");
> >
> > In previous version this component was based on HiddenField and
> everything
> > was working
> > In select2 4.0 the preferred way is to use <select> component
> > How can I set multiple values for select component in wickettester?
> > (I can't use *selectMultiple *due to option list is being opened on
> > component open only)
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>
>
>
> --
> WBR
> Maxim aka solomax
>

Re: How to set multi value in wicket tester

Posted by Maxim Solodovnik <so...@gmail.com>.
Actually I feel I need method like:
formTester.setValue(page.country, new String[]{"CA","BE"});

Maybe someone knows how this can be done/work-arounded?

On Fri, Nov 6, 2015 at 5:36 PM, Maxim Solodovnik <so...@gmail.com>
wrote:

> Hello All,
>
> I'm currently trying to write tests for Select2MultiChoice wicketstuff
> component.
>
> Previously there was an option to set multiple values like this:
> formTester.setValue(page.country, "CA,BE");
>
> In previous version this component was based on HiddenField and everything
> was working
> In select2 4.0 the preferred way is to use <select> component
> How can I set multiple values for select component in wickettester?
> (I can't use *selectMultiple *due to option list is being opened on
> component open only)
>
> --
> WBR
> Maxim aka solomax
>



-- 
WBR
Maxim aka solomax