RadioGroup (or even RadioChoice) with Map values

2017-08-15 Thread lucast
Dear Forum,

I would like to display a group of radio choices and I will use RadioGroup
since it seems to be the fittest for my purpose. I got the implementation
example from  http://examples7x.wicket.apache.org/forminput/?
<http://examples7x.wicket.apache.org/forminput/?>  

I have, a map of key->values. On the RadioGroup, I would like to display the
value from the map as label, but when getting the RadioGroup's model object,
I would like to get the key value from the map.

The only way I thought I could implement the desired behaviour is to use
List> on the RadioGroup. However, it seems like a
convoluted workaround.

Would you have a suggestion of how to implement a RadioGroup (or even
RadioChoice) using Map rather than List?


Thanks,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-or-even-RadioChoice-with-Map-String-String-values-tp4678526.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: RadioGroup ajax update

2017-01-09 Thread Sven Meier

Hi,

that looks good to me.

Please double check that you don't have wicket:id="rg1"> and id="rg1" isn't used multiple times in your markup.


Regards
Sven


On 10.01.2017 00:21, Entropy wrote:

We have a pair od radiobuttons in our html.  They have some html around them,
and so forth.  They are not dynamic.  When the selection changes, we want an
ajax event to make other stuff visible or not.

        RadioGroup rg = new RadioGroup("rg1");
rg.add(new Radio("rg1-opt1",new 
Model("test1")).setOutputMarkupId(true));
rg.add(new Radio("rg1-opt2",new 
Model("test2")).setOutputMarkupId(true));
rg.add(new AjaxFormChoiceComponentUpdatingBehavior() {

@Override
protected void onUpdate(AjaxRequestTarget arg0) {
System.out.println("ajax here!");   
  
}

});
rg.setMarkupId("rg1");
rg.setOutputMarkupId(true);
form.add(rg);

The page renders, but the ajax event never arrives.  The static html has a
ul tag onto which the RadioGroup is mapped, and the two items of the list
are inputs of type radio bound to opt1 and 2.

So question 1, is why aren't we getting the event, and question 2 is are we
using the RadioGroup wrong?  It seems wrong.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-ajax-update-tp4676682.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



RadioGroup ajax update

2017-01-09 Thread Entropy
We have a pair od radiobuttons in our html.  They have some html around them,
and so forth.  They are not dynamic.  When the selection changes, we want an
ajax event to make other stuff visible or not.  

RadioGroup rg = new RadioGroup("rg1");
rg.add(new Radio("rg1-opt1",new 
Model("test1")).setOutputMarkupId(true));
rg.add(new Radio("rg1-opt2",new 
Model("test2")).setOutputMarkupId(true));
rg.add(new AjaxFormChoiceComponentUpdatingBehavior() {

@Override
protected void onUpdate(AjaxRequestTarget arg0) {
System.out.println("ajax here!");   

}

});
rg.setMarkupId("rg1");
rg.setOutputMarkupId(true);
form.add(rg);

The page renders, but the ajax event never arrives.  The static html has a
ul tag onto which the RadioGroup is mapped, and the two items of the list
are inputs of type radio bound to opt1 and 2.

So question 1, is why aren't we getting the event, and question 2 is are we
using the RadioGroup wrong?  It seems wrong.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-ajax-update-tp4676682.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2016-05-10 Thread Martin Grigorov
Hi Ernesto,

We are fully aware of this!
That's why the migration guide is split into "API breaks" and "Behavior
changes".
API breaks usually are easy to fix because the compiler complains about
them.
Behavior changes are not problem for Semantic Versioning but we postpone
them to major versions because of what you have said below - they are
silent and more hard to be debugged.
For all of them there is a respective discussion thread at dev@ - whether,
when and how to do them.
I know that most people are busy with their own business and family (me
included!) and don't have time to participate in discussions,
brainstorming, testing but this process is the best we can do at the
moment.
Any ideas for improving the process are always welcome!

I hope that we will release 8.0.0-M1 soon so more people like you can give
it a try and report issues and ideas for improvements before we freeze the
code for API breaks.

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

On Tue, May 10, 2016 at 9:32 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Tobias,
>
>
> > I think as long as the third party library is not Wicket 7.0 proofed you
> > should use it careful. Because of this the migration guide is very
> useful -
> > each framework should be checked when upgrade a major version.
> >
>
>
> Mind that I'm fully aware of the personal sacrifices some people make to
> deliver new versions and improve the framework. So, what I tell bellow is
> with full respect to that.
>
> I'm NOT really "complaining" let's say I'm just voicing some concerns from
> users. This is the second Wicket application I migrate to Wicket 7.0 in
> last two of months. First application was for a customer and we encountered
> a few little "surprises", e.g.
>
>
> https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+7.0#MigrationtoWicket7.0-org.apache.wicket.markup.html.panel.FeedbackPanelDonotsetCSSclassontheli
> >spanelementforafeedbackmessageWICKET-4831
>
> IMHO changes like this bring no real value and just make migrations less
> "stable". Not to mention things like this
>
>
> https://ci.apache.org/projects/wicket/guide/7.x/guide/componentQueueing.html
>
>  which might have made framework slower (according to certain post on
> list). I know that without changes there is no evolution. I'm just telling
> that maybe there is a need to make changes more gradually (e.g. deprecate
> things) and try to introduce features (if possible) in a way that they can
> be "switched off".
>
> Even on OS level there is a requirement note and sometimes API changes have
> > impact on applications and their complete compatibility.
> >
>
> IMHO users just expect things to work out of the box. More if they are just
> very satisfied with the version of the product they are using and the only
> reason they are actually migrating is just to not "fall behind". There was
> already something called Wicket 2.0 which was abandoned after a few months
> of development because, if I remember correctly, it broke too much previous
> version code base. As a user I would like not to experience something
> similar anymore.  I haven't tried yet Wicket 8.x but I'm a bit afraid it
> might be a bit disruptive for some users/applications. I will want to try
> it ASAP and give my modest feedback.
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>


Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2016-05-10 Thread Ernesto Reinaldo Barreiro
Tobias,


> I think as long as the third party library is not Wicket 7.0 proofed you
> should use it careful. Because of this the migration guide is very useful -
> each framework should be checked when upgrade a major version.
>


Mind that I'm fully aware of the personal sacrifices some people make to
deliver new versions and improve the framework. So, what I tell bellow is
with full respect to that.

I'm NOT really "complaining" let's say I'm just voicing some concerns from
users. This is the second Wicket application I migrate to Wicket 7.0 in
last two of months. First application was for a customer and we encountered
a few little "surprises", e.g.

https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+7.0#MigrationtoWicket7.0-org.apache.wicket.markup.html.panel.FeedbackPanelDonotsetCSSclassontheli
>spanelementforafeedbackmessageWICKET-4831

IMHO changes like this bring no real value and just make migrations less
"stable". Not to mention things like this

https://ci.apache.org/projects/wicket/guide/7.x/guide/componentQueueing.html

 which might have made framework slower (according to certain post on
list). I know that without changes there is no evolution. I'm just telling
that maybe there is a need to make changes more gradually (e.g. deprecate
things) and try to introduce features (if possible) in a way that they can
be "switched off".

Even on OS level there is a requirement note and sometimes API changes have
> impact on applications and their complete compatibility.
>

IMHO users just expect things to work out of the box. More if they are just
very satisfied with the version of the product they are using and the only
reason they are actually migrating is just to not "fall behind". There was
already something called Wicket 2.0 which was abandoned after a few months
of development because, if I remember correctly, it broke too much previous
version code base. As a user I would like not to experience something
similar anymore.  I haven't tried yet Wicket 8.x but I'm a bit afraid it
might be a bit disruptive for some users/applications. I will want to try
it ASAP and give my modest feedback.


-- 
Regards - Ernesto Reinaldo Barreiro


Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2016-05-09 Thread Tobias Soloschenko
aimer: I do not know if this is an error introduced by the
>>>>>>>> bootstrap layer or if this can be reproduced with  a bare bones
>>> wicket
>>>>>>>> example.
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Wed, Nov 18, 2015 at 2:00 PM, Ernesto Reinaldo Barreiro <
>>>>>>>> reier...@gmail.com> wrote:
>>>>>>>> 
>>>>>>>>> Let me see is I find the time to created it (it uses my own
>>> bootstrap
>>>>>>>>> components)
>>>>>>>>> 
>>>>>>>>> On Wed, Nov 18, 2015 at 1:53 PM, Sven Meier 
>>> wrote:
>>>>>>>>> 
>>>>>>>>>> Hi,
>>>>>>>>>> 
>>>>>>>>>> with a quickstart it would be easy to spot the problem.
>>>>>>>>>> 
>>>>>>>>>> Regards
>>>>>>>>>> Sven
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>>> On 18.11.2015 13:46, Ernesto Reinaldo Barreiro wrote:
>>>>>>>>>>> 
>>>>>>>>>>> Hi,
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> If I "revert" to 6.21.0 problem disappears so this seems to be
>> a
>>>>>>>>>>> 7.1.0
>>>>>>>>>>> "issue".
>>>>>>>>>>> 
>>>>>>>>>>> On Tue, Nov 17, 2015 at 9:36 PM, Ernesto Reinaldo Barreiro <
>>>>>>>>>>> reier...@gmail.com> wrote:
>>>>>>>>>>> 
>>>>>>>>>>> Well it is the same in the sense that no client side AJAX event
>>>>>>>>>>>> seems to
>>>>>>>>>>>> be triggered.
>>>>>>>>>>>> 
>>>>>>>>>>>> On Tue, Nov 17, 2015 at 9:24 PM, Ernesto Reinaldo Barreiro <
>>>>>>>>>>>> reier...@gmail.com> wrote:
>>>>>>>>>>>> 
>>>>>>>>>>>> Hi Sven,
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Thanks for the feedback. It should not be the case
>>>>>>>>>>>>> 
>>>>>>>>>>>>>  radioGroup = new RadioGroup("radioGroup", getModel());
>>>>>>>>>>>>> tuneRadioGroup(radioGroup);
>>>>>>>>>>>>> radioGroup.setRenderBodyOnly(false);
>>>>>>>>>>>>> radioGroup.setOutputMarkupId(true);
>>>>>>>>>>>>> add(radioGroup);
>>>>>>>>>>>>> if(changeHandler != null) {
>>>>>>>>>>>>> radioGroup.add(new
>>>>>>>>>>>>> AjaxFormChoiceComponentUpdatingBehavior() {
>>>>>>>>>>>>> 
>>>>>>>>>>>>> @Override
>>>>>>>>>>>>> protected void onUpdate(AjaxRequestTarget
>>>> target)
>>>>>>>>>>>>> {
>>>>>>>>>>>>> changeHandler.onSelectionChanged(target,
>>>>>>>>>>>>> radioGroup.getModel().getObject());
>>>>>>>>>>>>> }
>>>>>>>>>>>>> });
>>>>>>>>>>>>> }
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> On Tue, Nov 17, 2015 at 7:11 PM, Sven Meier >> 
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> nothing specific I can think of ... perhaps WICKET-5476?
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> Regards
>>>>>>>>>>>>>> Sven
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> On 17.11.2015 18:55, Ernesto Reinaldo Barreiro wrote:
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> I have a bootstrap based component that uses a RadioGroup
>>>>>>>>>>>>>>> + AjaxFormChoiceComponentUpdatingBehavior. This was working
>>>>>>>>>>>>>>> perfectly
>>>>>>>>>>>>>>> fine
>>>>>>>>>>>>>>> on wicket 6. Now is no loger working with wicket 7. Are
>> there
>>>> any
>>>>>>>>>>>>>>> (obvious)
>>>>>>>>>>>>>>> changes on the way RadioGroup works that might be
>> preventing
>>> it
>>>>>>>>>>>>>>> from
>>>>>>>>>>>>>>> working?
>>>> -
>>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>>>>>>>>>>> For additional commands, e-mail:
>> users-h...@wicket.apache.org
>>>>>>>>>>>>> 
>>>>>>>>>>>>> --
>>>>>>>>>>>>> Regards - Ernesto Reinaldo Barreiro
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> --
>>>>>>>>>>>> Regards - Ernesto Reinaldo Barreiro
>>>> -
>>>>>>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> --
>>>>>>>>> Regards - Ernesto Reinaldo Barreiro
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> --
>>>>>>>> Regards - Ernesto Reinaldo Barreiro
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> --
>>>>>>> Regards - Ernesto Reinaldo Barreiro
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Regards - Ernesto Reinaldo Barreiro
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Regards - Ernesto Reinaldo Barreiro
>>> 
>>> 
>>> 
>>> --
>>> Regards - Ernesto Reinaldo Barreiro
> 
> 
> 
> -- 
> Regards - Ernesto Reinaldo Barreiro

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



Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2016-05-09 Thread Ernesto Reinaldo Barreiro
Martin,

Actually I was vaguely aware of having read the discussion related to the
issue...

https://mail-archives.apache.org/mod_mbox/wicket-dev/201411.mbox/%3ccamomwmrvoeghovjj2u7pck9js2on-d28fww9fxck6xgyvcc...@mail.gmail.com%3E

It was a bit more  difficult to figure out this was the culprit in my case.
IMHO changes like these are "little changes" that might break applications
and leave users just wondering  what's going on for a while... particularly
if your are using components integrating with third party JS libraries.



On Mon, May 9, 2016 at 4:49 PM, Martin Grigorov 
wrote:

>
> https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+7.0#MigrationtoWicket7.0-org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagationisnowBUBBLEbydefaultWICKET-5198
>
> Having so detailed migration guide sometimes is a drawback - people don't
> want to read it completely :-)
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Mon, May 9, 2016 at 4:23 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> > Martin.
> >
> > Thanks for explanation. This little thing was preventing me from jumping
> to
> > wicket 7. Now I can migrate my project :-)
> >
> > On Mon, May 9, 2016 at 4:17 PM, Martin Grigorov 
> > wrote:
> >
> > > On Mon, May 9, 2016 at 4:14 PM, Ernesto Reinaldo Barreiro <
> > > reier...@gmail.com> wrote:
> > >
> > > > Problem was
> > > >
> > > >
> > >
> >
> attributes.setEventPropagation(AjaxRequestAttributes.EventPropagation.STOP
> > > > );
> > > >
> > > > was need. Before STOP was the default, now it is BUBBLE. Just
> wondering
> > > > why default was changed?
> > > >
> > > It changed because BUBBLE is the default in the browser DOM.
> > >
> > >
> > > >
> > > > On Mon, May 9, 2016 at 3:26 PM, Ernesto Reinaldo Barreiro <
> > > > reier...@gmail.com> wrote:
> > > >
> > > >> This seem to be some bug on the bootstrap layer NOT a Wicket bug:
> > > >> stripping bootstrap specifics makes wicket AJAX work.
> > > >>
> > > >> On Mon, May 9, 2016 at 3:02 PM, Ernesto Reinaldo Barreiro <
> > > >> reier...@gmail.com> wrote:
> > > >>
> > > >>> @Martin,
> > > >>>
> > > >>> cleaned up working branch.
> > > >>>
> > > >>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/604
> > > >>>
> > > >>> On Mon, May 9, 2016 at 1:40 PM, Ernesto Reinaldo Barreiro <
> > > >>> reier...@gmail.com> wrote:
> > > >>>
> > > >>>> Hi,
> > > >>>>
> > > >>>> Sorry for the long time it took... Today I finally managed to find
> > > some
> > > >>>> free time to create something you can use to see the problem in
> > > action:
> > > >>>>
> > > >>>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/603
> > > >>>>
> > > >>>> Shows a component (Bootstrap radio choice) that does not work in
> > > wicket
> > > >>>> 7.3.0
> > > >>>>
> > > >>>> and PR
> > > >>>>
> > > >>>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/602
> > > >>>>
> > > >>>> shows the same component working on 6.3.
> > > >>>>
> > > >>>> [image: Inline image 1]
> > > >>>>
> > > >>>> @Martin,
> > > >>>>
> > > >>>> I will later on create a new (cleaner) PR to replace 603 to add
> only
> > > >>>> radio choice renderer for 6.x.
> > > >>>>
> > > >>>> Disclaimer: I do not know if this is an error introduced by the
> > > >>>> bootstrap layer or if this can be reproduced with  a bare bones
> > wicket
> > > >>>> example.
> > > >>>>
> > > >>>>
> > > >>>> On Wed, Nov 18, 2015 at 2:00 PM, Ernesto Reinaldo Barreiro <
> > > >>>> reier...@gmail.com> wrote:
> > > >>>>
> > > >>>>> Let me see is I find the time to created it (it uses my own
> > bootstrap
> > > >>>>> compone

Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2016-05-09 Thread Martin Grigorov
https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+7.0#MigrationtoWicket7.0-org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagationisnowBUBBLEbydefaultWICKET-5198

Having so detailed migration guide sometimes is a drawback - people don't
want to read it completely :-)

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

On Mon, May 9, 2016 at 4:23 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Martin.
>
> Thanks for explanation. This little thing was preventing me from jumping to
> wicket 7. Now I can migrate my project :-)
>
> On Mon, May 9, 2016 at 4:17 PM, Martin Grigorov 
> wrote:
>
> > On Mon, May 9, 2016 at 4:14 PM, Ernesto Reinaldo Barreiro <
> > reier...@gmail.com> wrote:
> >
> > > Problem was
> > >
> > >
> >
> attributes.setEventPropagation(AjaxRequestAttributes.EventPropagation.STOP
> > > );
> > >
> > > was need. Before STOP was the default, now it is BUBBLE. Just wondering
> > > why default was changed?
> > >
> > It changed because BUBBLE is the default in the browser DOM.
> >
> >
> > >
> > > On Mon, May 9, 2016 at 3:26 PM, Ernesto Reinaldo Barreiro <
> > > reier...@gmail.com> wrote:
> > >
> > >> This seem to be some bug on the bootstrap layer NOT a Wicket bug:
> > >> stripping bootstrap specifics makes wicket AJAX work.
> > >>
> > >> On Mon, May 9, 2016 at 3:02 PM, Ernesto Reinaldo Barreiro <
> > >> reier...@gmail.com> wrote:
> > >>
> > >>> @Martin,
> > >>>
> > >>> cleaned up working branch.
> > >>>
> > >>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/604
> > >>>
> > >>> On Mon, May 9, 2016 at 1:40 PM, Ernesto Reinaldo Barreiro <
> > >>> reier...@gmail.com> wrote:
> > >>>
> > >>>> Hi,
> > >>>>
> > >>>> Sorry for the long time it took... Today I finally managed to find
> > some
> > >>>> free time to create something you can use to see the problem in
> > action:
> > >>>>
> > >>>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/603
> > >>>>
> > >>>> Shows a component (Bootstrap radio choice) that does not work in
> > wicket
> > >>>> 7.3.0
> > >>>>
> > >>>> and PR
> > >>>>
> > >>>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/602
> > >>>>
> > >>>> shows the same component working on 6.3.
> > >>>>
> > >>>> [image: Inline image 1]
> > >>>>
> > >>>> @Martin,
> > >>>>
> > >>>> I will later on create a new (cleaner) PR to replace 603 to add only
> > >>>> radio choice renderer for 6.x.
> > >>>>
> > >>>> Disclaimer: I do not know if this is an error introduced by the
> > >>>> bootstrap layer or if this can be reproduced with  a bare bones
> wicket
> > >>>> example.
> > >>>>
> > >>>>
> > >>>> On Wed, Nov 18, 2015 at 2:00 PM, Ernesto Reinaldo Barreiro <
> > >>>> reier...@gmail.com> wrote:
> > >>>>
> > >>>>> Let me see is I find the time to created it (it uses my own
> bootstrap
> > >>>>> components)
> > >>>>>
> > >>>>> On Wed, Nov 18, 2015 at 1:53 PM, Sven Meier 
> wrote:
> > >>>>>
> > >>>>>> Hi,
> > >>>>>>
> > >>>>>> with a quickstart it would be easy to spot the problem.
> > >>>>>>
> > >>>>>> Regards
> > >>>>>> Sven
> > >>>>>>
> > >>>>>>
> > >>>>>> On 18.11.2015 13:46, Ernesto Reinaldo Barreiro wrote:
> > >>>>>>
> > >>>>>>> Hi,
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> If I "revert" to 6.21.0 problem disappears so this seems to be a
> > >>>>>>> 7.1.0
> > >>>>>>> "issue".
> > >>>>>>>
> > >>>>>>> On Tue, Nov 17, 2015 at 9:36 PM, Ernesto Reinaldo Barr

Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2016-05-09 Thread Ernesto Reinaldo Barreiro
Martin.

Thanks for explanation. This little thing was preventing me from jumping to
wicket 7. Now I can migrate my project :-)

On Mon, May 9, 2016 at 4:17 PM, Martin Grigorov 
wrote:

> On Mon, May 9, 2016 at 4:14 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> > Problem was
> >
> >
> attributes.setEventPropagation(AjaxRequestAttributes.EventPropagation.STOP
> > );
> >
> > was need. Before STOP was the default, now it is BUBBLE. Just wondering
> > why default was changed?
> >
> It changed because BUBBLE is the default in the browser DOM.
>
>
> >
> > On Mon, May 9, 2016 at 3:26 PM, Ernesto Reinaldo Barreiro <
> > reier...@gmail.com> wrote:
> >
> >> This seem to be some bug on the bootstrap layer NOT a Wicket bug:
> >> stripping bootstrap specifics makes wicket AJAX work.
> >>
> >> On Mon, May 9, 2016 at 3:02 PM, Ernesto Reinaldo Barreiro <
> >> reier...@gmail.com> wrote:
> >>
> >>> @Martin,
> >>>
> >>> cleaned up working branch.
> >>>
> >>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/604
> >>>
> >>> On Mon, May 9, 2016 at 1:40 PM, Ernesto Reinaldo Barreiro <
> >>> reier...@gmail.com> wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> Sorry for the long time it took... Today I finally managed to find
> some
> >>>> free time to create something you can use to see the problem in
> action:
> >>>>
> >>>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/603
> >>>>
> >>>> Shows a component (Bootstrap radio choice) that does not work in
> wicket
> >>>> 7.3.0
> >>>>
> >>>> and PR
> >>>>
> >>>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/602
> >>>>
> >>>> shows the same component working on 6.3.
> >>>>
> >>>> [image: Inline image 1]
> >>>>
> >>>> @Martin,
> >>>>
> >>>> I will later on create a new (cleaner) PR to replace 603 to add only
> >>>> radio choice renderer for 6.x.
> >>>>
> >>>> Disclaimer: I do not know if this is an error introduced by the
> >>>> bootstrap layer or if this can be reproduced with  a bare bones wicket
> >>>> example.
> >>>>
> >>>>
> >>>> On Wed, Nov 18, 2015 at 2:00 PM, Ernesto Reinaldo Barreiro <
> >>>> reier...@gmail.com> wrote:
> >>>>
> >>>>> Let me see is I find the time to created it (it uses my own bootstrap
> >>>>> components)
> >>>>>
> >>>>> On Wed, Nov 18, 2015 at 1:53 PM, Sven Meier  wrote:
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> with a quickstart it would be easy to spot the problem.
> >>>>>>
> >>>>>> Regards
> >>>>>> Sven
> >>>>>>
> >>>>>>
> >>>>>> On 18.11.2015 13:46, Ernesto Reinaldo Barreiro wrote:
> >>>>>>
> >>>>>>> Hi,
> >>>>>>>
> >>>>>>>
> >>>>>>> If I "revert" to 6.21.0 problem disappears so this seems to be a
> >>>>>>> 7.1.0
> >>>>>>> "issue".
> >>>>>>>
> >>>>>>> On Tue, Nov 17, 2015 at 9:36 PM, Ernesto Reinaldo Barreiro <
> >>>>>>> reier...@gmail.com> wrote:
> >>>>>>>
> >>>>>>> Well it is the same in the sense that no client side AJAX event
> >>>>>>>> seems to
> >>>>>>>> be triggered.
> >>>>>>>>
> >>>>>>>> On Tue, Nov 17, 2015 at 9:24 PM, Ernesto Reinaldo Barreiro <
> >>>>>>>> reier...@gmail.com> wrote:
> >>>>>>>>
> >>>>>>>> Hi Sven,
> >>>>>>>>>
> >>>>>>>>> Thanks for the feedback. It should not be the case
> >>>>>>>>>
> >>>>>>>>>   radioGroup = new RadioGroup("radioGroup", getModel());
> >>>>>>>>>  tuneRadioGroup(radioGroup);
> >>>>>>

Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2016-05-09 Thread Martin Grigorov
On Mon, May 9, 2016 at 4:14 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Problem was
>
> attributes.setEventPropagation(AjaxRequestAttributes.EventPropagation.STOP
> );
>
> was need. Before STOP was the default, now it is BUBBLE. Just wondering
> why default was changed?
>
It changed because BUBBLE is the default in the browser DOM.


>
> On Mon, May 9, 2016 at 3:26 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
>> This seem to be some bug on the bootstrap layer NOT a Wicket bug:
>> stripping bootstrap specifics makes wicket AJAX work.
>>
>> On Mon, May 9, 2016 at 3:02 PM, Ernesto Reinaldo Barreiro <
>> reier...@gmail.com> wrote:
>>
>>> @Martin,
>>>
>>> cleaned up working branch.
>>>
>>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/604
>>>
>>> On Mon, May 9, 2016 at 1:40 PM, Ernesto Reinaldo Barreiro <
>>> reier...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Sorry for the long time it took... Today I finally managed to find some
>>>> free time to create something you can use to see the problem in action:
>>>>
>>>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/603
>>>>
>>>> Shows a component (Bootstrap radio choice) that does not work in wicket
>>>> 7.3.0
>>>>
>>>> and PR
>>>>
>>>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/602
>>>>
>>>> shows the same component working on 6.3.
>>>>
>>>> [image: Inline image 1]
>>>>
>>>> @Martin,
>>>>
>>>> I will later on create a new (cleaner) PR to replace 603 to add only
>>>> radio choice renderer for 6.x.
>>>>
>>>> Disclaimer: I do not know if this is an error introduced by the
>>>> bootstrap layer or if this can be reproduced with  a bare bones wicket
>>>> example.
>>>>
>>>>
>>>> On Wed, Nov 18, 2015 at 2:00 PM, Ernesto Reinaldo Barreiro <
>>>> reier...@gmail.com> wrote:
>>>>
>>>>> Let me see is I find the time to created it (it uses my own bootstrap
>>>>> components)
>>>>>
>>>>> On Wed, Nov 18, 2015 at 1:53 PM, Sven Meier  wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> with a quickstart it would be easy to spot the problem.
>>>>>>
>>>>>> Regards
>>>>>> Sven
>>>>>>
>>>>>>
>>>>>> On 18.11.2015 13:46, Ernesto Reinaldo Barreiro wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>>
>>>>>>> If I "revert" to 6.21.0 problem disappears so this seems to be a
>>>>>>> 7.1.0
>>>>>>> "issue".
>>>>>>>
>>>>>>> On Tue, Nov 17, 2015 at 9:36 PM, Ernesto Reinaldo Barreiro <
>>>>>>> reier...@gmail.com> wrote:
>>>>>>>
>>>>>>> Well it is the same in the sense that no client side AJAX event
>>>>>>>> seems to
>>>>>>>> be triggered.
>>>>>>>>
>>>>>>>> On Tue, Nov 17, 2015 at 9:24 PM, Ernesto Reinaldo Barreiro <
>>>>>>>> reier...@gmail.com> wrote:
>>>>>>>>
>>>>>>>> Hi Sven,
>>>>>>>>>
>>>>>>>>> Thanks for the feedback. It should not be the case
>>>>>>>>>
>>>>>>>>>   radioGroup = new RadioGroup("radioGroup", getModel());
>>>>>>>>>  tuneRadioGroup(radioGroup);
>>>>>>>>>  radioGroup.setRenderBodyOnly(false);
>>>>>>>>>  radioGroup.setOutputMarkupId(true);
>>>>>>>>>  add(radioGroup);
>>>>>>>>>  if(changeHandler != null) {
>>>>>>>>>  radioGroup.add(new
>>>>>>>>> AjaxFormChoiceComponentUpdatingBehavior() {
>>>>>>>>>
>>>>>>>>>  @Override
>>>>>>>>>  protected void onUpdate(AjaxRequestTarget target)
>>>>>>>>> {
>>>>>&g

Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2016-05-09 Thread Ernesto Reinaldo Barreiro
Problem was

attributes.setEventPropagation(AjaxRequestAttributes.EventPropagation.STOP);

was need. Before STOP was the default, now it is BUBBLE. Just wondering why
default was changed?

On Mon, May 9, 2016 at 3:26 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> This seem to be some bug on the bootstrap layer NOT a Wicket bug:
> stripping bootstrap specifics makes wicket AJAX work.
>
> On Mon, May 9, 2016 at 3:02 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
>> @Martin,
>>
>> cleaned up working branch.
>>
>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/604
>>
>> On Mon, May 9, 2016 at 1:40 PM, Ernesto Reinaldo Barreiro <
>> reier...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Sorry for the long time it took... Today I finally managed to find some
>>> free time to create something you can use to see the problem in action:
>>>
>>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/603
>>>
>>> Shows a component (Bootstrap radio choice) that does not work in wicket
>>> 7.3.0
>>>
>>> and PR
>>>
>>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/602
>>>
>>> shows the same component working on 6.3.
>>>
>>> [image: Inline image 1]
>>>
>>> @Martin,
>>>
>>> I will later on create a new (cleaner) PR to replace 603 to add only
>>> radio choice renderer for 6.x.
>>>
>>> Disclaimer: I do not know if this is an error introduced by the
>>> bootstrap layer or if this can be reproduced with  a bare bones wicket
>>> example.
>>>
>>>
>>> On Wed, Nov 18, 2015 at 2:00 PM, Ernesto Reinaldo Barreiro <
>>> reier...@gmail.com> wrote:
>>>
>>>> Let me see is I find the time to created it (it uses my own bootstrap
>>>> components)
>>>>
>>>> On Wed, Nov 18, 2015 at 1:53 PM, Sven Meier  wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> with a quickstart it would be easy to spot the problem.
>>>>>
>>>>> Regards
>>>>> Sven
>>>>>
>>>>>
>>>>> On 18.11.2015 13:46, Ernesto Reinaldo Barreiro wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>
>>>>>> If I "revert" to 6.21.0 problem disappears so this seems to be a 7.1.0
>>>>>> "issue".
>>>>>>
>>>>>> On Tue, Nov 17, 2015 at 9:36 PM, Ernesto Reinaldo Barreiro <
>>>>>> reier...@gmail.com> wrote:
>>>>>>
>>>>>> Well it is the same in the sense that no client side AJAX event seems
>>>>>>> to
>>>>>>> be triggered.
>>>>>>>
>>>>>>> On Tue, Nov 17, 2015 at 9:24 PM, Ernesto Reinaldo Barreiro <
>>>>>>> reier...@gmail.com> wrote:
>>>>>>>
>>>>>>> Hi Sven,
>>>>>>>>
>>>>>>>> Thanks for the feedback. It should not be the case
>>>>>>>>
>>>>>>>>   radioGroup = new RadioGroup("radioGroup", getModel());
>>>>>>>>  tuneRadioGroup(radioGroup);
>>>>>>>>  radioGroup.setRenderBodyOnly(false);
>>>>>>>>  radioGroup.setOutputMarkupId(true);
>>>>>>>>      add(radioGroup);
>>>>>>>>  if(changeHandler != null) {
>>>>>>>>  radioGroup.add(new
>>>>>>>> AjaxFormChoiceComponentUpdatingBehavior() {
>>>>>>>>
>>>>>>>>  @Override
>>>>>>>>  protected void onUpdate(AjaxRequestTarget target) {
>>>>>>>>  changeHandler.onSelectionChanged(target,
>>>>>>>> radioGroup.getModel().getObject());
>>>>>>>>  }
>>>>>>>>  });
>>>>>>>>  }
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Nov 17, 2015 at 7:11 PM, Sven Meier 
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> nothing specific I can think of ... perhaps WICKET-5476?
>>>>>>>>>
>>>>>>>>> Regards
>>>>>>>>> Sven
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 17.11.2015 18:55, Ernesto Reinaldo Barreiro wrote:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I have a bootstrap based component that uses a RadioGroup
>>>>>>>>>> + AjaxFormChoiceComponentUpdatingBehavior. This was working
>>>>>>>>>> perfectly
>>>>>>>>>> fine
>>>>>>>>>> on wicket 6. Now is no loger working with wicket 7. Are there any
>>>>>>>>>> (obvious)
>>>>>>>>>> changes on the way RadioGroup works that might be preventing it
>>>>>>>>>> from
>>>>>>>>>> working?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> -
>>>>>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Regards - Ernesto Reinaldo Barreiro
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Regards - Ernesto Reinaldo Barreiro
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> -
>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Regards - Ernesto Reinaldo Barreiro
>>>>
>>>
>>>
>>>
>>> --
>>> Regards - Ernesto Reinaldo Barreiro
>>>
>>
>>
>>
>> --
>> Regards - Ernesto Reinaldo Barreiro
>>
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>



-- 
Regards - Ernesto Reinaldo Barreiro


Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2016-05-09 Thread Ernesto Reinaldo Barreiro
This seem to be some bug on the bootstrap layer NOT a Wicket bug: stripping
bootstrap specifics makes wicket AJAX work.

On Mon, May 9, 2016 at 3:02 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> @Martin,
>
> cleaned up working branch.
>
> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/604
>
> On Mon, May 9, 2016 at 1:40 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
>> Hi,
>>
>> Sorry for the long time it took... Today I finally managed to find some
>> free time to create something you can use to see the problem in action:
>>
>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/603
>>
>> Shows a component (Bootstrap radio choice) that does not work in wicket
>> 7.3.0
>>
>> and PR
>>
>> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/602
>>
>> shows the same component working on 6.3.
>>
>> [image: Inline image 1]
>>
>> @Martin,
>>
>> I will later on create a new (cleaner) PR to replace 603 to add only
>> radio choice renderer for 6.x.
>>
>> Disclaimer: I do not know if this is an error introduced by the bootstrap
>> layer or if this can be reproduced with  a bare bones wicket example.
>>
>>
>> On Wed, Nov 18, 2015 at 2:00 PM, Ernesto Reinaldo Barreiro <
>> reier...@gmail.com> wrote:
>>
>>> Let me see is I find the time to created it (it uses my own bootstrap
>>> components)
>>>
>>> On Wed, Nov 18, 2015 at 1:53 PM, Sven Meier  wrote:
>>>
>>>> Hi,
>>>>
>>>> with a quickstart it would be easy to spot the problem.
>>>>
>>>> Regards
>>>> Sven
>>>>
>>>>
>>>> On 18.11.2015 13:46, Ernesto Reinaldo Barreiro wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>>
>>>>> If I "revert" to 6.21.0 problem disappears so this seems to be a 7.1.0
>>>>> "issue".
>>>>>
>>>>> On Tue, Nov 17, 2015 at 9:36 PM, Ernesto Reinaldo Barreiro <
>>>>> reier...@gmail.com> wrote:
>>>>>
>>>>> Well it is the same in the sense that no client side AJAX event seems
>>>>>> to
>>>>>> be triggered.
>>>>>>
>>>>>> On Tue, Nov 17, 2015 at 9:24 PM, Ernesto Reinaldo Barreiro <
>>>>>> reier...@gmail.com> wrote:
>>>>>>
>>>>>> Hi Sven,
>>>>>>>
>>>>>>> Thanks for the feedback. It should not be the case
>>>>>>>
>>>>>>>   radioGroup = new RadioGroup("radioGroup", getModel());
>>>>>>>  tuneRadioGroup(radioGroup);
>>>>>>>  radioGroup.setRenderBodyOnly(false);
>>>>>>>  radioGroup.setOutputMarkupId(true);
>>>>>>>  add(radioGroup);
>>>>>>>  if(changeHandler != null) {
>>>>>>>  radioGroup.add(new
>>>>>>> AjaxFormChoiceComponentUpdatingBehavior() {
>>>>>>>
>>>>>>>  @Override
>>>>>>>  protected void onUpdate(AjaxRequestTarget target) {
>>>>>>>  changeHandler.onSelectionChanged(target,
>>>>>>> radioGroup.getModel().getObject());
>>>>>>>  }
>>>>>>>  });
>>>>>>>  }
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Nov 17, 2015 at 7:11 PM, Sven Meier  wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>>
>>>>>>>> nothing specific I can think of ... perhaps WICKET-5476?
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> Sven
>>>>>>>>
>>>>>>>>
>>>>>>>> On 17.11.2015 18:55, Ernesto Reinaldo Barreiro wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I have a bootstrap based component that uses a RadioGroup
>>>>>>>>> + AjaxFormChoiceComponentUpdatingBehavior. This was working
>>>>>>>>> perfectly
>>>>>>>>> fine
>>>>>>>>> on wicket 6. Now is no loger working with wicket 7. Are there any
>>>>>>>>> (obvious)
>>>>>>>>> changes on the way RadioGroup works that might be preventing it
>>>>>>>>> from
>>>>>>>>> working?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> -
>>>>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Regards - Ernesto Reinaldo Barreiro
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Regards - Ernesto Reinaldo Barreiro
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>> -
>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>
>>>>
>>>
>>>
>>> --
>>> Regards - Ernesto Reinaldo Barreiro
>>>
>>
>>
>>
>> --
>> Regards - Ernesto Reinaldo Barreiro
>>
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>



-- 
Regards - Ernesto Reinaldo Barreiro


Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2016-05-09 Thread Ernesto Reinaldo Barreiro
@Martin,

cleaned up working branch.

https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/604

On Mon, May 9, 2016 at 1:40 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
> Sorry for the long time it took... Today I finally managed to find some
> free time to create something you can use to see the problem in action:
>
> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/603
>
> Shows a component (Bootstrap radio choice) that does not work in wicket
> 7.3.0
>
> and PR
>
> https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/602
>
> shows the same component working on 6.3.
>
> [image: Inline image 1]
>
> @Martin,
>
> I will later on create a new (cleaner) PR to replace 603 to add only radio
> choice renderer for 6.x.
>
> Disclaimer: I do not know if this is an error introduced by the bootstrap
> layer or if this can be reproduced with  a bare bones wicket example.
>
>
> On Wed, Nov 18, 2015 at 2:00 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
>> Let me see is I find the time to created it (it uses my own bootstrap
>> components)
>>
>> On Wed, Nov 18, 2015 at 1:53 PM, Sven Meier  wrote:
>>
>>> Hi,
>>>
>>> with a quickstart it would be easy to spot the problem.
>>>
>>> Regards
>>> Sven
>>>
>>>
>>> On 18.11.2015 13:46, Ernesto Reinaldo Barreiro wrote:
>>>
>>>> Hi,
>>>>
>>>>
>>>> If I "revert" to 6.21.0 problem disappears so this seems to be a 7.1.0
>>>> "issue".
>>>>
>>>> On Tue, Nov 17, 2015 at 9:36 PM, Ernesto Reinaldo Barreiro <
>>>> reier...@gmail.com> wrote:
>>>>
>>>> Well it is the same in the sense that no client side AJAX event seems to
>>>>> be triggered.
>>>>>
>>>>> On Tue, Nov 17, 2015 at 9:24 PM, Ernesto Reinaldo Barreiro <
>>>>> reier...@gmail.com> wrote:
>>>>>
>>>>> Hi Sven,
>>>>>>
>>>>>> Thanks for the feedback. It should not be the case
>>>>>>
>>>>>>   radioGroup = new RadioGroup("radioGroup", getModel());
>>>>>>  tuneRadioGroup(radioGroup);
>>>>>>  radioGroup.setRenderBodyOnly(false);
>>>>>>  radioGroup.setOutputMarkupId(true);
>>>>>>  add(radioGroup);
>>>>>>  if(changeHandler != null) {
>>>>>>  radioGroup.add(new
>>>>>> AjaxFormChoiceComponentUpdatingBehavior() {
>>>>>>
>>>>>>  @Override
>>>>>>  protected void onUpdate(AjaxRequestTarget target) {
>>>>>>  changeHandler.onSelectionChanged(target,
>>>>>> radioGroup.getModel().getObject());
>>>>>>  }
>>>>>>  });
>>>>>>  }
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, Nov 17, 2015 at 7:11 PM, Sven Meier  wrote:
>>>>>>
>>>>>> Hi,
>>>>>>>
>>>>>>> nothing specific I can think of ... perhaps WICKET-5476?
>>>>>>>
>>>>>>> Regards
>>>>>>> Sven
>>>>>>>
>>>>>>>
>>>>>>> On 17.11.2015 18:55, Ernesto Reinaldo Barreiro wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I have a bootstrap based component that uses a RadioGroup
>>>>>>>> + AjaxFormChoiceComponentUpdatingBehavior. This was working
>>>>>>>> perfectly
>>>>>>>> fine
>>>>>>>> on wicket 6. Now is no loger working with wicket 7. Are there any
>>>>>>>> (obvious)
>>>>>>>> changes on the way RadioGroup works that might be preventing it from
>>>>>>>> working?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> -
>>>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Regards - Ernesto Reinaldo Barreiro
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Regards - Ernesto Reinaldo Barreiro
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>>
>> --
>> Regards - Ernesto Reinaldo Barreiro
>>
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>



-- 
Regards - Ernesto Reinaldo Barreiro


Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2016-05-09 Thread Ernesto Reinaldo Barreiro
Hi,

Sorry for the long time it took... Today I finally managed to find some
free time to create something you can use to see the problem in action:

https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/603

Shows a component (Bootstrap radio choice) that does not work in wicket
7.3.0

and PR

https://github.com/l0rdn1kk0n/wicket-bootstrap/pull/602

shows the same component working on 6.3.

[image: Inline image 1]

@Martin,

I will later on create a new (cleaner) PR to replace 603 to add only radio
choice renderer for 6.x.

Disclaimer: I do not know if this is an error introduced by the bootstrap
layer or if this can be reproduced with  a bare bones wicket example.


On Wed, Nov 18, 2015 at 2:00 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Let me see is I find the time to created it (it uses my own bootstrap
> components)
>
> On Wed, Nov 18, 2015 at 1:53 PM, Sven Meier  wrote:
>
>> Hi,
>>
>> with a quickstart it would be easy to spot the problem.
>>
>> Regards
>> Sven
>>
>>
>> On 18.11.2015 13:46, Ernesto Reinaldo Barreiro wrote:
>>
>>> Hi,
>>>
>>>
>>> If I "revert" to 6.21.0 problem disappears so this seems to be a 7.1.0
>>> "issue".
>>>
>>> On Tue, Nov 17, 2015 at 9:36 PM, Ernesto Reinaldo Barreiro <
>>> reier...@gmail.com> wrote:
>>>
>>> Well it is the same in the sense that no client side AJAX event seems to
>>>> be triggered.
>>>>
>>>> On Tue, Nov 17, 2015 at 9:24 PM, Ernesto Reinaldo Barreiro <
>>>> reier...@gmail.com> wrote:
>>>>
>>>> Hi Sven,
>>>>>
>>>>> Thanks for the feedback. It should not be the case
>>>>>
>>>>>   radioGroup = new RadioGroup("radioGroup", getModel());
>>>>>  tuneRadioGroup(radioGroup);
>>>>>  radioGroup.setRenderBodyOnly(false);
>>>>>  radioGroup.setOutputMarkupId(true);
>>>>>  add(radioGroup);
>>>>>  if(changeHandler != null) {
>>>>>  radioGroup.add(new
>>>>> AjaxFormChoiceComponentUpdatingBehavior() {
>>>>>
>>>>>  @Override
>>>>>  protected void onUpdate(AjaxRequestTarget target) {
>>>>>  changeHandler.onSelectionChanged(target,
>>>>> radioGroup.getModel().getObject());
>>>>>  }
>>>>>  });
>>>>>  }
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Nov 17, 2015 at 7:11 PM, Sven Meier  wrote:
>>>>>
>>>>> Hi,
>>>>>>
>>>>>> nothing specific I can think of ... perhaps WICKET-5476?
>>>>>>
>>>>>> Regards
>>>>>> Sven
>>>>>>
>>>>>>
>>>>>> On 17.11.2015 18:55, Ernesto Reinaldo Barreiro wrote:
>>>>>>
>>>>>> Hi,
>>>>>>>
>>>>>>> I have a bootstrap based component that uses a RadioGroup
>>>>>>> + AjaxFormChoiceComponentUpdatingBehavior. This was working perfectly
>>>>>>> fine
>>>>>>> on wicket 6. Now is no loger working with wicket 7. Are there any
>>>>>>> (obvious)
>>>>>>> changes on the way RadioGroup works that might be preventing it from
>>>>>>> working?
>>>>>>>
>>>>>>>
>>>>>>> -
>>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Regards - Ernesto Reinaldo Barreiro
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Regards - Ernesto Reinaldo Barreiro
>>>>
>>>>
>>>
>>>
>>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>



-- 
Regards - Ernesto Reinaldo Barreiro


Re: model does not get updated when radio is clicked - radiogroup with AjaxFormChoiceComponentUpdatingBehavior

2016-01-14 Thread Francois Meillet
Hi Martin it's work.

Thanks

François 








Le 14 janv. 2016 à 23:30, Martin Grigorov  a écrit :

> @Francois: Please try with latest 7.2.0-SNAPSHOT
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Thu, Jan 14, 2016 at 10:59 PM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> Thnaks I override updateAjaxAttributes for the time being
>> François
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Le 14 janv. 2016 à 22:16, Martin Grigorov  a écrit :
>> 
>>> On Thu, Jan 14, 2016 at 9:54 PM, Sven Meier  wrote:
>>> 
>>>> Hi Francois,
>>>> 
>>>> you'll have to add the following to the
>>>> AjaxFormChoiceComponentUpdatingBehavior:
>>>> 
>>>>   @Override
>>>>   protected void updateAjaxAttributes(AjaxRequestAttributes
>>>> attributes)
>>>>   {
>>>>   super.updateAjaxAttributes(attributes);
>>>> 
>>>>   attributes.setSerializeRecursively(true);
>>>>   }
>>>> 
>>>> This may be a problem leftover from WICKET-6050.
>>>> 
>>>> @Marting: Shouldn't this be set automatically by
>>>> AjaxFormChoiceComponentUpdatingBehavior?
>>>> 
>>> 
>>> Yes!
>>> I've forgot it :-/
>>> 
>>> I've found an issue with the traversing of children components in
>>> 7.2.0-SNAPSHOT.
>>> Both issues look like a blocker to me.
>>> 
>>> 
>>>> 
>>>> Best regards
>>>> Sven
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On 14.01.2016 17:18, Francois Meillet wrote:
>>>> 
>>>>> Hi ,
>>>>> 
>>>>> I have a form with a radiogroup containing some radios buttons.
>>>>> The radiogroup has an AjaxFormChoiceComponentUpdatingBehavior.
>>>>> 
>>>>> When any radio button is clicked, the model does not get updated.
>>>>> 
>>>>> In the FormComponent # getInputAsArray()
>>>>> getRequest().getRequestParameters().getParameterValues(getInputName())
>>>>> return null
>>>>> 
>>>>> So the FormComponent convertedInput is null
>>>>> 
>>>>> Do I miss something ?
>>>>> 
>>>>> 
>>>>> François
>> 
>> 



Re: model does not get updated when radio is clicked - radiogroup with AjaxFormChoiceComponentUpdatingBehavior

2016-01-14 Thread Martin Grigorov
@Francois: Please try with latest 7.2.0-SNAPSHOT

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

On Thu, Jan 14, 2016 at 10:59 PM, Francois Meillet <
francois.meil...@gmail.com> wrote:

> Thnaks I override updateAjaxAttributes for the time being
> François
>
>
>
>
>
>
>
>
> Le 14 janv. 2016 à 22:16, Martin Grigorov  a écrit :
>
> > On Thu, Jan 14, 2016 at 9:54 PM, Sven Meier  wrote:
> >
> >> Hi Francois,
> >>
> >> you'll have to add the following to the
> >> AjaxFormChoiceComponentUpdatingBehavior:
> >>
> >>@Override
> >>protected void updateAjaxAttributes(AjaxRequestAttributes
> >> attributes)
> >>{
> >>super.updateAjaxAttributes(attributes);
> >>
> >>attributes.setSerializeRecursively(true);
> >>}
> >>
> >> This may be a problem leftover from WICKET-6050.
> >>
> >> @Marting: Shouldn't this be set automatically by
> >> AjaxFormChoiceComponentUpdatingBehavior?
> >>
> >
> > Yes!
> > I've forgot it :-/
> >
> > I've found an issue with the traversing of children components in
> > 7.2.0-SNAPSHOT.
> > Both issues look like a blocker to me.
> >
> >
> >>
> >> Best regards
> >> Sven
> >>
> >>
> >>
> >>
> >> On 14.01.2016 17:18, Francois Meillet wrote:
> >>
> >>> Hi ,
> >>>
> >>> I have a form with a radiogroup containing some radios buttons.
> >>> The radiogroup has an AjaxFormChoiceComponentUpdatingBehavior.
> >>>
> >>> When any radio button is clicked, the model does not get updated.
> >>>
> >>> In the FormComponent # getInputAsArray()
> >>> getRequest().getRequestParameters().getParameterValues(getInputName())
> >>> return null
> >>>
> >>> So the FormComponent convertedInput is null
> >>>
> >>> Do I miss something ?
> >>>
> >>>
> >>> François
>
>


Re: model does not get updated when radio is clicked - radiogroup with AjaxFormChoiceComponentUpdatingBehavior

2016-01-14 Thread Francois Meillet
Thnaks I override updateAjaxAttributes for the time being
François 








Le 14 janv. 2016 à 22:16, Martin Grigorov  a écrit :

> On Thu, Jan 14, 2016 at 9:54 PM, Sven Meier  wrote:
> 
>> Hi Francois,
>> 
>> you'll have to add the following to the
>> AjaxFormChoiceComponentUpdatingBehavior:
>> 
>>@Override
>>protected void updateAjaxAttributes(AjaxRequestAttributes
>> attributes)
>>{
>>super.updateAjaxAttributes(attributes);
>> 
>>attributes.setSerializeRecursively(true);
>>}
>> 
>> This may be a problem leftover from WICKET-6050.
>> 
>> @Marting: Shouldn't this be set automatically by
>> AjaxFormChoiceComponentUpdatingBehavior?
>> 
> 
> Yes!
> I've forgot it :-/
> 
> I've found an issue with the traversing of children components in
> 7.2.0-SNAPSHOT.
> Both issues look like a blocker to me.
> 
> 
>> 
>> Best regards
>> Sven
>> 
>> 
>> 
>> 
>> On 14.01.2016 17:18, Francois Meillet wrote:
>> 
>>> Hi ,
>>> 
>>> I have a form with a radiogroup containing some radios buttons.
>>> The radiogroup has an AjaxFormChoiceComponentUpdatingBehavior.
>>> 
>>> When any radio button is clicked, the model does not get updated.
>>> 
>>> In the FormComponent # getInputAsArray()
>>> getRequest().getRequestParameters().getParameterValues(getInputName())
>>> return null
>>> 
>>> So the FormComponent convertedInput is null
>>> 
>>> Do I miss something ?
>>> 
>>> 
>>> François



Re: model does not get updated when radio is clicked - radiogroup with AjaxFormChoiceComponentUpdatingBehavior

2016-01-14 Thread Martin Grigorov
On Thu, Jan 14, 2016 at 9:54 PM, Sven Meier  wrote:

> Hi Francois,
>
> you'll have to add the following to the
> AjaxFormChoiceComponentUpdatingBehavior:
>
> @Override
> protected void updateAjaxAttributes(AjaxRequestAttributes
> attributes)
> {
> super.updateAjaxAttributes(attributes);
>
> attributes.setSerializeRecursively(true);
> }
>
> This may be a problem leftover from WICKET-6050.
>
> @Marting: Shouldn't this be set automatically by
> AjaxFormChoiceComponentUpdatingBehavior?
>

Yes!
I've forgot it :-/

I've found an issue with the traversing of children components in
7.2.0-SNAPSHOT.
Both issues look like a blocker to me.


>
> Best regards
> Sven
>
>
>
>
> On 14.01.2016 17:18, Francois Meillet wrote:
>
>> Hi ,
>>
>> I have a form with a radiogroup containing some radios buttons.
>> The radiogroup has an AjaxFormChoiceComponentUpdatingBehavior.
>>
>> When any radio button is clicked, the model does not get updated.
>>
>> In the FormComponent # getInputAsArray()
>> getRequest().getRequestParameters().getParameterValues(getInputName())
>> return null
>>
>> So the FormComponent convertedInput is null
>>
>> Do I miss something ?
>>
>>
>> François
>>
>>
>>
>>
>>
>>
>>
>>
>


Re: model does not get updated when radio is clicked - radiogroup with AjaxFormChoiceComponentUpdatingBehavior

2016-01-14 Thread Sven Meier

Hi Francois,

you'll have to add the following to the 
AjaxFormChoiceComponentUpdatingBehavior:


@Override
protected void updateAjaxAttributes(AjaxRequestAttributes 
attributes)

{
super.updateAjaxAttributes(attributes);

attributes.setSerializeRecursively(true);
}

This may be a problem leftover from WICKET-6050.

@Marting: Shouldn't this be set automatically by 
AjaxFormChoiceComponentUpdatingBehavior?


Best regards
Sven



On 14.01.2016 17:18, Francois Meillet wrote:

Hi ,

I have a form with a radiogroup containing some radios buttons.
The radiogroup has an AjaxFormChoiceComponentUpdatingBehavior.

When any radio button is clicked, the model does not get updated.

In the FormComponent # getInputAsArray()
getRequest().getRequestParameters().getParameterValues(getInputName()) 
return null


So the FormComponent convertedInput is null

Do I miss something ?


François











Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2015-11-18 Thread Ernesto Reinaldo Barreiro
Let me see is I find the time to created it (it uses my own bootstrap
components)

On Wed, Nov 18, 2015 at 1:53 PM, Sven Meier  wrote:

> Hi,
>
> with a quickstart it would be easy to spot the problem.
>
> Regards
> Sven
>
>
> On 18.11.2015 13:46, Ernesto Reinaldo Barreiro wrote:
>
>> Hi,
>>
>>
>> If I "revert" to 6.21.0 problem disappears so this seems to be a 7.1.0
>> "issue".
>>
>> On Tue, Nov 17, 2015 at 9:36 PM, Ernesto Reinaldo Barreiro <
>> reier...@gmail.com> wrote:
>>
>> Well it is the same in the sense that no client side AJAX event seems to
>>> be triggered.
>>>
>>> On Tue, Nov 17, 2015 at 9:24 PM, Ernesto Reinaldo Barreiro <
>>> reier...@gmail.com> wrote:
>>>
>>> Hi Sven,
>>>>
>>>> Thanks for the feedback. It should not be the case
>>>>
>>>>   radioGroup = new RadioGroup("radioGroup", getModel());
>>>>  tuneRadioGroup(radioGroup);
>>>>  radioGroup.setRenderBodyOnly(false);
>>>>  radioGroup.setOutputMarkupId(true);
>>>>  add(radioGroup);
>>>>  if(changeHandler != null) {
>>>>  radioGroup.add(new
>>>> AjaxFormChoiceComponentUpdatingBehavior() {
>>>>
>>>>  @Override
>>>>  protected void onUpdate(AjaxRequestTarget target) {
>>>>  changeHandler.onSelectionChanged(target,
>>>> radioGroup.getModel().getObject());
>>>>      }
>>>>  });
>>>>  }
>>>>
>>>>
>>>>
>>>> On Tue, Nov 17, 2015 at 7:11 PM, Sven Meier  wrote:
>>>>
>>>> Hi,
>>>>>
>>>>> nothing specific I can think of ... perhaps WICKET-5476?
>>>>>
>>>>> Regards
>>>>> Sven
>>>>>
>>>>>
>>>>> On 17.11.2015 18:55, Ernesto Reinaldo Barreiro wrote:
>>>>>
>>>>> Hi,
>>>>>>
>>>>>> I have a bootstrap based component that uses a RadioGroup
>>>>>> + AjaxFormChoiceComponentUpdatingBehavior. This was working perfectly
>>>>>> fine
>>>>>> on wicket 6. Now is no loger working with wicket 7. Are there any
>>>>>> (obvious)
>>>>>> changes on the way RadioGroup works that might be preventing it from
>>>>>> working?
>>>>>>
>>>>>>
>>>>>> -
>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> Regards - Ernesto Reinaldo Barreiro
>>>>
>>>>
>>>
>>>
>>> --
>>> Regards - Ernesto Reinaldo Barreiro
>>>
>>>
>>
>>
>>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2015-11-18 Thread Sven Meier

Hi,

with a quickstart it would be easy to spot the problem.

Regards
Sven

On 18.11.2015 13:46, Ernesto Reinaldo Barreiro wrote:

Hi,


If I "revert" to 6.21.0 problem disappears so this seems to be a 7.1.0
"issue".

On Tue, Nov 17, 2015 at 9:36 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:


Well it is the same in the sense that no client side AJAX event seems to
be triggered.

On Tue, Nov 17, 2015 at 9:24 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:


Hi Sven,

Thanks for the feedback. It should not be the case

  radioGroup = new RadioGroup("radioGroup", getModel());
 tuneRadioGroup(radioGroup);
 radioGroup.setRenderBodyOnly(false);
 radioGroup.setOutputMarkupId(true);
 add(radioGroup);
 if(changeHandler != null) {
 radioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {

 @Override
 protected void onUpdate(AjaxRequestTarget target) {
 changeHandler.onSelectionChanged(target,
radioGroup.getModel().getObject());
 }
 });
 }



On Tue, Nov 17, 2015 at 7:11 PM, Sven Meier  wrote:


Hi,

nothing specific I can think of ... perhaps WICKET-5476?

Regards
Sven


On 17.11.2015 18:55, Ernesto Reinaldo Barreiro wrote:


Hi,

I have a bootstrap based component that uses a RadioGroup
+ AjaxFormChoiceComponentUpdatingBehavior. This was working perfectly
fine
on wicket 6. Now is no loger working with wicket 7. Are there any
(obvious)
changes on the way RadioGroup works that might be preventing it from
working?



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





--
Regards - Ernesto Reinaldo Barreiro





--
Regards - Ernesto Reinaldo Barreiro







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



Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2015-11-18 Thread Ernesto Reinaldo Barreiro
Hi,


If I "revert" to 6.21.0 problem disappears so this seems to be a 7.1.0
"issue".

On Tue, Nov 17, 2015 at 9:36 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Well it is the same in the sense that no client side AJAX event seems to
> be triggered.
>
> On Tue, Nov 17, 2015 at 9:24 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
>> Hi Sven,
>>
>> Thanks for the feedback. It should not be the case
>>
>>  radioGroup = new RadioGroup("radioGroup", getModel());
>> tuneRadioGroup(radioGroup);
>>     radioGroup.setRenderBodyOnly(false);
>> radioGroup.setOutputMarkupId(true);
>> add(radioGroup);
>> if(changeHandler != null) {
>> radioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {
>>
>> @Override
>> protected void onUpdate(AjaxRequestTarget target) {
>> changeHandler.onSelectionChanged(target,
>> radioGroup.getModel().getObject());
>> }
>> });
>> }
>>
>>
>>
>> On Tue, Nov 17, 2015 at 7:11 PM, Sven Meier  wrote:
>>
>>> Hi,
>>>
>>> nothing specific I can think of ... perhaps WICKET-5476?
>>>
>>> Regards
>>> Sven
>>>
>>>
>>> On 17.11.2015 18:55, Ernesto Reinaldo Barreiro wrote:
>>>
>>>> Hi,
>>>>
>>>> I have a bootstrap based component that uses a RadioGroup
>>>> + AjaxFormChoiceComponentUpdatingBehavior. This was working perfectly
>>>> fine
>>>> on wicket 6. Now is no loger working with wicket 7. Are there any
>>>> (obvious)
>>>> changes on the way RadioGroup works that might be preventing it from
>>>> working?
>>>>
>>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>>
>> --
>> Regards - Ernesto Reinaldo Barreiro
>>
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>



-- 
Regards - Ernesto Reinaldo Barreiro


Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2015-11-17 Thread Ernesto Reinaldo Barreiro
Well it is the same in the sense that no client side AJAX event seems to be
triggered.

On Tue, Nov 17, 2015 at 9:24 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi Sven,
>
> Thanks for the feedback. It should not be the case
>
>  radioGroup = new RadioGroup("radioGroup", getModel());
> tuneRadioGroup(radioGroup);
> radioGroup.setRenderBodyOnly(false);
> radioGroup.setOutputMarkupId(true);
> add(radioGroup);
> if(changeHandler != null) {
> radioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {
>
> @Override
> protected void onUpdate(AjaxRequestTarget target) {
> changeHandler.onSelectionChanged(target,
> radioGroup.getModel().getObject());
> }
> });
> }
>
>
>
> On Tue, Nov 17, 2015 at 7:11 PM, Sven Meier  wrote:
>
>> Hi,
>>
>> nothing specific I can think of ... perhaps WICKET-5476?
>>
>> Regards
>> Sven
>>
>>
>> On 17.11.2015 18:55, Ernesto Reinaldo Barreiro wrote:
>>
>>> Hi,
>>>
>>> I have a bootstrap based component that uses a RadioGroup
>>> + AjaxFormChoiceComponentUpdatingBehavior. This was working perfectly
>>> fine
>>> on wicket 6. Now is no loger working with wicket 7. Are there any
>>> (obvious)
>>> changes on the way RadioGroup works that might be preventing it from
>>> working?
>>>
>>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>



-- 
Regards - Ernesto Reinaldo Barreiro


Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2015-11-17 Thread Ernesto Reinaldo Barreiro
Hi Sven,

Thanks for the feedback. It should not be the case

 radioGroup = new RadioGroup("radioGroup", getModel());
tuneRadioGroup(radioGroup);
radioGroup.setRenderBodyOnly(false);
radioGroup.setOutputMarkupId(true);
    add(radioGroup);
if(changeHandler != null) {
radioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {

@Override
protected void onUpdate(AjaxRequestTarget target) {
changeHandler.onSelectionChanged(target,
radioGroup.getModel().getObject());
}
});
}



On Tue, Nov 17, 2015 at 7:11 PM, Sven Meier  wrote:

> Hi,
>
> nothing specific I can think of ... perhaps WICKET-5476?
>
> Regards
> Sven
>
>
> On 17.11.2015 18:55, Ernesto Reinaldo Barreiro wrote:
>
>> Hi,
>>
>> I have a bootstrap based component that uses a RadioGroup
>> + AjaxFormChoiceComponentUpdatingBehavior. This was working perfectly fine
>> on wicket 6. Now is no loger working with wicket 7. Are there any
>> (obvious)
>> changes on the way RadioGroup works that might be preventing it from
>> working?
>>
>>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


Re: are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2015-11-17 Thread Sven Meier

Hi,

nothing specific I can think of ... perhaps WICKET-5476?

Regards
Sven


On 17.11.2015 18:55, Ernesto Reinaldo Barreiro wrote:

Hi,

I have a bootstrap based component that uses a RadioGroup
+ AjaxFormChoiceComponentUpdatingBehavior. This was working perfectly fine
on wicket 6. Now is no loger working with wicket 7. Are there any (obvious)
changes on the way RadioGroup works that might be preventing it from
working?



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



are there any changes to radioGroup and AjaxFormChoiceComponentUpdatingBehavior on wickte 7?

2015-11-17 Thread Ernesto Reinaldo Barreiro
Hi,

I have a bootstrap based component that uses a RadioGroup
+ AjaxFormChoiceComponentUpdatingBehavior. This was working perfectly fine
on wicket 6. Now is no loger working with wicket 7. Are there any (obvious)
changes on the way RadioGroup works that might be preventing it from
working?

-- 
Regards - Ernesto Reinaldo Barreiro


Re: RadioGroup not updating in ajax event

2014-11-17 Thread Sven Meier

Hi,

please create a quickstart, then we will able to identify the problem.

Sven

On 11/17/2014 07:59 PM, Entropy wrote:

Nobody has ideas?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-not-updating-in-ajax-event-tp4668415p4668438.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



Re: RadioGroup not updating in ajax event

2014-11-17 Thread Entropy
Nobody has ideas?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-not-updating-in-ajax-event-tp4668415p4668438.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RadioGroup not updating in ajax event

2014-11-14 Thread Entropy
We have an ajax event initiated by one panel that affects the data, and needs
to force a redraw of a radiogroup in another panel.  The ajax event arrives,
we add the radiogroup to the target, update the model that backs the
ListView, but the populateItem method never re-fires to redraw.  Note that
this is in Wicket 1.4.7.

The following is the creation of the radio group.

group = new RadioGroup("roles", new Model(getDefaultBean()));
group.setOutputMarkupId(true);
group.setRenderBodyOnly(false);
add(group); 
appBean.setUmcOnlyRoles(umcOnlyRoles);

LoadableDetachableModel modelRoles =  new LoadableDetachableModel() {   
   protected Object load() {   
   return appBean.getUmcOnlyRoles();   
   }   
 };
// add all roles
ListView rolesList = new ListView("radioList",
modelRoles){

protected void populateItem(final ListItem item) {
  final KeyValueBean bean = item.getModelObject();
 
  @SuppressWarnings("rawtypes")
  Radio radio = new Radio("radio", item.getModel()) {
//snipped for brevity
  }
}
};
rolesList.setOutputMarkupId(true);
rolesList.setReuseItems(true);
 
group.add(rolesList);

In the ajax event we do this:
Panel app = (Panel)get("apps");  
UMCApplicationPanel umc = (UMCApplicationPanel)app.get("umcPanel");
RadioGroup rolesMarkup = (RadioGroup)umc.get("roles");   

//snipper for brevity

bean.setUmcOnlyRoles(umcOnlyRoles);
bean.seteShareChecked(eShareChecked);
target.addComponent(rolesMarkup);

The "bean" in this event is the same object as the "appBean" in the load
method of the detachable model in the constructor above.  I can confirm that
the detachable model load fires and the right data is in it.  Yet the
populateItem never runs...so the list is unchanged.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-not-updating-in-ajax-event-tp4668415.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: wantsOnSelectionChangedNotifications - RadioGroup / Radio vs DropDownChoice

2014-05-19 Thread Simon B
I've just added an issue to JIRA with a quickstart attachment: 

https://issues.apache.org/jira/browse/WICKET-5596

Cheers
Simon

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wantsOnSelectionChangedNotifications-RadioGroup-Radio-vs-DropDownChoice-tp4665927p4665942.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: wantsOnSelectionChangedNotifications - RadioGroup / Radio vs DropDownChoice

2014-05-19 Thread Martin Grigorov
Hi,

Sounds like a bug.
Please create a quickstart app and attach it to a ticket in JIRA.
Thanks!

Martin Grigorov
Wicket Training and Consulting


On Mon, May 19, 2014 at 12:54 PM, Simon B  wrote:

> Hi,
>
> I'm using Wicket 6.14.0
>
> I've got a form with many components including one which is a RadioGroup
> (with several Radio) and one which is a DropDownChoice,
>
> Both the RadioGroup // Radios and the DropDownChoice have been marked to
> get
> selection changed notifications with the
> RadioGroup#wantOnSelectionChangedNotifications() and the
> DropDownChoice#wantOnSelectionChangedNotifications() both returning true.
>
> My problem is that the DropDownChoice although it refreshes the *page does
> not* actually receive a notification via the onSelectionChanged(T) method
> whereas the RadioGroup *does* via the onSelectChanged(Object).
>
> I've looked at the code and noticed that when Wicket (6.14 in my case)
> writes out the onChange javascript the radio and the dropdown differ
> slightly:
>
> Here is the html code for both:
>
> Notably the radio sets a specific form element name "id28_hf_0" to the
> value
> (reference):
>
> ./antwerp.web.page.account.realtyadvert.publish.PublishRealtyAdvert?6-1.IOnChangeListener-publishRealtyAdvert-form-advertEditPanel-operationType
> and the Dropdown sets the same form element name:
>
> ../../page?6-1.IOnChangeListener-publishRealtyAdvert-form-advertEditPanel-propertyType
> So the first one (of the radio group) works ok and finds the right
> ListenerInterfaceRequestHandler and calls its onSelectionChanged()
> methodThe
> second one (from the dropdown) does not find any
> ListenerInterfaceRequestHandler.
> The code from DropDownChoice that creates the onchange attribute value is:
> // we do not want relative URL here, because it will be used by//
> Form#dispatchEventCharSequence url = urlFor(new
> ListenerInterfaceRequestHandler(new
> PageAndComponentProvider(getPage(),
> this, new PageParameters()),
>  IOnChangeListener.INTERFACE));Form form =
> findParent(Form.class);if (form != null){   tag.put("onchange",
> form.getJsForInterfaceUrl(url.toString()));}else{   tag.put("onchange",
> "window.location.href='" + url +
>  (url.toString().indexOf('?') > -1 ? "&" :
> "?") + getInputName() + "=' +
> this.options[this.selectedIndex].value;");}
> The code from Radio
> // url that points to this components IOnChangeListener methodCharSequence
> url = group.urlFor(IOnChangeListener.INTERFACE, new
> PageParameters());Form form = group.findParent(Form.class);if (form !=
> null){  tag.put("onclick", form.getJsForInterfaceUrl(url));}else{   //
> NOTE: do
> not encode the url as that would give invalid JavaScript
>  tag.put("onclick",
> "window.location.href='" + url +
>  (url.toString().indexOf('?') > -1 ? "&" :
> "?") + group.getInputName() +   "=' +
> this.value;");}
> The page on which the form is on is not mapped its is just redirected to
> from another mapped page, I think this may be the problem and I should
> explicitly map the page with the form so that both urlFor calls return a
> defined page.
>
> I just tried that mapping the page to "my-advert-form-page.html" and it now
> works fine.
>
> So back to my original question, is this a bug in wicket, or am I just
> using
> the framework incorrectly.
>
> Cheers
>
> Simon
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/wantsOnSelectionChangedNotifications-RadioGroup-Radio-vs-DropDownChoice-tp4665927.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


wantsOnSelectionChangedNotifications - RadioGroup / Radio vs DropDownChoice

2014-05-19 Thread Simon B
Hi, 

I'm using Wicket 6.14.0

I've got a form with many components including one which is a RadioGroup
(with several Radio) and one which is a DropDownChoice, 

Both the RadioGroup // Radios and the DropDownChoice have been marked to get
selection changed notifications with the
RadioGroup#wantOnSelectionChangedNotifications() and the
DropDownChoice#wantOnSelectionChangedNotifications() both returning true.

My problem is that the DropDownChoice although it refreshes the *page does
not* actually receive a notification via the onSelectionChanged(T) method
whereas the RadioGroup *does* via the onSelectChanged(Object).

I've looked at the code and noticed that when Wicket (6.14 in my case)
writes out the onChange javascript the radio and the dropdown differ
slightly: 

Here is the html code for both:

Notably the radio sets a specific form element name "id28_hf_0" to the value
(reference): 
./antwerp.web.page.account.realtyadvert.publish.PublishRealtyAdvert?6-1.IOnChangeListener-publishRealtyAdvert-form-advertEditPanel-operationType
and the Dropdown sets the same form element name: 
../../page?6-1.IOnChangeListener-publishRealtyAdvert-form-advertEditPanel-propertyType
So the first one (of the radio group) works ok and finds the right
ListenerInterfaceRequestHandler and calls its onSelectionChanged() methodThe
second one (from the dropdown) does not find any
ListenerInterfaceRequestHandler.
The code from DropDownChoice that creates the onchange attribute value is: 
// we do not want relative URL here, because it will be used by//
Form#dispatchEventCharSequence url = urlFor(new
ListenerInterfaceRequestHandler(new 
PageAndComponentProvider(getPage(),
this, new PageParameters()),
IOnChangeListener.INTERFACE));Form form =
findParent(Form.class);if (form != null){   tag.put("onchange",
form.getJsForInterfaceUrl(url.toString()));}else{   tag.put("onchange",
"window.location.href='" + url +(url.toString().indexOf('?') > 
-1 ? "&" :
"?") + getInputName() + "=' + 
this.options[this.selectedIndex].value;");}
The code from Radio
// url that points to this components IOnChangeListener methodCharSequence
url = group.urlFor(IOnChangeListener.INTERFACE, new
PageParameters());Form form = group.findParent(Form.class);if (form !=
null){  tag.put("onclick", form.getJsForInterfaceUrl(url));}else{   // 
NOTE: do
not encode the url as that would give invalid JavaScript
tag.put("onclick",
"window.location.href='" + url +(url.toString().indexOf('?') > 
-1 ? "&" :
"?") + group.getInputName() +   "=' + 
this.value;");}
The page on which the form is on is not mapped its is just redirected to
from another mapped page, I think this may be the problem and I should
explicitly map the page with the form so that both urlFor calls return a
defined page.

I just tried that mapping the page to "my-advert-form-page.html" and it now
works fine.

So back to my original question, is this a bug in wicket, or am I just using
the framework incorrectly.

Cheers

Simon

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wantsOnSelectionChangedNotifications-RadioGroup-Radio-vs-DropDownChoice-tp4665927.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: RadioGroup selected model value

2013-12-17 Thread Paul Bors
See also section 12.10 of the Wicket Guide "Working with radio buttons and
checkboxes" at:
http://wicket.apache.org/guide/guide/chapter11.html#chapter11_10



On Mon, Dec 16, 2013 at 3:44 AM, Selom  wrote:

> Hi Sven,
> Thanks for the clarification  . Now I understand much more.
>
> I tried  out   your code your code  with the following modification.
>
>
>
>
> Now when the page is shown , * the object  with value debut2   is
> effectively selected  as expected*.
>
> I Thanks you .
>
>
>
> -
> Selom
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/RadioGroup-selected-model-value-tp4662998p4663034.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: RadioGroup selected model value

2013-12-16 Thread Selom
Hi Sven,
Thanks for the clarification  . Now I understand much more.

I tried  out   your code your code  with the following modification.
  



Now when the page is shown , * the object  with value debut2   is
effectively selected  as expected*.

I Thanks you .



-
Selom
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-selected-model-value-tp4662998p4663034.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: RadioGroup selected model value

2013-12-13 Thread Sven Meier

Hi,

to clarify:
- a RadioChoice is for selecting an object from a list of objects and 
you don't need to control the markup
- a RadioGroup/Radio is for selecting an object from a list of objects 
with free markup (e.g. a )


What you have is a special case, where you want to *set booleans on a 
list of objects*.

This can easily be achieved with a RadioGroup/Radio and a special model:

IModel agModel = new IModel() {
  public void setObject(AgModele agenda) {
for (AgModele other : agendas) {
  other.setVisible(false);
}
agenda.setVisible(true);
  }

  public AgModele getObject() {
for (AgModele other : agendas) {
  if (other.isVisible()) {
return other;
  }
}
return null;
  }
}

Use this model for your RadioGroup.

Sven

On 12/13/2013 03:48 PM, Selom wrote:

Hello,
I confess I don't  understand wicket radiogroup ( and  model ).
i spent too much time with it .

Here is my problem.









*AgPage.html*







I would like to have debut2  to be  *selected *, since visible = true.

Thanks for tour help.








-
Selom
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-selected-model-value-tp4662998.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



RadioGroup selected model value

2013-12-13 Thread Selom
Hello,
I confess I don't  understand wicket radiogroup ( and  model ).
i spent too much time with it .

Here is my problem.









*AgPage.html*







I would like to have debut2  to be  *selected *, since visible = true.

Thanks for tour help.








-
Selom
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-selected-model-value-tp4662998.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RE: RadioGroup

2012-08-11 Thread Paul Bors
Have you taken a look at the Wicket-Examples project's component references
as linked from Wicket's website under the Learn section on the left panel?
http://www.wicket-library.com/wicket-examples/compref/

More specifically the RadioGroup and Radio:
http://www.wicket-library.com/wicket-examples/compref/wicket/bookmarkable/or
g.apache.wicket.examples.compref.RadioGroupPage?2

You need your form, then add to it a RadioGroup whose model holds on to the
active Radio selection and then add all the Radio buttons to the RadioGroup.

The RadioGroup can be a  tag and if I am not wrong even a
 tag.

Same concept applies to the CheckGroup and Check, not to be confused with
CheckBox.

Hope that helps!

~ Thank you,
  Paul Bors

PS: Since Wicket is open source, you can download those projects including
wicket-examples and run them locally on your computer. See the "Provide a
path" link from under the Contribute section on the left panel of the home
page an then follow the "Check out the code" link.

-Original Message-
From: Andrea Del Bene [mailto:an.delb...@gmail.com] 
Sent: Saturday, August 11, 2012 3:48 PM
To: users@wicket.apache.org
Subject: Re: RadioGroup

Ok, but I still don't understand the relation between RadioGroup and the
Radio controls you create. I mean, I expect to find a section of the code
where you add Radio controls to RadioGroup (they "have to be in the
component hierarchy somewhere below the group component" as stated into
JavaDoc)
> Hi Andrea,
> ListView is only renderer for Radio elements,  in real life 
> selectOneRadioItems isn't empty array. Code little bit difficult to 
> understand. But problem it setting model value after form submission 
> RadioGroup instance didn't put value to model, but on rendering phase 
> it reading data from model.
> Wicket version 1.5.7.
> Valery Gorbunov
> On Sat, Aug 11, 2012 at 12:12 AM, Andrea Del Bene
wrote:
>


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



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



Re: RadioGroup

2012-08-11 Thread Andrea Del Bene
Ok, but I still don't understand the relation between RadioGroup and the 
Radio controls you create. I mean, I expect to find a section of the 
code where you add Radio controls to RadioGroup (they "have to be in the 
component hierarchy somewhere below the group component" as stated into 
JavaDoc)

Hi Andrea,
ListView is only renderer for Radio elements,  in real
life selectOneRadioItems isn't empty array. Code little bit difficult to
understand. But problem it setting model value after form submission
RadioGroup instance didn't put value to model, but on rendering phase it
reading data from model.
Wicket version 1.5.7.
Valery Gorbunov
On Sat, Aug 11, 2012 at 12:12 AM, Andrea Del Bene wrote:




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



Re: RadioGroup

2012-08-11 Thread Valery Gorbunov
Hi Andrea,
ListView is only renderer for Radio elements,  in real
life selectOneRadioItems isn't empty array. Code little bit difficult to
understand. But problem it setting model value after form submission
RadioGroup instance didn't put value to model, but on rendering phase it
reading data from model.
Wicket version 1.5.7.
Valery Gorbunov
On Sat, Aug 11, 2012 at 12:12 AM, Andrea Del Bene wrote:

> Hi and welcome to this mailing list!
>
> it's not clear to me the purpose of the ListView in your code. Why do you
> need it and what is the relation between this component and RadioGroup?
>
>> Hello there, mighty developers.
>> I'm quite new in Wicket, so beforehand sorry if my question is stupid.
>> So what i have is a RadioGroup, with some childs. When page loads for the
>> first time,
>> one of child gets selected by default, and everything is fine. But, when i
>> change selection and
>> press submit button ( non-Ajax ), form validates,re-renders and "default"
>> child instead of selected one gets selection.
>> What i'm doing wrong or not doing at all?
>>
>> here is the example of how childs get populated :
>>
>> SelectItem[] selectOneRadioItems = new SelectItem[]{};
>> RadioGroup radioGroup = new RadioGroup("radioGroup", new Model());
>> ListView selectOneRadioListItems = new
>> ListView("**radioGroup", Arrays.asList(**selectOneRadioItems))
>> {
>>protected void populateItem(ListItem<**SelectItem> item) {
>> Label label = new Label("label", new
>> Model(item.getModel().**getObject().getLabel()));
>> item.add(label);
>> SelectItemModel itemModel = new
>> SelectItemModel(**SelectItem)item.getModel().**
>> getObject());
>> Radio radio = new Radio("radio",
>> itemModel,
>> RadioGroupParent);
>> item.add(radio);
>> }
>> };
>>
>> Any tips will be appreciated.
>>
>>
>>
>> --
>> View this message in context: http://apache-wicket.1842946.**
>> n4.nabble.com/RadioGroup-**tp4651132.html<http://apache-wicket.1842946.n4.nabble.com/RadioGroup-tp4651132.html>
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> --**--**-
>> To unsubscribe, e-mail: 
>> users-unsubscribe@wicket.**apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: RadioGroup

2012-08-10 Thread Andrea Del Bene

Hi and welcome to this mailing list!

it's not clear to me the purpose of the ListView in your code. Why do 
you need it and what is the relation between this component and RadioGroup?

Hello there, mighty developers.
I'm quite new in Wicket, so beforehand sorry if my question is stupid.
So what i have is a RadioGroup, with some childs. When page loads for the
first time,
one of child gets selected by default, and everything is fine. But, when i
change selection and
press submit button ( non-Ajax ), form validates,re-renders and "default"
child instead of selected one gets selection.
What i'm doing wrong or not doing at all?

here is the example of how childs get populated :

SelectItem[] selectOneRadioItems = new SelectItem[]{};
RadioGroup radioGroup = new RadioGroup("radioGroup", new Model());
ListView selectOneRadioListItems = new
ListView("radioGroup", Arrays.asList(selectOneRadioItems)) {
   protected void populateItem(ListItem item) {
Label label = new Label("label", new
Model(item.getModel().getObject().getLabel()));
item.add(label);
SelectItemModel itemModel = new
SelectItemModel(SelectItem)item.getModel().getObject());
Radio radio = new Radio("radio", itemModel,
RadioGroupParent);
item.add(radio);
}
};

Any tips will be appreciated.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-tp4651132.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



RadioGroup

2012-08-10 Thread Artem001
Hello there, mighty developers. 
I'm quite new in Wicket, so beforehand sorry if my question is stupid.
So what i have is a RadioGroup, with some childs. When page loads for the
first time, 
one of child gets selected by default, and everything is fine. But, when i
change selection and 
press submit button ( non-Ajax ), form validates,re-renders and "default"
child instead of selected one gets selection. 
What i'm doing wrong or not doing at all?

here is the example of how childs get populated :

SelectItem[] selectOneRadioItems = new SelectItem[]{};
RadioGroup radioGroup = new RadioGroup("radioGroup", new Model());
ListView selectOneRadioListItems = new
ListView("radioGroup", Arrays.asList(selectOneRadioItems)) {
  protected void populateItem(ListItem item) {
Label label = new Label("label", new
Model(item.getModel().getObject().getLabel()));
item.add(label);
SelectItemModel itemModel = new
SelectItemModel(SelectItem)item.getModel().getObject());
Radio radio = new Radio("radio", itemModel,
RadioGroupParent);
item.add(radio);
}
};

Any tips will be appreciated. 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-tp4651132.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: "ChangeListener" for the RadioGroup Component

2012-06-15 Thread Dmitriy Neretin
Perfect! Thank you!

2012/6/15 Martin Grigorov 

> either make 'sites' final or use Wicket events (
> http://www.wicket-library.com/wicket-examples/events/ )
>
> On Fri, Jun 15, 2012 at 12:42 PM, Dmitriy Neretin
>  wrote:
> > Thanks! It was really helpful! But I am only to 99% ready :)
> >
> > There is a little problem in your code example:
> >
> > if I make so:
> > label.setDefaultModelObject(sites.getModelObject());
> >
> > I get a compiler error: "Cannot refer to a non-final variable sites
> inside
> > an inner class..." Is there any workaround for this?
> >
> > Thank you!
> >
> >
> > 2012/6/15 Martin Grigorov 
> >
> >> Something like:
> >>
> >> final Label label = ...
> >> RadioChoice sites = new RadioChoice("site", SITES);
> >>sites.add(new AjaxFormChoiceComponentUpdatingBehavior()
> >>{
> >>@Override
> >>protected void onUpdate(AjaxRequestTarget target)
> >>{
> >>
> >> label.setDefaultModelObject(sites.getModelObject());
> >>target.add(label);
> >>}
> >>});
> >>
> >> On Fri, Jun 15, 2012 at 11:25 AM, Dmitriy Neretin
> >>  wrote:
> >> > Thanks!
> >> >
> >> > Can you describe how can I use the
> >> AjaxFormChoiceComponentUpdatingBehavior()
> >> > with the label?
> >> >
> >> > 2012/6/15 Martin Grigorov 
> >> >
> >> >> Hi,
> >> >>
> >> >> #onSelectionChanged() works only if you override
> >> >> #wantOnSelectionChanged() to return true.
> >> >> Otherwise you can also use AjaxFormChoiceComponentUpdatingBehavior()
> >> >> and update the label with Ajax.
> >> >>
> >> >> -
> >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >> >>
> >> >>
> >>
> >>
> >>
> >> --
> >> Martin Grigorov
> >> jWeekend
> >> Training, Consulting, Development
> >> http://jWeekend.com
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: "ChangeListener" for the RadioGroup Component

2012-06-15 Thread Martin Grigorov
either make 'sites' final or use Wicket events (
http://www.wicket-library.com/wicket-examples/events/ )

On Fri, Jun 15, 2012 at 12:42 PM, Dmitriy Neretin
 wrote:
> Thanks! It was really helpful! But I am only to 99% ready :)
>
> There is a little problem in your code example:
>
> if I make so:
> label.setDefaultModelObject(sites.getModelObject());
>
> I get a compiler error: "Cannot refer to a non-final variable sites inside
> an inner class..." Is there any workaround for this?
>
> Thank you!
>
>
> 2012/6/15 Martin Grigorov 
>
>> Something like:
>>
>> final Label label = ...
>> RadioChoice sites = new RadioChoice("site", SITES);
>>                sites.add(new AjaxFormChoiceComponentUpdatingBehavior()
>>                {
>>                        @Override
>>                        protected void onUpdate(AjaxRequestTarget target)
>>                        {
>>
>> label.setDefaultModelObject(sites.getModelObject());
>>                                target.add(label);
>>                        }
>>                });
>>
>> On Fri, Jun 15, 2012 at 11:25 AM, Dmitriy Neretin
>>  wrote:
>> > Thanks!
>> >
>> > Can you describe how can I use the
>> AjaxFormChoiceComponentUpdatingBehavior()
>> > with the label?
>> >
>> > 2012/6/15 Martin Grigorov 
>> >
>> >> Hi,
>> >>
>> >> #onSelectionChanged() works only if you override
>> >> #wantOnSelectionChanged() to return true.
>> >> Otherwise you can also use AjaxFormChoiceComponentUpdatingBehavior()
>> >> and update the label with Ajax.
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: "ChangeListener" for the RadioGroup Component

2012-06-15 Thread Dmitriy Neretin
Thanks! It was really helpful! But I am only to 99% ready :)

There is a little problem in your code example:

if I make so:
label.setDefaultModelObject(sites.getModelObject());

I get a compiler error: "Cannot refer to a non-final variable sites inside
an inner class..." Is there any workaround for this?

Thank you!


2012/6/15 Martin Grigorov 

> Something like:
>
> final Label label = ...
> RadioChoice sites = new RadioChoice("site", SITES);
>sites.add(new AjaxFormChoiceComponentUpdatingBehavior()
>{
>@Override
>protected void onUpdate(AjaxRequestTarget target)
>{
>
> label.setDefaultModelObject(sites.getModelObject());
>target.add(label);
>}
>});
>
> On Fri, Jun 15, 2012 at 11:25 AM, Dmitriy Neretin
>  wrote:
> > Thanks!
> >
> > Can you describe how can I use the
> AjaxFormChoiceComponentUpdatingBehavior()
> > with the label?
> >
> > 2012/6/15 Martin Grigorov 
> >
> >> Hi,
> >>
> >> #onSelectionChanged() works only if you override
> >> #wantOnSelectionChanged() to return true.
> >> Otherwise you can also use AjaxFormChoiceComponentUpdatingBehavior()
> >> and update the label with Ajax.
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: "ChangeListener" for the RadioGroup Component

2012-06-15 Thread Martin Grigorov
Something like:

final Label label = ...
RadioChoice sites = new RadioChoice("site", SITES);
sites.add(new AjaxFormChoiceComponentUpdatingBehavior()
{
@Override
protected void onUpdate(AjaxRequestTarget target)
{

label.setDefaultModelObject(sites.getModelObject());
target.add(label);
}
});

On Fri, Jun 15, 2012 at 11:25 AM, Dmitriy Neretin
 wrote:
> Thanks!
>
> Can you describe how can I use the AjaxFormChoiceComponentUpdatingBehavior()
> with the label?
>
> 2012/6/15 Martin Grigorov 
>
>> Hi,
>>
>> #onSelectionChanged() works only if you override
>> #wantOnSelectionChanged() to return true.
>> Otherwise you can also use AjaxFormChoiceComponentUpdatingBehavior()
>> and update the label with Ajax.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: "ChangeListener" for the RadioGroup Component

2012-06-15 Thread Dmitriy Neretin
Thanks!

Can you describe how can I use the AjaxFormChoiceComponentUpdatingBehavior()
with the label?

2012/6/15 Martin Grigorov 

> Hi,
>
> #onSelectionChanged() works only if you override
> #wantOnSelectionChanged() to return true.
> Otherwise you can also use AjaxFormChoiceComponentUpdatingBehavior()
> and update the label with Ajax.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: "ChangeListener" for the RadioGroup Component

2012-06-15 Thread Martin Grigorov
Hi,

#onSelectionChanged() works only if you override
#wantOnSelectionChanged() to return true.
Otherwise you can also use AjaxFormChoiceComponentUpdatingBehavior()
and update the label with Ajax.

On Fri, Jun 15, 2012 at 11:01 AM, Dmitriy Neretin
 wrote:
> Hi all,
>
> I have a little problem with my RadioGroup component. I have 2 radio
> buttons inside of a ListView, witch is inside of the RadioGroup I mentioned
> above. The amount of the radios is not predefined that's because I use
> RadioGroup instead of RadioChoise. There can be 2 or 1000...
>
> The Problem is following: I also have a Label below that RadioGroup and I
> want that this label updates itself every time I select the other radio
> button. I tried to override the onSelectionChanged method of the RadioGroup
> but the method will not be executed! (I set a method- breakpoint on it)
>
> What do I wrong?
>
> The whole thing looks like that:
>
> RadioGroup
>  ListView
>   Rado, Text, Links etc.
>
> Label to update
>
> RadioGroup
>  - o Option A
>  - o Option B
>
> Label: You have selected option A/option B
>
> Thank you!
> Dmitriy



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



"ChangeListener" for the RadioGroup Component

2012-06-15 Thread Dmitriy Neretin
Hi all,

I have a little problem with my RadioGroup component. I have 2 radio
buttons inside of a ListView, witch is inside of the RadioGroup I mentioned
above. The amount of the radios is not predefined that's because I use
RadioGroup instead of RadioChoise. There can be 2 or 1000...

The Problem is following: I also have a Label below that RadioGroup and I
want that this label updates itself every time I select the other radio
button. I tried to override the onSelectionChanged method of the RadioGroup
but the method will not be executed! (I set a method- breakpoint on it)

What do I wrong?

The whole thing looks like that:

RadioGroup
  ListView
   Rado, Text, Links etc.

Label to update

RadioGroup
  - o Option A
  - o Option B

Label: You have selected option A/option B

Thank you!
Dmitriy


Re: RadioChoice vs. RadioGroup

2012-04-24 Thread Martin Grigorov
Hi,

The difference is like DropDownChoice vs. Select components.

The *Choice components generate their body by concatenating strings.
Pros: lighter component
Cons: not much control over the generated markup

Select/RadioGroup need children components like SelectOption/Radio
which themselves generate their markup.
Pros: better control over the generated markup per child
Cons: bigger component tree (more memory footprint). Imagine a page
with 200+ options.

On Tue, Apr 24, 2012 at 3:45 PM, Richard W. Adams  wrote:
> Can someone explain the important differences (besides the API) between
> RadioChoice & RadioGroup? What scenarios/factors would make one use one
> instead of the other? What are the tradeoffs? Etc. From my quick (perhaps
> naive) reading, they seem like equally plausible ways of doing the same
> thing.
>
> I looked at the javadocs, but they didn't give any useful information to
> help me choose between the two classes.
>
> **
>
> This email and any attachments may contain information that is confidential 
> and/or privileged for the sole use of the intended recipient.  Any use, 
> review, disclosure, copying, distribution or reliance by others, and any 
> forwarding of this email or its contents, without the express permission of 
> the sender is strictly prohibited by law.  If you are not the intended 
> recipient, please contact the sender immediately, delete the e-mail and 
> destroy all copies.
> **



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



RadioChoice vs. RadioGroup

2012-04-24 Thread Richard W. Adams
Can someone explain the important differences (besides the API) between 
RadioChoice & RadioGroup? What scenarios/factors would make one use one 
instead of the other? What are the tradeoffs? Etc. From my quick (perhaps 
naive) reading, they seem like equally plausible ways of doing the same 
thing.

I looked at the javadocs, but they didn't give any useful information to 
help me choose between the two classes.

**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**


Re: RadioGroup selections after validation failure problem

2012-04-03 Thread Matt Stevenson

Hi Andrea,

That solved the problem - I should have noticed it was missing the model 
myself!


Thanks so much for the help.
Matt


-Original Message- 
From: Andrea Del Bene

Sent: Monday, April 02, 2012 6:36 PM
To: users@wicket.apache.org
Subject: Re: RadioGroup selections after validation failure problem

HI,

try giving a model to your RadioGroup:

final RadioGroup group = new
RadioGroup("presentationSingleSelectGroup", new
Model());



Hi All,

My company has just started evaluating Wicket on an app that allows users 
to select and merge multiple PowerPoint presentations.


We’ve hit a bit of a problem though, basically at the moment we have one 
long form containing a number of section panels.


The section panels are either ‘multi select’ (a Panel containing a 
CheckGroup that contains Check objects representing the PowerPoint 
presentations in that section) or ‘single select’ (a Panel containing a 
RadioGroup that contains Radio objects).


The problem happens when a validation failure occurs. Basically the 
checkboxes that the user selected prior to the validation failure are 
remembered and repopulated when the user is bounced back to the page but 
the radio buttons that the user selected aren’t remembered.


Any help would be gratefully received, I’ve snipped out what I think are 
the relevant bits of code below...


Thanks
Matt


FORM CODE:
__

public class PresentationSelectionForm extends 
Form  implements Serializable

{
 private static final long serialVersionUID = 5962930827736414107L;

 final DownloadLinkPanel dlPanel = 
DownloadLinkPanel.getEmptyLink("downloadLinkPanel");
 final HiddenField  messageIndicator = new 
HiddenField("messageIndicator", new Model("0"));


 private List  selectors = new 
ArrayList();


 @SpringBean
 private AssetBankService assetBankService;



 public PresentationSelectionForm(String name, List 
sections, final PageParameters parameters)

 {
 super(name, new 
CompoundPropertyModel(new 
PresentationSelectionFormModel()));


 add(new FeedbackPanel("feedback"));
 add(dlPanel);
 add(messageIndicator);

 HiddenField  mandatorySections = new 
HiddenField("requiredSections", new 
Model(getIdListFromMandatorySections(sections)));

 add(mandatorySections);

 ListView  sectionList = new 
ListView("sections", sections)

 {
 private static final long serialVersionUID = 
7480938703389583883L;


 protected void populateItem(ListItem  sectionItem)
 {
 sectionItem.add(new Label("sectionTitle", 
sectionItem.getModelObject().getTitle()));
 PresentationMultiSelectPanel multi = new 
PresentationMultiSelectPanel("presentationMultiSelectPanel", sectionItem);
 PresentationSingleSelectPanel single = new 
PresentationSingleSelectPanel("presentationSingleSelectPanel", 
sectionItem);

 selectors.add(multi);
 selectors.add(single);
 sectionItem.add(multi);
 sectionItem.add(single);
 }
 };

 sectionList.setReuseItems(true);
 add(sectionList);
 }



 @Override
 public void onSubmit()
 {
 //create the list of asset bank ids to merge from the panel 
input...

 List  assetBankAssetIds = new ArrayList();

 for (PresentationSelector selector : selectors)
 {

assetBankAssetIds.addAll(selector.getSelectedAssetBankAssetIds());
 }

 if (assetBankAssetIds.size() == 0)
 {
 error("Unable to complete merge, no presentations were 
selected. Please select from the list then try again");

 }
 else if (!allMandatorySectionsAreCompleted())
 {
 error("Unable to complete merge, not all mandatory sections 
were completed. Please complete all mandatory sections and try again");

 }
 else
 {
 try
 {
 File mergedPresentations = 
assetBankService.getMergedPresentations(assetBankAssetIds);


addOrReplace(DownloadLinkPanel.getLinkToResourceFile("downloadLinkPanel", 
mergedPresentations, "Download your file: 
"+mergedPresentations.getName()));

 }
 catch (IOException e)
 {
 throw new RuntimeException("Error merging presentations", 
e);

 }
 }

 addOrReplace(new HiddenField("messageIndicator", new 
Model("1")));

 }
}



SINGLE SELECT PANEL CODE:




public class PresentationSingleSelectPanel extends Panel implements 
PresentationSelector, Serializable

{
 private static final long serialVersionUID = 7062146893868378278L;

 private Section section;
 final Rad

Re: RadioGroup selections after validation failure problem

2012-04-02 Thread Andrea Del Bene

HI,

try giving a model to your RadioGroup:

final RadioGroup group = new 
RadioGroup("presentationSingleSelectGroup", new 
Model());




Hi All,

My company has just started evaluating Wicket on an app that allows users to 
select and merge multiple PowerPoint presentations.

We’ve hit a bit of a problem though, basically at the moment we have one long 
form containing a number of section panels.

The section panels are either ‘multi select’ (a Panel containing a CheckGroup 
that contains Check objects representing the PowerPoint presentations in that 
section) or ‘single select’ (a Panel containing a RadioGroup that contains 
Radio objects).

The problem happens when a validation failure occurs. Basically the checkboxes 
that the user selected prior to the validation failure are remembered and 
repopulated when the user is bounced back to the page but the radio buttons 
that the user selected aren’t remembered.

Any help would be gratefully received, I’ve snipped out what I think are the 
relevant bits of code below...

Thanks
Matt


FORM CODE:
__

public class PresentationSelectionForm extends 
Form  implements Serializable
{
 private static final long serialVersionUID = 5962930827736414107L;

 final DownloadLinkPanel dlPanel = 
DownloadLinkPanel.getEmptyLink("downloadLinkPanel");
 final HiddenField  messageIndicator = new HiddenField("messageIndicator", 
new Model("0"));

 private List  selectors = new 
ArrayList();

 @SpringBean
 private AssetBankService assetBankService;



 public PresentationSelectionForm(String name, List  sections, 
final PageParameters parameters)
 {
 super(name, new 
CompoundPropertyModel(new 
PresentationSelectionFormModel()));

 add(new FeedbackPanel("feedback"));
 add(dlPanel);
 add(messageIndicator);

 HiddenField  mandatorySections = new 
HiddenField("requiredSections", new 
Model(getIdListFromMandatorySections(sections)));
 add(mandatorySections);

 ListView  sectionList = new ListView("sections", 
sections)
 {
 private static final long serialVersionUID = 7480938703389583883L;

 protected void populateItem(ListItem  sectionItem)
 {
 sectionItem.add(new Label("sectionTitle", 
sectionItem.getModelObject().getTitle()));
 PresentationMultiSelectPanel multi = new 
PresentationMultiSelectPanel("presentationMultiSelectPanel", sectionItem);
 PresentationSingleSelectPanel single = new 
PresentationSingleSelectPanel("presentationSingleSelectPanel", sectionItem);
 selectors.add(multi);
 selectors.add(single);
 sectionItem.add(multi);
 sectionItem.add(single);
 }
 };

 sectionList.setReuseItems(true);
 add(sectionList);
 }



 @Override
 public void onSubmit()
 {
 //create the list of asset bank ids to merge from the panel input...
 List  assetBankAssetIds = new ArrayList();

 for (PresentationSelector selector : selectors)
 {
 assetBankAssetIds.addAll(selector.getSelectedAssetBankAssetIds());
 }

 if (assetBankAssetIds.size() == 0)
 {
 error("Unable to complete merge, no presentations were selected. Please 
select from the list then try again");
 }
 else if (!allMandatorySectionsAreCompleted())
 {
 error("Unable to complete merge, not all mandatory sections were 
completed. Please complete all mandatory sections and try again");
 }
 else
 {
 try
 {
 File mergedPresentations = 
assetBankService.getMergedPresentations(assetBankAssetIds);
 
addOrReplace(DownloadLinkPanel.getLinkToResourceFile("downloadLinkPanel", 
mergedPresentations, "Download your file: "+mergedPresentations.getName()));
 }
 catch (IOException e)
 {
 throw new RuntimeException("Error merging presentations", e);
 }
 }

 addOrReplace(new HiddenField("messageIndicator", new 
Model("1")));
 }
}



SINGLE SELECT PANEL CODE:




public class PresentationSingleSelectPanel extends Panel implements 
PresentationSelector, Serializable
{
 private static final long serialVersionUID = 7062146893868378278L;

 private Section section;
 final RadioGroup  group = new 
RadioGroup("presentationSingleSelectGroup");

 public PresentationSingleSelectPanel(String id, ListItem  
sectionItem)
 {
 super(id);
 section = sectionItem.getModelObject();

 ListView  presentations = new 
ListView("presentations", 
s

RadioGroup selections after validation failure problem

2012-04-02 Thread Matt Stevenson
Hi All,

My company has just started evaluating Wicket on an app that allows users to 
select and merge multiple PowerPoint presentations. 

We’ve hit a bit of a problem though, basically at the moment we have one long 
form containing a number of section panels. 

The section panels are either ‘multi select’ (a Panel containing a CheckGroup 
that contains Check objects representing the PowerPoint presentations in that 
section) or ‘single select’ (a Panel containing a RadioGroup that contains 
Radio objects).

The problem happens when a validation failure occurs. Basically the checkboxes 
that the user selected prior to the validation failure are remembered and 
repopulated when the user is bounced back to the page but the radio buttons 
that the user selected aren’t remembered.

Any help would be gratefully received, I’ve snipped out what I think are the 
relevant bits of code below...

Thanks
Matt


FORM CODE:
__

public class PresentationSelectionForm extends 
Form implements Serializable
{
private static final long serialVersionUID = 5962930827736414107L;

final DownloadLinkPanel dlPanel = 
DownloadLinkPanel.getEmptyLink("downloadLinkPanel");
final HiddenField messageIndicator = new 
HiddenField("messageIndicator", new Model("0"));

private List selectors = new 
ArrayList();

@SpringBean
private AssetBankService assetBankService;



public PresentationSelectionForm(String name, List sections, final 
PageParameters parameters)
{
super(name, new 
CompoundPropertyModel(new 
PresentationSelectionFormModel()));

add(new FeedbackPanel("feedback"));
add(dlPanel);
add(messageIndicator);

HiddenField mandatorySections = new 
HiddenField("requiredSections", new 
Model(getIdListFromMandatorySections(sections)));
add(mandatorySections);

ListView sectionList = new ListView("sections", 
sections)
{
private static final long serialVersionUID = 7480938703389583883L;

protected void populateItem(ListItem sectionItem)
{
sectionItem.add(new Label("sectionTitle", 
sectionItem.getModelObject().getTitle()));
PresentationMultiSelectPanel multi = new 
PresentationMultiSelectPanel("presentationMultiSelectPanel", sectionItem);
PresentationSingleSelectPanel single = new 
PresentationSingleSelectPanel("presentationSingleSelectPanel", sectionItem);
selectors.add(multi);
selectors.add(single);
sectionItem.add(multi);
sectionItem.add(single);
}
};

sectionList.setReuseItems(true);
add(sectionList);
}



@Override 
public void onSubmit()
{
//create the list of asset bank ids to merge from the panel input...
List assetBankAssetIds = new ArrayList();

for (PresentationSelector selector : selectors)
{
assetBankAssetIds.addAll(selector.getSelectedAssetBankAssetIds());
}

if (assetBankAssetIds.size() == 0)
{
error("Unable to complete merge, no presentations were selected. 
Please select from the list then try again");
} 
else if (!allMandatorySectionsAreCompleted())
{
error("Unable to complete merge, not all mandatory sections were 
completed. Please complete all mandatory sections and try again");
} 
else
{
try
{
File mergedPresentations = 
assetBankService.getMergedPresentations(assetBankAssetIds);

addOrReplace(DownloadLinkPanel.getLinkToResourceFile("downloadLinkPanel", 
mergedPresentations, "Download your file: "+mergedPresentations.getName()));
}
catch (IOException e)
{
throw new RuntimeException("Error merging presentations", e);
}
}

addOrReplace(new HiddenField("messageIndicator", new 
Model("1")));
}
}



SINGLE SELECT PANEL CODE:




public class PresentationSingleSelectPanel extends Panel implements 
PresentationSelector, Serializable
{
private static final long serialVersionUID = 7062146893868378278L;

private Section section;
final RadioGroup group = new 
RadioGroup("presentationSingleSelectGroup");

public PresentationSingleSelectPanel(String id, ListItem 
sectionItem)
{
super(id);
section = sectionItem.getModelObject();

ListView presentations = new 
ListView("presentations", 
sectionItem.getModelObject().getPresentations()) 
{
private static final long serialVersionUID = -2741478778745

Re: how to test what radio is checked in a radiogroup?

2011-08-22 Thread Mathilde Pellerin
It works well when I don't provide the complete path !

Thank you a lot Mike !


Re: how to test what radio is checked in a radiogroup?

2011-08-22 Thread Kent Tong
> In my unit test, I try to check what radio is selected, but I don't find
> how...

You may check out http://wicketpagetest.sourceforge.net which will work
for this use case.



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



Re: how to test what radio is checked in a radiogroup?

2011-08-22 Thread Mike Mander

Am 22.08.2011 13:27, schrieb Mike Mander:

Am 22.08.2011 09:45, schrieb Mathilde Pellerin:

Hi all,

thanks for your answers.
So, Ajax can be a problem with tagTester. Ok, so I don't use Ajax 
response

anymore to render my page :

 public void 
testStory23_TA21_VerificationInitialisationBoutonsRadio(){

 Questionnaire questionnaire =
serviceQuestionnaire.findBytitre("Questionnaire pour Femme").get(0);
 CreationQuestionnairePage creationQuestionnairePage = new
CreationQuestionnairePage(
 new PageParameters("p=2"), questionnaire);
 tester.startPage(creationQuestionnairePage);
 tester.assertRenderedPage(CreationQuestionnairePage.class);

then, I checked my markup by tester.dumpPage() :
Questionnaires


{ }.bind(this),function() { }.bind(this), function() {return
Wicket.$('retourRecapitulatif3') != null;}.bind(this));return
!wcall;">Retour à la liste
 des questionnaires

Création d'un nouveau questionnaire :

action="?wicket:interface=:0:formCreationQuestionnaire::IFormSubmitListener::" 


enctype="multipart/form-data">style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;overflow:hidden">

type="hidden" name="formCreationQuestionnaire4_hf_0"
id="formCreationQuestionnaire4_hf_0" />








Titre du nouveau questionnaire
:




Numéro :




Genre des destinataires :

  wicket:id="femme" id="femme6" name="genre" value="radio0" 
checked="checked"

class="wicket-genre7"/>  Femme
    Homme
    Mixte




we can see that radio button with wicket:id="femme" have tag "checked".
But in my test :
 TagTester tagFemme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:femme");
 TagTester tagHomme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:homme");
 TagTester tagMixte =
tester.getTagByWicketId("formCreationQuestionnaire:genre:mixte");
 //tester.debugComponentTrees();
 tester.dumpPage();
 Assert.assertNotNull(tagFemme);

tagFemme is still null.

I checked my path for this radio button with 
tester.debugComponentTrees() :
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:genre

 org.apache.wicket.markup.html.form.RadioGroup [f]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:genre:femme
org.apache.wicket.markup.html.form.Radio [f]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:genre:homme
org.apache.wicket.markup.html.form.Radio [h]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:genre:mixte
org.apache.wicket.markup.html.form.Radio [b]

I really don't understand what am I doing wrong...


Where is genre? Try

formCreationQuestionnaire:homme

. Did that help?
Mike

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



Ähm sorry for my stupidity but i didn't used this for a long time.
Try to use homme (and other radios) only!!! TagTester is searching for 
the wicket:id. Parent components are not relevant. So you don't have to 
provide the complete path.


Sorry,
Mike

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



Re: how to test what radio is checked in a radiogroup?

2011-08-22 Thread Mike Mander

Am 22.08.2011 09:45, schrieb Mathilde Pellerin:

Hi all,

thanks for your answers.
So, Ajax can be a problem with tagTester. Ok, so I don't use Ajax response
anymore to render my page :

 public void testStory23_TA21_VerificationInitialisationBoutonsRadio(){
 Questionnaire questionnaire =
serviceQuestionnaire.findBytitre("Questionnaire pour Femme").get(0);
 CreationQuestionnairePage creationQuestionnairePage = new
CreationQuestionnairePage(
 new PageParameters("p=2"), questionnaire);
 tester.startPage(creationQuestionnairePage);
 tester.assertRenderedPage(CreationQuestionnairePage.class);

then, I checked my markup by tester.dumpPage() :
Questionnaires
 
 Retour à la liste
 des questionnaires
 
 Création d'un nouveau questionnaire :
 
 
 
 
 


 
 
 
 Titre du nouveau questionnaire
:
 
 
 
 
 Numéro :
 
 
 
 
 Genre des destinataires :
 
     Femme
     Homme
     Mixte

 
 

we can see that radio button with wicket:id="femme" have tag "checked".
But in my test :
 TagTester tagFemme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:femme");
 TagTester tagHomme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:homme");
 TagTester tagMixte =
tester.getTagByWicketId("formCreationQuestionnaire:genre:mixte");
 //tester.debugComponentTrees();
 tester.dumpPage();
 Assert.assertNotNull(tagFemme);

tagFemme is still null.

I checked my path for this radio button with tester.debugComponentTrees() :
INFO  - BaseWicketTester   - pathformCreationQuestionnaire:genre
 org.apache.wicket.markup.html.form.RadioGroup [f]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:genre:femme
org.apache.wicket.markup.html.form.Radio [f]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:genre:homme
org.apache.wicket.markup.html.form.Radio [h]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:genre:mixte
org.apache.wicket.markup.html.form.Radio [b]

I really don't understand what am I doing wrong...


Where is genre? Try

formCreationQuestionnaire:homme

. Did that help?
Mike

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



Re: how to test what radio is checked in a radiogroup?

2011-08-22 Thread Mathilde Pellerin
Hi all,

thanks for your answers.
So, Ajax can be a problem with tagTester. Ok, so I don't use Ajax response
anymore to render my page :

public void testStory23_TA21_VerificationInitialisationBoutonsRadio(){
Questionnaire questionnaire =
serviceQuestionnaire.findBytitre("Questionnaire pour Femme").get(0);
CreationQuestionnairePage creationQuestionnairePage = new
CreationQuestionnairePage(
new PageParameters("p=2"), questionnaire);
tester.startPage(creationQuestionnairePage);
tester.assertRenderedPage(CreationQuestionnairePage.class);

then, I checked my markup by tester.dumpPage() :
Questionnaires

Retour à la liste
des questionnaires

Création d'un nouveau questionnaire :










Titre du nouveau questionnaire
:




Numéro :




Genre des destinataires :

     Femme
     Homme
     Mixte




we can see that radio button with wicket:id="femme" have tag "checked".
But in my test :
TagTester tagFemme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:femme");
TagTester tagHomme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:homme");
TagTester tagMixte =
tester.getTagByWicketId("formCreationQuestionnaire:genre:mixte");
//tester.debugComponentTrees();
tester.dumpPage();
Assert.assertNotNull(tagFemme);

tagFemme is still null.

I checked my path for this radio button with tester.debugComponentTrees() :
INFO  - BaseWicketTester   - pathformCreationQuestionnaire:genre
org.apache.wicket.markup.html.form.RadioGroup [f]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:genre:femme
org.apache.wicket.markup.html.form.Radio [f]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:genre:homme
org.apache.wicket.markup.html.form.Radio [h]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:genre:mixte
org.apache.wicket.markup.html.form.Radio [b]

I really don't understand what am I doing wrong...


Re: how to test what radio is checked in a radiogroup?

2011-08-19 Thread Per Newgro

Welcome to wicket Shunmuga

Did you check the website http://wicket.apache.org already. It's all there.
Check the wiki, component examples and books section.

Hope you have fun with wicket

Cheers
Per

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



Re: how to test what radio is checked in a radiogroup?

2011-08-19 Thread Shunmuga Raj
Hi all,

  I'm new to Wicket. Can you help me to know what is wicket & how it
works? pls ppl's mail me the links for it's tutorials and learning path. Now
i'm using Netbeans 6.9,7.0 so pls share the plugins for it too, Thanks in
advance

On Fri, Aug 19, 2011 at 11:28 PM, "Mike Müller"  wrote:

> If i'm not completely wrong is tester.clickLink(path) a wrapper for
> tester.clickLink(path, isAjax = true). So you get an ajax response.
> You can check that by calling tester.dumpPage().
>
> The problem is that wicket tester only works on page markup. It is not
> working on ajax response markup (at least i didn't get it to work.
> Once i've wrote an extractor. Maybe that helps you to.
>
> 
> package de.frontend.wicket.testtools;
>
> public final class AjaxResponseComponentMarkup {
>
>private final String _ajaxResponseMarkup;
>private final int _componentTagStartPosition;
>private final int _componentTagEndPosition;
>
>public AjaxResponseComponentMarkup(String ajaxResponseMarkup) {
>_ajaxResponseMarkup = ajaxResponseMarkup;
>_componentTagStartPosition =
> _ajaxResponseMarkup.indexOf("_componentTagEndPosition =
> _ajaxResponseMarkup.indexOf("");
>}
>
>public String extract() {
>StringBuilder result = new StringBuilder();
>if (hasComponentTag()) {
>
>  
> result.append(_ajaxResponseMarkup.substring(startOfAjaxResponseComponentMarkup(),
> endOfAjaxResponseComponentMarkup()));
>}
>return result.toString();
>}
>
>private int startOfAjaxResponseComponentMarkup() {
>String cdataTag = "";
>return
> _ajaxResponseMarkup.substring(_componentTagStartPosition,
> _componentTagEndPosition).lastIndexOf(cdataTag) +
> _componentTagStartPosition;
>}
>
>private boolean hasComponentTag() {
>return _componentTagStartPosition != -1;
>}
> }
> 
> This is only extracting the markup in CDATA of ajax response.
> Use it this way:
>
> 
>
>private void assertExpandedNodeAt(int row) {
>List t = TagTester.createTagsByAttribute(new
> AjaxResponseComponentMarkup(_tester.getServletResponse().getDocument()).extract(),
> "wicketpath",
>"brdPage_availability_tariffTable_rows_" +
> row + "_cells_1_cell_junction", true);
>Assert.assertTrue("Node " + row + " is collapsed",
> t.get(0).getAttributeIs("class", "tree-junction-expanded"));
>}
> 
>
> Please see TagTester.createTagsByAttribute for concrete parameters
> required.
>
> Maybe someone else has a better approach. But for me this was working.
>
> Hth
> Mike
>
>  Original-Nachricht 
> > Datum: Fri, 19 Aug 2011 18:38:43 +0200
> > Von: Mathilde Pellerin 
> > An: users@wicket.apache.org
> > Betreff: Re: how to test what radio is checked in a radiogroup?
>
> > hum, yes and no... I mean, page is loaded by an ajax response (AjaxLink),
> > but then there is no Ajax.
> > This is the entire test, maybe it can help :
> >
> > @SuppressWarnings("unchecked")
> > @Test @Transactional @Rollback
> > public void
> testStory23_TA21_VerificationInitialisationBoutonsRadio(){
> > tester.startPage(RecapitulatifQuestionnairePage.class);
> > tester.assertRenderedPage(RecapitulatifQuestionnairePage.class);
> > tester.clickLink("questionnaireEnCours:1:modifier");
> > tester.assertRenderedPage(CreationQuestionnairePage.class);
> >
> >     Form form = (Form)
> > tester.getComponentFromLastRenderedPage(
> > "formCreationQuestionnaire");
> >
> > //On vérifie que le formulaire est préremplie avec le
> > questionnaire
> > sélectionné
> > Questionnaire qObtenu = form.getModelObject();
> > Assert.assertNotNull(qObtenu);
> >
> > //Vérification du sexe des destinataires
> > String genreAttendu = qObtenu.getSexeDestinataire().toString();
> > String genreObtenu =
> > ((RadioGroup)form.get("genre")).getDefaultModelObjectAsString();
> > Assert.assertEquals(genreAttendu, genreObtenu);
> >
> > TagTester tagFemme =
> > tester.getTagByWicketId("formCreationQuestionnaire:genre:femme");
> > Ta

Re: how to test what radio is checked in a radiogroup?

2011-08-19 Thread Mike Müller
If i'm not completely wrong is tester.clickLink(path) a wrapper for 
tester.clickLink(path, isAjax = true). So you get an ajax response.
You can check that by calling tester.dumpPage().

The problem is that wicket tester only works on page markup. It is not
working on ajax response markup (at least i didn't get it to work.
Once i've wrote an extractor. Maybe that helps you to.


package de.frontend.wicket.testtools;

public final class AjaxResponseComponentMarkup {

private final String _ajaxResponseMarkup;
private final int _componentTagStartPosition;
private final int _componentTagEndPosition;

public AjaxResponseComponentMarkup(String ajaxResponseMarkup) {
_ajaxResponseMarkup = ajaxResponseMarkup;
_componentTagStartPosition = 
_ajaxResponseMarkup.indexOf("");
}

public String extract() {
StringBuilder result = new StringBuilder();
if (hasComponentTag()) {

result.append(_ajaxResponseMarkup.substring(startOfAjaxResponseComponentMarkup(),
 endOfAjaxResponseComponentMarkup()));
}
return result.toString();
}

private int startOfAjaxResponseComponentMarkup() {
String cdataTag = "";
return 
_ajaxResponseMarkup.substring(_componentTagStartPosition, 
_componentTagEndPosition).lastIndexOf(cdataTag) + _componentTagStartPosition;
}

private boolean hasComponentTag() {
return _componentTagStartPosition != -1;
}
}
 
This is only extracting the markup in CDATA of ajax response.
Use it this way:



private void assertExpandedNodeAt(int row) {
List t = TagTester.createTagsByAttribute(new 
AjaxResponseComponentMarkup(_tester.getServletResponse().getDocument()).extract(),
 "wicketpath",
"brdPage_availability_tariffTable_rows_" + row 
+ "_cells_1_cell_junction", true);
Assert.assertTrue("Node " + row + " is collapsed", 
t.get(0).getAttributeIs("class", "tree-junction-expanded"));
}


Please see TagTester.createTagsByAttribute for concrete parameters required.

Maybe someone else has a better approach. But for me this was working.

Hth
Mike

 Original-Nachricht 
> Datum: Fri, 19 Aug 2011 18:38:43 +0200
> Von: Mathilde Pellerin 
> An: users@wicket.apache.org
> Betreff: Re: how to test what radio is checked in a radiogroup?

> hum, yes and no... I mean, page is loaded by an ajax response (AjaxLink),
> but then there is no Ajax.
> This is the entire test, maybe it can help :
> 
> @SuppressWarnings("unchecked")
> @Test @Transactional @Rollback
> public void testStory23_TA21_VerificationInitialisationBoutonsRadio(){
> tester.startPage(RecapitulatifQuestionnairePage.class);
> tester.assertRenderedPage(RecapitulatifQuestionnairePage.class);
> tester.clickLink("questionnaireEnCours:1:modifier");
> tester.assertRenderedPage(CreationQuestionnairePage.class);
> 
> Form form = (Form)
> tester.getComponentFromLastRenderedPage(
> "formCreationQuestionnaire");
> 
> //On vérifie que le formulaire est préremplie avec le
> questionnaire
> sélectionné
> Questionnaire qObtenu = form.getModelObject();
>     Assert.assertNotNull(qObtenu);
> 
> //Vérification du sexe des destinataires
> String genreAttendu = qObtenu.getSexeDestinataire().toString();
> String genreObtenu =
> ((RadioGroup)form.get("genre")).getDefaultModelObjectAsString();
> Assert.assertEquals(genreAttendu, genreObtenu);
> 
> TagTester tagFemme =
> tester.getTagByWicketId("formCreationQuestionnaire:genre:femme");
> TagTester tagHomme =
> tester.getTagByWicketId("formCreationQuestionnaire:genre:homme");
> TagTester tagMixte =
> tester.getTagByWicketId("formCreationQuestionnaire:genre:mixte");
> tester.debugComponentTrees();
> Assert.assertNotNull(tagFemme);
> 
> Assert.assertTrue(tagFemme.hasAttribute("checked"));
> Assert.assertFalse(tagHomme.hasAttribute("checked"));
> Assert.assertFalse(tagMixte.hasAttribute("checked"));
> }

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

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



Re: how to test what radio is checked in a radiogroup?

2011-08-19 Thread Mathilde Pellerin
hum, yes and no... I mean, page is loaded by an ajax response (AjaxLink),
but then there is no Ajax.
This is the entire test, maybe it can help :

@SuppressWarnings("unchecked")
@Test @Transactional @Rollback
public void testStory23_TA21_VerificationInitialisationBoutonsRadio(){
tester.startPage(RecapitulatifQuestionnairePage.class);
tester.assertRenderedPage(RecapitulatifQuestionnairePage.class);
tester.clickLink("questionnaireEnCours:1:modifier");
tester.assertRenderedPage(CreationQuestionnairePage.class);

Form form = (Form)
tester.getComponentFromLastRenderedPage(
"formCreationQuestionnaire");

//On vérifie que le formulaire est préremplie avec le questionnaire
sélectionné
Questionnaire qObtenu = form.getModelObject();
Assert.assertNotNull(qObtenu);

//Vérification du sexe des destinataires
String genreAttendu = qObtenu.getSexeDestinataire().toString();
    String genreObtenu =
((RadioGroup)form.get("genre")).getDefaultModelObjectAsString();
Assert.assertEquals(genreAttendu, genreObtenu);

TagTester tagFemme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:femme");
TagTester tagHomme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:homme");
TagTester tagMixte =
tester.getTagByWicketId("formCreationQuestionnaire:genre:mixte");
tester.debugComponentTrees();
Assert.assertNotNull(tagFemme);

Assert.assertTrue(tagFemme.hasAttribute("checked"));
Assert.assertFalse(tagHomme.hasAttribute("checked"));
Assert.assertFalse(tagMixte.hasAttribute("checked"));
}


Re: how to test what radio is checked in a radiogroup?

2011-08-19 Thread Mike Mander

Am 19.08.2011 16:38, schrieb Mathilde Pellerin:

  I add WicketTester.debugComponentTrees() in my test juste before
assertNotNull which failed like this :

 TagTester tagFemme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:femme");
 TagTester tagHomme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:homme");
 TagTester tagMixte =
tester.getTagByWicketId("formCreationQuestionnaire:genre:mixte");
 tester.debugComponentTrees();
 Assert.assertNotNull(tagFemme);

and this is the output (lines relatives to radiogroup are in bold) :

INFO  - BaseWicketTester   - debugging
--
INFO  - BaseWicketTester   - pathlogo
org.apache.wicket.markup.html.link.BookmarkablePageLink []
INFO  - BaseWicketTester   - pathdeconnexion
org.apache.wicket.markup.html.link.Link []
INFO  - BaseWicketTester   - pathtableaubord
org.apache.wicket.markup.html.link.BookmarkablePageLink []
INFO  - BaseWicketTester   - pathrecapitulatifQuestionnaire
org.apache.wicket.markup.html.link.BookmarkablePageLink []
INFO  - BaseWicketTester   - pathretourRecapitulatif
org.apache.wicket.ajax.markup.html.AjaxLink []
INFO  - BaseWicketTester   - pathfenetreModale
fr.statlife.protoE4N.pages.ModalWindowE4N []
INFO  - BaseWicketTester   - pathfenetreModale:content
fr.statlife.protoE4N.pages.questionnaire.QuestionnaireContentPanel []
INFO  - BaseWicketTester   - pathfenetreModale:content:qForm
org.apache.wicket.markup.html.form.Form []
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qErrorMsg
org.apache.wicket.markup.html.panel.FeedbackPanel []
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qErrorMsg:feedbackul
org.apache.wicket.markup.html.WebMarkupContainer []
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qErrorMsg:feedbackul:messages
org.apache.wicket.markup.html.list.ListView [[]]
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qRepeating
org.apache.wicket.markup.repeater.RepeatingView []
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qRepeating:1
org.apache.wicket.markup.html.WebMarkupContainer []
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qRepeating:1:question
org.apache.wicket.markup.html.basic.Label [vide :(]
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:ajaxSubmitQuestionnaire
org.apache.wicket.ajax.markup.html.form.AjaxButton [Fermer]
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qCancelbutton
org.apache.wicket.ajax.markup.html.form.AjaxButton []
INFO  - BaseWicketTester   - pathformCreationQuestionnaire
org.apache.wicket.markup.html.form.Form [Questionnaire
[idQuestionnaire=26, numero=Q2, titre=Questionnaire pour Femme,
sexeDestinataire=f, publie=null, listeQuestionnaires=[],
listeQuestions=[Question [idQuestion=27, numQuestion=1, question=Type liste
:, typeReponse=LISTE, legende=null,
reponsesPossibles=0g,30g,60g,90g,120g,150g,200g,250g et +,
idQuestionnaire=26], Question [idQuestion=28, numQuestion=2, question=Type
champsTexte :, typeReponse=TEXTE, legende=null, reponsesPossibles=null,
idQuestionnaire=26], Question [idQuestion=29, numQuestion=3, question=Type
date :, typeReponse=DATE, legende=null, reponsesPossibles=null,
idQuestionnaire=26], Question [idQuestion=30, numQuestion=4, question=Type
radio :, typeReponse=RADIO, legende=null,
reponsesPossibles=rouge,vert,jaune,bleu, idQuestionnaire=26], Question
[idQuestion=31, numQuestion=5, question=Type checkbox :,
typeReponse=CHECKBOX, legende=null, reponsesPossibles=rouge,vert,jaune,bleu,
idQuestionnaire=26]], listeReponses=[]]]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:feedback
org.apache.wicket.markup.html.panel.FeedbackPanel [No get method defined
for class: class fr.statlife.protoE4N.data.entites.Questionnaire expression:
feedback]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:feedback:feedbackul
org.apache.wicket.markup.html.WebMarkupContainer [No get method defined
for class: class fr.statlife.protoE4N.data.entites.Questionnaire expression:
feedbackul]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:feedback:feedbackul:messages
org.apache.wicket.markup.html.list.ListView [[]]
INFO  - BaseWicketTester   - pathformCreationQuestionnaire:titre
 org.apache.wicket.markup.html.form.TextField [Questionnaire pour
Femme]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:numero
org.apache.wicket.markup.html.form.TextField [Q2]
*INFO  - BaseWicketTester   - path
formCreationQuestionnaire:genre
org.apache.wicket.markup.html.form.RadioGroup [f]
INFO  - Bas

Re: how to test what radio is checked in a radiogroup?

2011-08-19 Thread Mathilde Pellerin
 I add WicketTester.debugComponentTrees() in my test juste before
assertNotNull which failed like this :

TagTester tagFemme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:femme");
TagTester tagHomme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:homme");
TagTester tagMixte =
tester.getTagByWicketId("formCreationQuestionnaire:genre:mixte");
tester.debugComponentTrees();
Assert.assertNotNull(tagFemme);

and this is the output (lines relatives to radiogroup are in bold) :

INFO  - BaseWicketTester   - debugging
--
INFO  - BaseWicketTester   - pathlogo
org.apache.wicket.markup.html.link.BookmarkablePageLink []
INFO  - BaseWicketTester   - pathdeconnexion
org.apache.wicket.markup.html.link.Link []
INFO  - BaseWicketTester   - pathtableaubord
org.apache.wicket.markup.html.link.BookmarkablePageLink []
INFO  - BaseWicketTester   - pathrecapitulatifQuestionnaire
org.apache.wicket.markup.html.link.BookmarkablePageLink []
INFO  - BaseWicketTester   - pathretourRecapitulatif
org.apache.wicket.ajax.markup.html.AjaxLink []
INFO  - BaseWicketTester   - pathfenetreModale
fr.statlife.protoE4N.pages.ModalWindowE4N []
INFO  - BaseWicketTester   - pathfenetreModale:content
fr.statlife.protoE4N.pages.questionnaire.QuestionnaireContentPanel []
INFO  - BaseWicketTester   - pathfenetreModale:content:qForm
org.apache.wicket.markup.html.form.Form []
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qErrorMsg
org.apache.wicket.markup.html.panel.FeedbackPanel []
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qErrorMsg:feedbackul
org.apache.wicket.markup.html.WebMarkupContainer []
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qErrorMsg:feedbackul:messages
org.apache.wicket.markup.html.list.ListView [[]]
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qRepeating
org.apache.wicket.markup.repeater.RepeatingView []
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qRepeating:1
org.apache.wicket.markup.html.WebMarkupContainer []
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qRepeating:1:question
org.apache.wicket.markup.html.basic.Label [vide :(]
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:ajaxSubmitQuestionnaire
org.apache.wicket.ajax.markup.html.form.AjaxButton [Fermer]
INFO  - BaseWicketTester   - path
fenetreModale:content:qForm:qCancelbutton
org.apache.wicket.ajax.markup.html.form.AjaxButton []
INFO  - BaseWicketTester   - pathformCreationQuestionnaire
org.apache.wicket.markup.html.form.Form [Questionnaire
[idQuestionnaire=26, numero=Q2, titre=Questionnaire pour Femme,
sexeDestinataire=f, publie=null, listeQuestionnaires=[],
listeQuestions=[Question [idQuestion=27, numQuestion=1, question=Type liste
:, typeReponse=LISTE, legende=null,
reponsesPossibles=0g,30g,60g,90g,120g,150g,200g,250g et +,
idQuestionnaire=26], Question [idQuestion=28, numQuestion=2, question=Type
champsTexte :, typeReponse=TEXTE, legende=null, reponsesPossibles=null,
idQuestionnaire=26], Question [idQuestion=29, numQuestion=3, question=Type
date :, typeReponse=DATE, legende=null, reponsesPossibles=null,
idQuestionnaire=26], Question [idQuestion=30, numQuestion=4, question=Type
radio :, typeReponse=RADIO, legende=null,
reponsesPossibles=rouge,vert,jaune,bleu, idQuestionnaire=26], Question
[idQuestion=31, numQuestion=5, question=Type checkbox :,
typeReponse=CHECKBOX, legende=null, reponsesPossibles=rouge,vert,jaune,bleu,
idQuestionnaire=26]], listeReponses=[]]]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:feedback
org.apache.wicket.markup.html.panel.FeedbackPanel [No get method defined
for class: class fr.statlife.protoE4N.data.entites.Questionnaire expression:
feedback]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:feedback:feedbackul
org.apache.wicket.markup.html.WebMarkupContainer [No get method defined
for class: class fr.statlife.protoE4N.data.entites.Questionnaire expression:
feedbackul]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:feedback:feedbackul:messages
org.apache.wicket.markup.html.list.ListView [[]]
INFO  - BaseWicketTester   - pathformCreationQuestionnaire:titre
org.apache.wicket.markup.html.form.TextField [Questionnaire pour
Femme]
INFO  - BaseWicketTester   - path
formCreationQuestionnaire:numero
org.apache.wicket.markup.html.form.TextField [Q2]
*INFO  - BaseWicketTester   - path
formCreationQuestionnaire:genre
org.apache.wicket.markup.html.form.RadioGroup [f]
INFO  - BaseWicketTester   - path
formCre

Re: how to test what radio is checked in a radiogroup?

2011-08-19 Thread Mike Mander

Am 19.08.2011 15:35, schrieb Mathilde Pellerin:

Thank you for your answer Mike.

I didn't find out how could I try with Radio.onComponentTag, so I tried with
tagTester.

I think it could be a good solution, so I did that :
 TagTester tagFemme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:femme");
 TagTester tagHomme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:homme");
 TagTester tagMixte =
tester.getTagByWicketId("formCreationQuestionnaire:genre:mixte");
 Assert.assertNotNull(tagFemme);
 Assert.assertTrue(tagFemme.hasAttribute("checked"));
 Assert.assertFalse(tagHomme.hasAttribute("checked"));
 Assert.assertFalse(tagMixte.hasAttribute("checked"));

but my tagTester are always null ! I checked path many times, and I tried
other way to instantiate tagTester, but without success.
I already used TagTester in other test before without problem, and I really
don't understand why it is always null here...


Can you provide output from WicketTester.debugComponentTree()?

Mike

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



Re: how to test what radio is checked in a radiogroup?

2011-08-19 Thread Mathilde Pellerin
Thank you for your answer Mike.

I didn't find out how could I try with Radio.onComponentTag, so I tried with
tagTester.

I think it could be a good solution, so I did that :
TagTester tagFemme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:femme");
TagTester tagHomme =
tester.getTagByWicketId("formCreationQuestionnaire:genre:homme");
TagTester tagMixte =
tester.getTagByWicketId("formCreationQuestionnaire:genre:mixte");
Assert.assertNotNull(tagFemme);
Assert.assertTrue(tagFemme.hasAttribute("checked"));
Assert.assertFalse(tagHomme.hasAttribute("checked"));
Assert.assertFalse(tagMixte.hasAttribute("checked"));

but my tagTester are always null ! I checked path many times, and I tried
other way to instantiate tagTester, but without success.
I already used TagTester in other test before without problem, and I really
don't understand why it is always null here...


Re: how to test what radio is checked in a radiogroup?

2011-08-19 Thread Mike Mander

Am 19.08.2011 14:21, schrieb Mathilde Pellerin:

Hi all,

I have a form with a Radiogroup :

In my form, I have a radiogroup like this :
 RadioGroup  genre = new
RadioGroup("genreDestinataire");
 genre.setRequired(true);
 genre.setLabel(new Model("Genre destinataire"));
 genre.add(new Radio("femme", new Model("f")));
 genre.add(new Radio("homme", new Model("h")));
 genre.add(new Radio("mixte", new Model("b")));
 form.add(genre);

This radiogroup match the genreDestinataire field in Questionnaire Entity
(with a CompoundPropertyModel).

In my unit test, I try to check what radio is selected, but I don't find
how...
I can get Model Object from radioGroup like this :
 String genreObtenu =
((RadioGroup)form.get("genreDestinataire")).getDefaultModelObjectAsString();

but it works even if none of radio is checked. It happen when I fill the
form with existant Questionnaire : radiogroup model is ok, but none of radio
is checked.
Before correct this bug, I want to reproduce it in test, but I didn't find
how to see if a radio is checked or not : I didn't find any method like
"isChecked" or "isSelected" on Radio Component.

Is there any way to check that ?

Thanks.
M.

Maybe you can get the component from last renderered page (by path to 
component) and cast it to radio.
Then you can compare raw input of group with the radio value (see 
Radio.onComponentTag).


Other option would be to use the tag tester provided by WicketTester. See

/**
 * Modified version of BaseWicketTester#getTagByWicketId(String) 
that returns all matching tags

 * instead of just the first.
 *
 * @see BaseWicketTester#getTagByWicketId(String)
 */
public static List getTagsByWicketId(WicketTester 
tester, String wicketId)

{
return 
TagTester.createTagsByAttribute(tester.getServletResponse().getDocument(),

"wicket:id", wicketId, false);
}

Hth
Mike

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



how to test what radio is checked in a radiogroup?

2011-08-19 Thread Mathilde Pellerin
Hi all,

I have a form with a Radiogroup :

In my form, I have a radiogroup like this :
RadioGroup genre = new
RadioGroup("genreDestinataire");
genre.setRequired(true);
genre.setLabel(new Model("Genre destinataire"));
genre.add(new Radio("femme", new Model("f")));
genre.add(new Radio("homme", new Model("h")));
genre.add(new Radio("mixte", new Model("b")));
form.add(genre);

This radiogroup match the genreDestinataire field in Questionnaire Entity
(with a CompoundPropertyModel).

In my unit test, I try to check what radio is selected, but I don't find
how...
I can get Model Object from radioGroup like this :
String genreObtenu =
((RadioGroup)form.get("genreDestinataire")).getDefaultModelObjectAsString();

but it works even if none of radio is checked. It happen when I fill the
form with existant Questionnaire : radiogroup model is ok, but none of radio
is checked.
Before correct this bug, I want to reproduce it in test, but I didn't find
how to see if a radio is checked or not : I didn't find any method like
"isChecked" or "isSelected" on Radio Component.

Is there any way to check that ?

Thanks.
M.

-- 
*Mathilde Pellerin*
Ingénieur en développement de logiciel

STATLIFE
tel : 01.42.11.64.88
mail : mathilde.pelle...@statlife.fr


Re: RadioGroup nulled out during form submit in IE

2011-06-19 Thread Sven Meier

Hi,

>Is this necessary or is this just working by coincidence?

no, adding the group to the request is not needed (normally).

>>In order to be supported by this behavior the group components must 
output

>>children with markup id in format of 'groupId-childId'
>
> Does this just mean this, or something more?

RadioGroup and Radio already do the heavy lifting for you. As long as 
you don't use custom markup ids, it should just work.

Note that the javadoc is talking about *markup ids*, not wicket ids.

Sven

On 06/19/2011 06:51 PM, Matt Schmidt wrote:

After further investigation, my problem is with the
AjaxFormChoiceComponentUpdatingBehavior. After adding the radio group to the
target in the behavior's onUpdate(), it works.

I have my radio's styled with some fancy jQuery button looks, so I was
unable to see that the actual radio remained unselected after clicking it
when using the Ajax behavior. But adding the group to the target fixes that.

myRadioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior()
{
@Override
protected void onUpdate(AjaxRequestTarget target)
{
target.addComponent(myRadioGroup);
 //whatever else
}
});

Is this necessary or is this just working by coincidence?

On a side note, the javadoc for AjaxFormChoiceComponentUpdatingBehavior
says: (wicket 1.4.16)


In order to be supported by this behavior the group components must output
children with markup id in format of 'groupId-childId'


Does this just mean this, or something more? It seems to work even if the
structure is not formatted this way







On Sun, Jun 19, 2011 at 7:17 AM, Sven Meier  wrote:


Hi Matt,

it could be a tag open/close issue which leads IE to put your radio tags
outside of the form.
I'd suggest to check your markup, i.e. look out for non-closed tags.

Hope this helps

Sven


On 06/18/2011 11:04 PM, Matt Schmidt wrote:


I have a form that is working correctly in FireFox but not IE. This
puzzled
is quite puzzling to me since it is server side functionality.

Here's a much simplified version of what I've got:













Radio 1

Radio 2

Radio 3


The RadioGroup's also have an AjaxFormChoiceComponentUpdatin**gBehavior
on it,
and the submit button is an IndicatingAjaxButton.

When I submit the form in FF, everything works fine. When I submit it in
IE,
my form's model object has null values for each of the
"myRadioGroupComponent" properties. I stepped through the code and found
that convertedInput is getting set to null during the form's validate(),
because the radio group's value is not in the request
(FormComponent.**getInputAsArray()). So it seems to me that IE is not
submitting the form correctly, or that I have invalid HTML that I cannot
identify.

I'm pretty stumped on this one. I can show some of my java if needed, but
the problem doesn't seem to be on that end to me. Any help is appreciated!

Thanks,
Matt



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





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



Re: RadioGroup nulled out during form submit in IE

2011-06-19 Thread Matt Schmidt
After further investigation, my problem is with the
AjaxFormChoiceComponentUpdatingBehavior. After adding the radio group to the
target in the behavior's onUpdate(), it works.

I have my radio's styled with some fancy jQuery button looks, so I was
unable to see that the actual radio remained unselected after clicking it
when using the Ajax behavior. But adding the group to the target fixes that.

myRadioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior()
{
@Override
protected void onUpdate(AjaxRequestTarget target)
{
target.addComponent(myRadioGroup);
//whatever else
}
});

Is this necessary or is this just working by coincidence?

On a side note, the javadoc for AjaxFormChoiceComponentUpdatingBehavior
says: (wicket 1.4.16)

> In order to be supported by this behavior the group components must output
> children with markup id in format of 'groupId-childId'


Does this just mean this, or something more? It seems to work even if the
structure is not formatted this way


   
   
   


On Sun, Jun 19, 2011 at 7:17 AM, Sven Meier  wrote:

> Hi Matt,
>
> it could be a tag open/close issue which leads IE to put your radio tags
> outside of the form.
> I'd suggest to check your markup, i.e. look out for non-closed tags.
>
> Hope this helps
>
> Sven
>
>
> On 06/18/2011 11:04 PM, Matt Schmidt wrote:
>
>> I have a form that is working correctly in FireFox but not IE. This
>> puzzled
>> is quite puzzling to me since it is server side functionality.
>>
>> Here's a much simplified version of what I've got:
>>
>> 
>> 
>>
>>
>>
>>
>>
>> 
>>
>> 
>> 
>>
>>Radio 1
>>
>>Radio 2
>>
>>Radio 3
>> 
>>
>> The RadioGroup's also have an AjaxFormChoiceComponentUpdatin**gBehavior
>> on it,
>> and the submit button is an IndicatingAjaxButton.
>>
>> When I submit the form in FF, everything works fine. When I submit it in
>> IE,
>> my form's model object has null values for each of the
>> "myRadioGroupComponent" properties. I stepped through the code and found
>> that convertedInput is getting set to null during the form's validate(),
>> because the radio group's value is not in the request
>> (FormComponent.**getInputAsArray()). So it seems to me that IE is not
>> submitting the form correctly, or that I have invalid HTML that I cannot
>> identify.
>>
>> I'm pretty stumped on this one. I can show some of my java if needed, but
>> the problem doesn't seem to be on that end to me. Any help is appreciated!
>>
>> Thanks,
>> Matt
>>
>>
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: RadioGroup nulled out during form submit in IE

2011-06-19 Thread Sven Meier

Hi Matt,

it could be a tag open/close issue which leads IE to put your radio tags 
outside of the form.

I'd suggest to check your markup, i.e. look out for non-closed tags.

Hope this helps

Sven

On 06/18/2011 11:04 PM, Matt Schmidt wrote:

I have a form that is working correctly in FireFox but not IE. This puzzled
is quite puzzling to me since it is server side functionality.

Here's a much simplified version of what I've got:













Radio 1

Radio 2

Radio 3


The RadioGroup's also have an AjaxFormChoiceComponentUpdatingBehavior on it,
and the submit button is an IndicatingAjaxButton.

When I submit the form in FF, everything works fine. When I submit it in IE,
my form's model object has null values for each of the
"myRadioGroupComponent" properties. I stepped through the code and found
that convertedInput is getting set to null during the form's validate(),
because the radio group's value is not in the request
(FormComponent.getInputAsArray()). So it seems to me that IE is not
submitting the form correctly, or that I have invalid HTML that I cannot
identify.

I'm pretty stumped on this one. I can show some of my java if needed, but
the problem doesn't seem to be on that end to me. Any help is appreciated!

Thanks,
Matt




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



RadioGroup nulled out during form submit in IE

2011-06-18 Thread Matt Schmidt
I have a form that is working correctly in FireFox but not IE. This puzzled
is quite puzzling to me since it is server side functionality.

Here's a much simplified version of what I've got:



   
   
   
   
   




   
   Radio 1
   
   Radio 2
   
   Radio 3


The RadioGroup's also have an AjaxFormChoiceComponentUpdatingBehavior on it,
and the submit button is an IndicatingAjaxButton.

When I submit the form in FF, everything works fine. When I submit it in IE,
my form's model object has null values for each of the
"myRadioGroupComponent" properties. I stepped through the code and found
that convertedInput is getting set to null during the form's validate(),
because the radio group's value is not in the request
(FormComponent.getInputAsArray()). So it seems to me that IE is not
submitting the form correctly, or that I have invalid HTML that I cannot
identify.

I'm pretty stumped on this one. I can show some of my java if needed, but
the problem doesn't seem to be on that end to me. Any help is appreciated!

Thanks,
Matt


Re: How to know what RadioGroup was selected?

2011-04-06 Thread James Carman
On Wed, Apr 6, 2011 at 10:28 PM, Paolo  wrote:
> Great!! You was very fast to reply! And I solved my problem with:
>
> System.out.println ("Tipo pagamento:"+bean.getMyInt());
>
> Thank you very much!!!
>

No problem.  That's what Wicket is all about, models.  Your RadioGroup
"edits" the model you give it, which in your case was a property model
pointing to the "myInt" property on your bean.  I would suggest you
check out the Wicket Wiki pages, especially:

https://cwiki.apache.org/WICKET/more-on-models.html

Enjoy and Happy Wicketeering!

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



Re: How to know what RadioGroup was selected?

2011-04-06 Thread Paolo
Alle giovedì 07 aprile 2011, James Carman ha scritto:
> What is the value of "myInt"?  That should tell you which one was selected.
> 
> On Wed, Apr 6, 2011 at 10:15 PM, Paolo  wrote:
> > I implemented this example in my application
> >
> > https://cwiki.apache.org/WICKET/using-radiogroups.html
> >
> > But, how I can know what radio button of radiogroup the user selected?
> >
Great!! You was very fast to reply! And I solved my problem with:

System.out.println ("Tipo pagamento:"+bean.getMyInt());

Thank you very much!!!

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



Re: How to know what RadioGroup was selected?

2011-04-06 Thread James Carman
What is the value of "myInt"?  That should tell you which one was selected.

On Wed, Apr 6, 2011 at 10:15 PM, Paolo  wrote:
> I implemented this example in my application
>
> https://cwiki.apache.org/WICKET/using-radiogroups.html
>
> But, how I can know what radio button of radiogroup the user selected?
>
> This is a part of the html code:
> 
>   
>    
>    
>    
>    
>  
>
> This is a part of the java code:
> ----
>
>    final Pagamento bean=new Pagamento();
>    RadioGroup myInt = new RadioGroup("group", new PropertyModel(bean, 
> "myInt"));
>    myInt.add(new Radio("1", new Model(1)));
>    myInt.add(new Radio("2", new Model(2)));
>    myInt.add(new Radio("3", new Model(3)));
>    myInt.add(new Radio("4", new Model(4)));
>    form.add(myInt);
>
> ...
>
>   form.add(new Button("order") {
>      @Override
>      public void onSubmit() {
>
>          final String pagamentoSTR = bean.toString();
>
>        System.out.println ("Tipo pagamento:"+pagamentoSTR);
> ...
>
> This is the java code for the class Pagamento:
> --
> package org.wicket.example;
>
> import java.io.Serializable;
>
> public class Pagamento implements Serializable {
>            private Integer myInt;
>            public void setMyInt(Integer myInt) {
>                this.myInt=myInt;
>            }
>            public Integer getMyInt() {
>                return myInt;
>            }
>
> }
>
> I have no errors, but in the console i got:
> Tipo pagamento:org.wicket.example.Pagamento@5bee9e20
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



How to know what RadioGroup was selected?

2011-04-06 Thread Paolo
I implemented this example in my application

https://cwiki.apache.org/WICKET/using-radiogroups.html

But, how I can know what radio button of radiogroup the user selected?

This is a part of the html code:

   




  

This is a part of the java code:


final Pagamento bean=new Pagamento();
RadioGroup myInt = new RadioGroup("group", new PropertyModel(bean, 
"myInt"));
myInt.add(new Radio("1", new Model(1)));
myInt.add(new Radio("2", new Model(2)));
myInt.add(new Radio("3", new Model(3)));
myInt.add(new Radio("4", new Model(4)));
form.add(myInt);

...

   form.add(new Button("order") {
  @Override
  public void onSubmit() {
  
  final String pagamentoSTR = bean.toString();

System.out.println ("Tipo pagamento:"+pagamentoSTR);
...

This is the java code for the class Pagamento:
--
package org.wicket.example;

import java.io.Serializable;

public class Pagamento implements Serializable {
private Integer myInt;
public void setMyInt(Integer myInt) {
this.myInt=myInt;
}
public Integer getMyInt() {
return myInt;
}
  
}

I have no errors, but in the console i got:
Tipo pagamento:org.wicket.example.Pagamento@5bee9e20

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



radioGroup in DataView

2011-03-10 Thread Jehan
Dear All

I am using radioGroup example found at URL:
https://cwiki.apache.org/WICKET/using-radiogroups.html
when I am clicking on submit button then old/Dafault selected values are
printing.

Using following code(saveRoleAssignments method) I want to print user
selected radio button values (e.g., true or false)

for printing I am using info method.

Thanks

public class rdoTest extends WebPage {
 public rdoTest()
 {
  ArrayList list = new ArrayList();
  list.add(new Person(1,"Xyz"));
  list.add(new Person(2,"abc"));
  list.add(new Person(3,"def"));
  list.add(new Person(1,"ghi"));
  list.add(new Person(1,"jkl"));



  ListDataProvider myIDataProvider= new ListDataProvider(list);

  final Form profileForm = new Form("profile-form");
  final DataView dataView = new DataView("profile-rows", myIDataProvider) {
   private static final long serialVersionUID = 1L;
   private static final int ROLE_SYS_ADMIN = 1;
   private static final int ROLE_DEPT_ADMIN = 2;
   private static final int ROLE_NO_ADMIN = 3;
   /**
   * {@inheritDoc}
   */
   @Override
   protected void populateItem(final Item item) {
Person person = (Person) item.getModelObject();
item.add(new Label("first-name", person.getName()));
   // item.add(new Label("last-name", person.getLastName()));
// add the radio group to select system or department (organizational)
administrators
final RadioGroup adminRadioGroup = new RadioGroup("radio-admin");
item.add(adminRadioGroup);


// create our three models with corresponding object values
(PersonRoleXrefId = persistent model that holds person/role id)
final Model sysAdminModel = new Model(new
PersonRoleXrefId(person.getId(), ROLE_SYS_ADMIN));
final Model deptAdminModel = new Model(new
PersonRoleXrefId(person.getId(), ROLE_DEPT_ADMIN));
final Model noAdminModel = new Model(new
PersonRoleXrefId(person.getId(), ROLE_NO_ADMIN ));
// add the models to the radios and the radios to the radio group
adminRadioGroup.add(new Radio("radio-sys-admin", sysAdminModel));
adminRadioGroup.add(new Radio("radio-dept-admin", deptAdminModel));
adminRadioGroup.add(new Radio("radio-non-admin", noAdminModel));
// set current default role selection based upon the currently iterated
item
// ( hasRole(...) is example method that determines if the person has
the specified role or not)
if (person.getId() == ROLE_SYS_ADMIN) {
 adminRadioGroup.setModel(sysAdminModel);
} else if (person.getId() == ROLE_DEPT_ADMIN) {
 adminRadioGroup.setModel(deptAdminModel);
} else {
 adminRadioGroup.setModel(noAdminModel);
}
   }
  };
  profileForm.add(dataView);
  Button okButton = new Button("button-save")
  {
   private static final long serialVersionUID = 1L;
   /**
   * {@inheritDoc}
   */
   @Override
   public final void onSubmit() {
info("\n------\n");
   // radioGroup.getInput(), radio1.getValue());
// see section for "Processing more than one RadioGroup simultaneously"
for explanation
saveRoleAssignments(dataView);
   }
  };
  profileForm.add(okButton);
  add(profileForm);

 }

 private final void saveRoleAssignments(final DataView dataView) {
  final ArrayList saveXrefs = new
ArrayList();
  for (final Iterator it = dataView.getItems(); it.hasNext();) {
   final Item item = (Item) it.next();
   final Person person = (Person) item.getModelObject();
   item.visitChildren(new Component.IVisitor() {
/**
* {@inheritDoc}
*/
//@Override
public final Object component(final Component component) {
 if (component instanceof RadioGroup) {


  final PersonRoleXrefId prId = (PersonRoleXrefId)
component.getDefaultModelObject();//getModelObject();
  // compare with existing person's assigned roles and only add changed
associations
  if (person.getId() == prId.getId()) {
   //saveXrefs.add(prId);
   //info(person.getName() + "" + prId.getId());
  }
  ///here I want to show new selected radio buttons [true or false]
  info("\n"+person.getName() + "" + prId.getId());
 }
 // continue visiting children to locate other RadioGroup components
 return CONTINUE_TRAVERSAL;
}
   });
  }
  if (!saveXrefs.isEmpty()) {
   // save person/role assignments using a IDataProvider assigned to the
DataView
   //((MyIDataProvider)
dataView.getDataProvider()).saveRoleAssignments(saveXrefs);
  }
 }

}


Re: AjaxFormChoiceComponentUpdatingBehavior on RadioGroup

2011-02-07 Thread ilde...@gmail.com
Did you succeed in making AjaxFormChoiceComponentUpdatingBehavior work
on a RadioGroup?
I can't make it work, wicket 1.4.14

I need to save the selected value to my model object when a Radio in
the RadioGroup is selected.
This becaus every time an option is selected in the form, the whole
form is reloaded to see if some new condition is met and something new
becomes visible/enabled.
So in reloading the model, if I did not persist the values via Ajax
before, I lost user selection.

I am succeding in doing this with
AjaxFormChoiceComponentUpdatingBehavior on a RadioChoice but can't
figure out how to get the ajax callback on a Radio selection in a
RadioGroup.

any hint?

2010/4/9 Robert Gründler :
> Hi all,
>
> i'm trying to use the AjaxFormChoiceComponentUpdatingBehavior on a RadioGroup 
> component,
> unfortunately, no ajax request is triggered when the RadioBoxes are clicked.
>
> Here's the code i'm using right now:
>
> Form form = new Form("addressform");
> String[] choices = new String[]{ "Wicket", "Spring", "DB4O" };
> group = new RadioGroup("group", new Model());
> ListView deliveryAddresses = new 
> ListView("deliveryaddresses", Arrays.asList(choices)) {
>        @Override
>        protected void populateItem(ListItem item) {
>                item.add(new Radio("group-choice", new 
> Model()));
>        }
> };
>
> group.setOutputMarkupId(true);
> group.add(new AjaxFormChoiceComponentUpdatingBehavior() {
>        @Override
>        protected void onUpdate(AjaxRequestTarget target) {
>                System.out.println("on change");
>        }
> });
> group.add(deliveryAddresses);
> form.add(group);
> add(form);
>
> /* markup */
>
> 
>        
>                
>                        
>                                
>                                         wicket:id="group-choice"/>
>                                
>                        
>                
>        
> 
>
>
> Has anyone an idea what i might be missing ?
>
>
> thanks!
>
> -robert
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Daniele Dellafiore
http://danieledellafiore.net

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



Re: RadioGroup bug?

2011-01-25 Thread Martin Grigorov
This is fixed in later Wicket 1.4.x and 1.5.x

On Tue, Jan 25, 2011 at 9:34 AM, Martin Makundi <
martin.maku...@koodaripalvelut.com> wrote:

> Hi!
>
> I suspect also bug with Page class. Sometimes our page stalls when
> user stays long time on page.
>
> /** Used to create page-unique numbers */
>private short autoIndex;
>
>
> **
> Martin
>
> 2010/11/15 Martin Makundi :
> > Hi!
> >
> > We have a suspect for the cause of this bug. The Radio is using a
> > SHORT counter which has maximum limit of approx 32000. Funny also it
> > checks if uuid is initialized, only from its sign. So when you have
> > enough radioactivity to reach much over 32000, you get negative values
> > and it stops working.
> >
> > So we propose fix:
> >
> > Radio:
> >  private Short uuid; // null = uninitialized
> >
> >  public String getValue()
> >  {
> >if (uuid == null)
> >{
> >  uuid = getPage().getAutoIndex();
> >}
> >return "radio" + uuid;
> >  }
> >
> >
> >
> > We will commit quickstart to reproduce bug and also patch to jira later
> today.
> >
> >
> > **
> > Martin
> >
> > 2010/11/2 Martin Makundi :
> >> Hi!
> >>
> >> Is there a resolution to this bug/issue listviews with
> >> setreuseitems=true but with radiochoice have some problems:
> >>
> >> * http://www.mail-archive.com/users@wicket.apache.org/msg06560.html
> >> *
> http://apache-wicket.1842946.n4.nabble.com/RadioGroup-test-fails-td1912239.html
> >> *
> http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
> >> * http://web.archiveorange.com/archive/v/yH01cVJ9vM4gdgpzRJVp
> >> * http://www.techienuggets.com/Comments?tx=122883
> >>
> >> For me it occurs in production:
> >> 1. First it works ok,
> >> 2. After a while user begins getting this error and has difficulty
> >> getting rid of it
> >>
> >> Could it have someting to do with session? Can it timeout before real
> session?
> >>
> >> I would be happy to reproduce this but it is very hard to reproduce. I
> >> see this on production logs and discussing with users they say that
> >> "it stops working suddenly" so they don't know what they are doing
> >> wrong.
> >>
> >> Really nasty.
> >>
> >> **
> >> Martin
> >>
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: RadioGroup bug?

2011-01-25 Thread Martin Makundi
Hi!

I suspect also bug with Page class. Sometimes our page stalls when
user stays long time on page.

/** Used to create page-unique numbers */
private short autoIndex;


**
Martin

2010/11/15 Martin Makundi :
> Hi!
>
> We have a suspect for the cause of this bug. The Radio is using a
> SHORT counter which has maximum limit of approx 32000. Funny also it
> checks if uuid is initialized, only from its sign. So when you have
> enough radioactivity to reach much over 32000, you get negative values
> and it stops working.
>
> So we propose fix:
>
> Radio:
>  private Short uuid; // null = uninitialized
>
>  public String getValue()
>  {
>    if (uuid == null)
>    {
>      uuid = getPage().getAutoIndex();
>    }
>    return "radio" + uuid;
>  }
>
>
>
> We will commit quickstart to reproduce bug and also patch to jira later today.
>
>
> **
> Martin
>
> 2010/11/2 Martin Makundi :
>> Hi!
>>
>> Is there a resolution to this bug/issue listviews with
>> setreuseitems=true but with radiochoice have some problems:
>>
>> * http://www.mail-archive.com/users@wicket.apache.org/msg06560.html
>> * 
>> http://apache-wicket.1842946.n4.nabble.com/RadioGroup-test-fails-td1912239.html
>> * 
>> http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
>> * http://web.archiveorange.com/archive/v/yH01cVJ9vM4gdgpzRJVp
>> * http://www.techienuggets.com/Comments?tx=122883
>>
>> For me it occurs in production:
>> 1. First it works ok,
>> 2. After a while user begins getting this error and has difficulty
>> getting rid of it
>>
>> Could it have someting to do with session? Can it timeout before real 
>> session?
>>
>> I would be happy to reproduce this but it is very hard to reproduce. I
>> see this on production logs and discussing with users they say that
>> "it stops working suddenly" so they don't know what they are doing
>> wrong.
>>
>> Really nasty.
>>
>> **
>> Martin
>>
>

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



Re: Problem with RadioGroup / Radio / TextField

2010-12-21 Thread Ioannis Canellos
Thanks

On Tue, Dec 21, 2010 at 9:59 AM, Jeremy Thomerson  wrote:

> On Tue, Dec 21, 2010 at 1:44 AM, Ioannis Canellos 
> wrote:
> > Sorry but I received delivery failure both times I sent the email.
>
> No worries.  It may have been a notification that your message needed
> to be moderated through.  When I moderated your message, I also made
> it so that all messages from your address are automatically allowed
> through now.
>
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> Need a CMS for Wicket?  Use Brix! http://brixcms.org
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
*Ioannis Canellos*
http://iocanel.blogspot.com

Integration Engineer @ Upstream S.A. 


Re: Problem with RadioGroup / Radio / TextField

2010-12-21 Thread Jeremy Thomerson
On Tue, Dec 21, 2010 at 1:44 AM, Ioannis Canellos  wrote:
> Sorry but I received delivery failure both times I sent the email.

No worries.  It may have been a notification that your message needed
to be moderated through.  When I moderated your message, I also made
it so that all messages from your address are automatically allowed
through now.


-- 
Jeremy Thomerson
http://wickettraining.com
Need a CMS for Wicket?  Use Brix! http://brixcms.org

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



Re: Problem with RadioGroup / Radio / TextField

2010-12-20 Thread Ioannis Canellos
Sorry but I received delivery failure both times I sent the email.

On Tuesday, December 21, 2010, Jeremy Thomerson
 wrote:
> On Mon, Dec 20, 2010 at 4:50 PM, Ioannis Canellos  wrote:
>> Hi,
>>
>> I have an issue with the RadioGroup component.
>> I want a RadioGroup that will have a couple of radio items, which will
>> contain text fields. I want the model of the radio group to contain the
>> value that is typed in the selected textfield.
>>
>> RadioGroup radioGroup = new RadioGroup("radioGroup",new
>> PropertyModel(this,"value");
>>
>> Radio radio1 = new Radio("radio1,
>> textfield1Model,radioGroup);
>> Radio radio2 = new Radio("radio2,
>> textfield2Model,radioGroup);
>>
>> TextField textField1 = new
>> TextField("textField1",textField1Model);
>> TextField textField2 = new
>> TextField("textField2",textField1Model);
>>
>> radioGroup.add(radio1);
>> radioGroup.add(radio2);
>> radio1.add(textField1)
>> radio2.add(textField2);
>>
>>
>> If the radio1 is select it works ok.
>> If the radio2 is selected it breaks.
>> --
>> *Ioannis Canellos*
>> http://iocanel.blogspot.com
>>
>> Integration Engineer @ Upstream S.A. <http://www.upstreamsystems.com>
>>
>
>
> Please don't double-post.  It won't help you get a quicker answer.  I
> haven't really looked at your issue, but it might be good to provide
> more example code.
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> Need a CMS for Wicket?  Use Brix! http://brixcms.org
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-- 
*Ioannis Canellos*
http://iocanel.blogspot.com

Integration Engineer @ Upstream S.A. <http://www.upstreamsystems.com>

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



Re: Problem with RadioGroup / Radio / TextField

2010-12-20 Thread Jeremy Thomerson
On Mon, Dec 20, 2010 at 4:50 PM, Ioannis Canellos  wrote:
> Hi,
>
> I have an issue with the RadioGroup component.
> I want a RadioGroup that will have a couple of radio items, which will
> contain text fields. I want the model of the radio group to contain the
> value that is typed in the selected textfield.
>
> RadioGroup radioGroup = new RadioGroup("radioGroup",new
> PropertyModel(this,"value");
>
> Radio radio1 = new Radio("radio1,
> textfield1Model,radioGroup);
> Radio radio2 = new Radio("radio2,
> textfield2Model,radioGroup);
>
> TextField textField1 = new
> TextField("textField1",textField1Model);
> TextField textField2 = new
> TextField("textField2",textField1Model);
>
> radioGroup.add(radio1);
> radioGroup.add(radio2);
> radio1.add(textField1)
> radio2.add(textField2);
>
>
> If the radio1 is select it works ok.
> If the radio2 is selected it breaks.
> --
> *Ioannis Canellos*
> http://iocanel.blogspot.com
>
> Integration Engineer @ Upstream S.A. <http://www.upstreamsystems.com>
>


Please don't double-post.  It won't help you get a quicker answer.  I
haven't really looked at your issue, but it might be good to provide
more example code.

-- 
Jeremy Thomerson
http://wickettraining.com
Need a CMS for Wicket?  Use Brix! http://brixcms.org

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



Problem with RadioGroup / Radio / TextField

2010-12-20 Thread Ioannis Canellos
Hi,

I have an issue with the RadioGroup component.
I want a RadioGroup that will have a couple of radio items, which will
contain text fields. I want the model of the radio group to contain the
value that is typed in the selected textfield.

RadioGroup radioGroup = new RadioGroup("radioGroup",new
PropertyModel(this,"value");

Radio radio1 = new Radio("radio1,
textfield1Model,radioGroup);
Radio radio2 = new Radio("radio2,
textfield2Model,radioGroup);

TextField textField1 = new
TextField("textField1",textField1Model);
TextField textField2 = new
TextField("textField2",textField1Model);

radioGroup.add(radio1);
radioGroup.add(radio2);
radio1.add(textField1)
radio2.add(textField2);


If the radio1 is select it works ok.
If the radio2 is selected it breaks.
-- 
*Ioannis Canellos*
http://iocanel.blogspot.com

Integration Engineer @ Upstream S.A. <http://www.upstreamsystems.com>


RadioGroup / Radio with text fields.

2010-12-20 Thread Ioannis Canellos
Hi,

I have an issue with the RadioGroup component.
I want a RadioGroup that will have a couple of radio items, which will
contain text fields. I want the model of the radio group to contain the
value that is typed in the selected textfield.

RadioGroup radioGroup = new RadioGroup("radioGroup",new
PropertyModel(this,"value");

Radio radio1 = new Radio("radio1,
textfield1Model,radioGroup);
Radio radio2 = new Radio("radio2,
textfield2Model,radioGroup);

TextField textField1 = new
TextField("textField1",textField1Model);
TextField textField2 = new
TextField("textField2",textField1Model);

radioGroup.add(radio1);
radioGroup.add(radio2);
radio1.add(textField1)
radio2.add(textField2);


If the radio1 is select it works ok.
If the radio2 is selected it breaks.

Any idea is more than welcome.

*Ioannis Canellos*
http://iocanel.blogspot.com
Integration Engineer @ Upstream S.A. <http://www.upstreamsystems.com>


Re: RadioGroup/Radio runtime exception

2010-12-15 Thread Grafas

Lucky me. I checked newest Wicket release (1.4.14) and saw bugfix about Radio
button.
https://issues.apache.org/jira/browse/WICKET-3175

My bug occurred because we use one page for everything. That solution worked
like a charm.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-Radio-runtime-exception-tp2331304p3089098.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: RadioGroup/Radio runtime exception

2010-12-15 Thread Grafas

I'm kinda still stuck with this problem. Any help would be appreciated.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-Radio-runtime-exception-tp2331304p3088874.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Radiogroup selection not kept after validation failure

2010-12-05 Thread James

That works! Thanks so much for your quick response, Martin!

James Zhang
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Radiogroup-selection-not-kept-after-validation-failure-tp3073296p3073315.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Radiogroup selection not kept after validation failure

2010-12-05 Thread Martin Makundi
use listview.setreuseitems(true);

2010/12/5 James Zhang :
> Hi,
>
> We are using Wicket in our project and here is one problem we found
> during the development: There is one page with many fields, including
> some text fields and some radio groups. Of course there are some
> validators added to some fields. During the form submission, if any
> validation fails, you will go back to the same page again. However,
> the selection you made on the radio group is blanked out! It doesn't
> happen to other fields but just radio group.
>
> In order to verify it, I made a simple wicket page to do the test.
> This is the Java file:
>
> public class Example extends WebPage {
>        private String value;
>        private String value2;
>        private String selected;
>
>        public Example() {
>                super();
>
>                FeedbackPanel fb = new FeedbackPanel("feedback") ;
>                fb.setOutputMarkupId(true);
>                add(fb);
>
>                Form form = new Form("form1") {
>                       �...@override
>                        public void onSubmit() {
>                                info("Text field:"+Example.this.value+" Radio
> selection:"+Example.this.selected);
>                        }
>                };
>                add(form);
>
>                TextField field = new TextField("txtfield", new 
> PropertyModel(this, "value"));
>                field.setRequired(true);
>                form.add(field);
>
>                form.add(new TextField("txtfield2", new PropertyModel(this, 
> "value2")));
>
>                RadioGroup group = new RadioGroup("roles", new 
> PropertyModel(this,
> "selected"));
>                form.add(group);
>
>                List roles = getRoles();
>
>                // add all roles
>                ListView rolesList = new ListView("radioList", 
> roles){
>                        protected void populateItem(ListItem item) {
>                                String bean = item.getModelObject();
>                                item.add(new Radio("radio", item.getModel()));
>                                item.add(new Label("name", bean));
>                        }
>
>                };
>
>                group.add(rolesList);
>
>                form.add(new Button("submitButton"));
>
>        }
>
>        public List getRoles() {
>                List list = new ArrayList();
>
>                list.add("CEO");
>                list.add("CFO");
>                list.add("Director");
>                list.add("Manager");
>                list.add("Associate");
>
>                return list;
>        }
>
> .. other getter/setter methods
>
> }
>
>
>
> The HTML file is as following:
>
>
> 
> Testing page
> 
> Simple Testing Page for Wicket
> 
> 
> 
> 
> 
> Enter a value:
> 
> 
> Second text field: />
> 
> 
> Groups:
> 
>  
>  
>    
>       value="AFMS - Security Administrator" id="umcrroles_0" />
>      Role name
>    
>  
>  
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> Run this page, leave the first field blank and put any value in the
> second field and choose a radio selection, submit the form, then you
> will see that the value entered for the second field is there, but the
> selection for the radio group is gone!
>
>
> Could someone please confirm if this is a problem for Wicket, or I did
> anything wrong here?
>
> Thanks so much for the help in advance!
>
>
> James Zhang
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Radiogroup selection not kept after validation failure

2010-12-05 Thread James Zhang
Hi,

We are using Wicket in our project and here is one problem we found
during the development: There is one page with many fields, including
some text fields and some radio groups. Of course there are some
validators added to some fields. During the form submission, if any
validation fails, you will go back to the same page again. However,
the selection you made on the radio group is blanked out! It doesn't
happen to other fields but just radio group.

In order to verify it, I made a simple wicket page to do the test.
This is the Java file:

public class Example extends WebPage {
private String value;
private String value2;
private String selected;

public Example() {
super();

FeedbackPanel fb = new FeedbackPanel("feedback") ;
fb.setOutputMarkupId(true);
add(fb);

Form form = new Form("form1") {
@Override
public void onSubmit() {
info("Text field:"+Example.this.value+" Radio
selection:"+Example.this.selected);
}
};
add(form);

TextField field = new TextField("txtfield", new 
PropertyModel(this, "value"));
field.setRequired(true);
form.add(field);

form.add(new TextField("txtfield2", new PropertyModel(this, 
"value2")));

RadioGroup group = new RadioGroup("roles", new 
PropertyModel(this,
"selected"));
form.add(group);

List roles = getRoles();

// add all roles
ListView rolesList = new ListView("radioList", 
roles){
protected void populateItem(ListItem item) {
String bean = item.getModelObject();
item.add(new Radio("radio", item.getModel()));
item.add(new Label("name", bean));  

}

};

group.add(rolesList);

form.add(new Button("submitButton"));

}

public List getRoles() {
List list = new ArrayList();

list.add("CEO");
list.add("CFO");
list.add("Director");
list.add("Manager");
list.add("Associate");

return list;
}

.. other getter/setter methods

}



The HTML file is as following:



Testing page

Simple Testing Page for Wicket





Enter a value:


Second text field:


Groups:

  
  

  
  Role name

  
  










Run this page, leave the first field blank and put any value in the
second field and choose a radio selection, submit the form, then you
will see that the value entered for the second field is there, but the
selection for the radio group is gone!


Could someone please confirm if this is a problem for Wicket, or I did
anything wrong here?

Thanks so much for the help in advance!


James Zhang

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



Re: RadioGroup bug?

2010-11-15 Thread Martin Makundi
Hi!

We have a suspect for the cause of this bug. The Radio is using a
SHORT counter which has maximum limit of approx 32000. Funny also it
checks if uuid is initialized, only from its sign. So when you have
enough radioactivity to reach much over 32000, you get negative values
and it stops working.

So we propose fix:

Radio:
  private Short uuid; // null = uninitialized

  public String getValue()
  {
if (uuid == null)
{
  uuid = getPage().getAutoIndex();
}
return "radio" + uuid;
  }



We will commit quickstart to reproduce bug and also patch to jira later today.


**
Martin

2010/11/2 Martin Makundi :
> Hi!
>
> Is there a resolution to this bug/issue listviews with
> setreuseitems=true but with radiochoice have some problems:
>
> * http://www.mail-archive.com/users@wicket.apache.org/msg06560.html
> * 
> http://apache-wicket.1842946.n4.nabble.com/RadioGroup-test-fails-td1912239.html
> * 
> http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
> * http://web.archiveorange.com/archive/v/yH01cVJ9vM4gdgpzRJVp
> * http://www.techienuggets.com/Comments?tx=122883
>
> For me it occurs in production:
> 1. First it works ok,
> 2. After a while user begins getting this error and has difficulty
> getting rid of it
>
> Could it have someting to do with session? Can it timeout before real session?
>
> I would be happy to reproduce this but it is very hard to reproduce. I
> see this on production logs and discussing with users they say that
> "it stops working suddenly" so they don't know what they are doing
> wrong.
>
> Really nasty.
>
> **
> Martin
>

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



RadioGroup bug?

2010-11-02 Thread Martin Makundi
Hi!

Is there a resolution to this bug/issue listviews with
setreuseitems=true but with radiochoice have some problems:

* http://www.mail-archive.com/users@wicket.apache.org/msg06560.html
* 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-test-fails-td1912239.html
* 
http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
* http://web.archiveorange.com/archive/v/yH01cVJ9vM4gdgpzRJVp
* http://www.techienuggets.com/Comments?tx=122883

For me it occurs in production:
1. First it works ok,
2. After a while user begins getting this error and has difficulty
getting rid of it

Could it have someting to do with session? Can it timeout before real session?

I would be happy to reproduce this but it is very hard to reproduce. I
see this on production logs and discussing with users they say that
"it stops working suddenly" so they don't know what they are doing
wrong.

Really nasty.

**
Martin

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



Re: RadioGroup/Radio runtime exception

2010-08-19 Thread Major Péter
Hi,

I'm also seeing time to time this exception with 1.4.8, the only
difference is, that I'm using the radiogroup within a wizard. (the
wizard buttons are Ajax buttons).

Any thoughts, how could this happen?

Thanks,
Peter

2010-08-19 16:40 keltezéssel, Grafas írta:
> 
> Hi all,
> we are using Wicket 1.3.5 and from time to time we keep getting
> WicketRuntimeException:
> submitted http post value [radio-31045] for RadioGroup component
> [31:contentcontainer:requestEditForm:currencySelectionPanel:currencySelectionForm:sellBuy]
> is illegal because it does not contain relative path to a Radio componnet.
> Due to this the RadioGroup component cannot resolve the selected Radio
> component pointed to by the illegal value. A possible reason is that
> componment hierarchy changed between rendering and form submission.
> at
> org.apache.wicket.markup.html.form.RadioGroup.convertValue(RadioGroup.java:117)
>   at
> org.apache.wicket.markup.html.form.FormComponent.convertInput(FormComponent.java:1189)
>   at
> org.apache.wicket.markup.html.form.FormComponent.validate(FormComponent.java:1093)
>   at
> org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior.respond(AjaxFormChoiceComponentUpdatingBehavior.java:164)
>   at
> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:297)
>   at
> org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:100)
>   at
> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
>   at
> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1175)
> 
> I can't get exactly why I'm getting it and I can't reproduce it. The panel
> is where these radio buttons are is updated by ajax quite a lot. In fact
> every second. Cant this be the problem?
> Here is part of code with radio buttons:
> 
> RadioGroup operation = new RadioGroup("sellBuy");
>   operation.setRequired(true);
>   currencyForm.add(operation);
> 
>   Radio buyActionRadio = new Radio("actionBUY", new 
> Model(Operation.BUY));
>   buyActionRadio.setMarkupId("actionBUY");
>   buyActionRadio.setOutputMarkupId(true);
>   operation.add(buyActionRadio);
>   operation.add(new Label("actionBUYLabel", new
> StringResourceModel("buyCurrency", null, "buyCurrency")));
> 
>   Radio sellActionRadio = new Radio("actionSELL", new
> Model(Operation.SELL));
>   sellActionRadio.setMarkupId("actionSELL");
>   sellActionRadio.setOutputMarkupId(true);
>   operation.add(sellActionRadio);
>   operation.add(new Label("actionSELLLabel", new
> StringResourceModel("sellCurrency", null, "sellCurrency")));
> 
>   WebMarkupContainer amountCurrencyCont = new
> WebMarkupContainer("amountCurrencyCont");
>   currencyForm.add(amountCurrencyCont);
> 
>   final Label shownActionLabel = new Label("shownActionLabel", new
> StringResourceModel("${sellBuy}", model, ""));
>   shownActionLabel.setOutputMarkupId(true);
>   amountCurrencyCont.add(shownActionLabel);
>   operation.add(new AjaxFormChoiceComponentUpdatingBehavior() {
>   protected void onUpdate(AjaxRequestTarget target) {
>   
> deal.setSellAmountFixed(!deal.isSellAmountFixed());
>   target.addComponent(shownActionLabel);
>   recalculateAmountAndProfit();
>   fireChange(target);
>   currencyForm.process();
>   }
>   });

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



Re: RadioGroup not selected on error

2010-08-17 Thread Bilgin Ibryam
The answer for my question was in the Radio class documentation:

 STATELESS NOTES: By default this component cannot be used inside a
stateless form. If it is desirable to use this inside a stateless form then
override #getValue() and return some stateless value to uniquely identify
this radio (eg relative component path from group to this radio)

On Tue, Aug 17, 2010 at 11:56 AM, Bilgin Ibryam  wrote:

> Hi,
>
> I have a form with few fields and a RadioGroup. The RadioGroup model is
> bound like this radioGroup.setModel(model.bind("searchType"));
> Initally the radio options are selected correctly depending on model
> values.
> The problem happens when I submit the form, and there are validation
> errors. Then the form is displayed again, but this time none of the options
> are selected (nor default values nor user selected).
> All the other fields keeps the values entered by the user (text fields,
> selects, date fields), but radio selections are lost.
>
> Any ideas what might be the problem?
>
> Bilgin
>
>


RadioGroup not selected on error

2010-08-17 Thread Bilgin Ibryam
Hi,

I have a form with few fields and a RadioGroup. The RadioGroup model is
bound like this radioGroup.setModel(model.bind("searchType"));
Initally the radio options are selected correctly depending on model values.
The problem happens when I submit the form, and there are validation errors.
Then the form is displayed again, but this time none of the options are
selected (nor default values nor user selected).
All the other fields keeps the values entered by the user (text fields,
selects, date fields), but radio selections are lost.

Any ideas what might be the problem?

Bilgin


Re: How to render Enum values as RadioGroup and set default value

2010-08-17 Thread datazuul


Sven Meier wrote:
> 
> 
> datazuul wrote:
>> 
>> But as I have to use different models for the group and the listview,
>> the default setting with "user.setGender" has no effect.
>> 
> 
> Sure, the group has a model pointing to the user's gender, the listview a
> model holding all available genders.
> 
As ListView wants a List in the constructor to iterate over, I unfortunately
had to extract the enum values, which breaks the binding...


Sven Meier wrote:
> 
> Your code looks fine to me, userModel.bind("gender") works for setter and
> getter.
> 
I am using userModel.bind("gender") for the RadioGroup to bind it to
user.set/getGender and tried to set the default value with
user.setGender(Gender.MALE);. I expected some RadioGroup-inside-mechanism
that activates the Radio-button that has this value. But this does not
happen...
Maybe I have to implement a comparison inside populateItem to set the
Radio-button to "activated" when it's value is equal to the userModel's
value? But how to activate a Radio-button (should I really set the
HTML-attribute "checked" in Java-Code)?

Finally I just want to iterate over all values of an Enum and represent them
as Radio Buttons in a RadioGroup, setting one as default.
Not so unusual, should be solved by someone else before...
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-render-Enum-values-as-RadioGroup-and-set-default-value-tp2327596p2328095.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: How to render Enum values as RadioGroup and set default value

2010-08-17 Thread Sven Meier


datazuul wrote:
> 
> But as I have to use different models for the group and the listview,
> the default setting with "user.setGender" has no effect.
> 

Sure, the group has a model pointing to the user's gender, the listview a
model holding all available genders.

Your code looks fine to me, userModel.bind("gender") works for setter and
getter.

Sven
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-render-Enum-values-as-RadioGroup-and-set-default-value-tp2327596p2327890.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



How to render Enum values as RadioGroup and set default value

2010-08-16 Thread Ralf Eichinger
I have an User class with a gender field using a Gender-Enum:

public class User implements DomainObject {
...
  private Gender gender;

I want to bind this gender field to a radiogroup (representing all enum
values) in a registration form.
This is what I did so far:


public enum Gender {
MALE, FEMALE
};

public class RegistrationEntryPanel extends Panel {
  private User user = new User();

  public RegistrationEntryPanel(String id) {
super(id);

// default value
user.setGender(Gender.MALE);

CompoundPropertyModel userModel = new CompoundPropertyModel(user);
final RadioGroup genderGroup = new RadioGroup(
  "genderGroup", userModel.bind("gender"));

Form form = new Form("form", userModel) {
  @Override
  protected void onSubmit() {
System.out.println("USER: " + user);
  }
};
add(form);
form.add(genderGroup);

// gender
Gender[] genderValues = Gender.values();
List genders = Arrays.asList(genderValues);

ListView genderList = new ListView("genderList",
  genders) {
  @Override
  protected void populateItem(ListItem item) {
item.add(new Radio("radio", item.getModel()));
item.add(new Label("label", getString(item.getModelObject()
  .toString(;
  }
};
genderGroup.add(genderList);

  }
}


This works so far: I can select a radio button and the value in the user
object is changed on submit.
But as I have to use different models for the group and the listview,
the default setting with "user.setGender" has no effect.

How can I preselect the first radio button of the listview or better the
dedicated MALE radio button?


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



Re: AjaxFormChoiceComponentUpdatingBehavior on RadioGroup

2010-04-09 Thread Per Newgro

Please check the markup. It's invalid and causes the problems.

Try this:










The span is not allowed there.

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



  1   2   3   >