You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by TonyVegas <an...@gmail.com> on 2008/03/26 15:24:28 UTC

Re: Ajax enabled radiogroup

In which version is this fix being applied?
We are running 1.3.2 and it seems not to be there.

-Tony



igor.vaynberg wrote:
> 
> thank you for testing
> 
> -igor
> 
> 
> On Jan 14, 2008 1:43 PM, Martijn Lindhout <ml...@jointeffort.nl>
> wrote:
>> ok, I did
>>
>> 1. a svn co http://svn.apache.org/repos/asf/wicket/trunk
>> 2. mvn install
>> 3. and build my project against wicket-1.0.3-SNAPSHOT
>>
>> the fix works.
>>
>> Thanx a lot Igor.
>>
>>
>> 2008/1/14, Igor Vaynberg <ig...@gmail.com>:
>> >
>> > ok, i applied the patch, let me know if the latest snapshot build
>> > works fine for you
>> >
>> > -igor
>> >
>> >
>> > On Jan 14, 2008 1:08 PM, Martijn Lindhout <ml...@jointeffort.nl>
>> > wrote:
>> > > It works! Thanx a lot!
>> > >
>> > >
>> > > 2008/1/14, Igor Vaynberg <ig...@gmail.com>:
>> > > >
>> > > > how about this...
>> > > >
>> > > > https://issues.apache.org/jira/browse/WICKET-1271
>> > > >
>> > > > -igor
>> > > >
>> > > >
>> > > > On Jan 14, 2008 12:46 PM, Martijn Lindhout
>> <ml...@jointeffort.nl>
>> > > > wrote:
>> > > > > Igor,
>> > > > >
>> > > > > I'm sorry, but could it be that the patch isn't visible to me? I
>> > just
>> > > > signed
>> > > > > up to ASF Jira to login, and I see no attachements at WICKET-1258
>> > :-(
>> > > > >
>> > > > > 2008/1/14, Igor Vaynberg <ig...@gmail.com>:
>> > > > > >
>> > > > >
>> > > > > > the patch is attached to the jira issue i mentioned
>> > > > > >
>> > > > > > -igor
>> > > > > >
>> > > > > >
>> > > > > > On Jan 14, 2008 12:20 PM, Martijn Lindhout <
>> > mlindhout@jointeffort.nl>
>> > > > > > wrote:
>> > > > > > > arg!!! You're right, 1.5 works.
>> > > > > > >
>> > > > > > > Ok Igor, do you have the change to commit or should I code it
>> > myself
>> > > > > > (would
>> > > > > > > take some more time, because I'm not an experienced
>> JavaScript
>> > > > > > developer).
>> > > > > > >
>> > > > > > > 2008/1/14, Martin Funk <fu...@arcor.de>:
>> > > > > > >
>> > > > > > > >
>> > > > > > > > what does
>> > > > > > > >
>> > > > > > > > java -version
>> > > > > > > >
>> > > > > > > > give you.
>> > > > > > > >
>> > > > > > > > I think on version 1.6 the tests still go boink like that.
>> > > > > > > > Your jdk needs to be 1.5.
>> > > > > > > >
>> > > > > > > > mf
>> > > > > > > >
>> > > > > > > > Martijn Lindhout schrieb:
>> > > > > > > > > unfortunately, I got Maven build errors doing just a mvn
>> > install
>> > > > > > from a
>> > > > > > > > > 'fresh' download. Any idea?
>> > > > > > > > >
>> > > > > > > > > [surefire] Running
>> org.apache.wicket.ajax.DomReadyOrderTest
>> > > > > > > > > 7c7
>> > > > > > > > > < </head>]]></header-contribution><component id="test1"
>> > > > ><![CDATA[  > > > > > > > >
>> href="?wicket:interface=:0:test::ILinkListener::"
>> > onclick="var
>> > > > > > > > >
>> > > > > > > >
>> > > > > >
>> > > >
>> >
>> wcall=wicketAjaxGet('?wicket:interface=:0:test::IBehaviorListener:0:-1',null,null,
>> > > > > > > > > function() {return Wicket.$('test1') !=
>> > > > null;}.bind(this));return
>> > > > > > > > !wcall;"
>> > > > > > > > >
>> > > > > > > >
>> > > > > >
>> > > >
>> > id="test1">Test
>> ]]></component><evaluate><![CDATA[test1();]]></evaluate><evaluate><![CDATA[test2();]]></evaluate></ajax-response>
>> > > > > > > > > ---
>> > > > > > > > >
>> > > > > > > > >> </head>]]></header-contribution><component id="test1"
>> > > > ><![CDATA[  > > > > > > > >>
>> > > > > > > > > id="test1" onclick="var
>> > > > > > > > >
>> > > > > > > >
>> > > > > >
>> > > >
>> >
>> wcall=wicketAjaxGet('?wicket:interface=:0:test::IBehaviorListener:0:-1',null,null,
>> > > > > > > > > function() {return Wicket.$('test1') !=
>> > > > null;}.bind(this));return
>> > > > > > > > !wcall;"
>> > > > > > > > >
>> > > > > > > >
>> > > > > >
>> > > >
>> > href="?wicket:interface=:0:test::ILinkListener::">Test
>> ]]></component><evaluate><![CDATA[test1();]]></evaluate><evaluate><![CDATA[test2();]]></evaluate></ajax-response>
>> > > > > > > > >
>> > > > > > > > > [surefire] Tests run: 1, Failures: 1, Errors: 0, Time
>> > elapsed:
>> > > > 0.017sec
>> > > > > > > > > <<<<<<<< FAILURE !!
>> > > > > > > > > [surefire] Running
>> > > > > > org.apache.wicket.ajax.AjaxBehaviorAndMetaDataTest
>> > > > > > > > > [surefire] Tests run: 1, Failures: 0, Errors: 0, Time
>> > elapsed:
>> > > > 0.006sec
>> > > > > > > > > [surefire] Running
>> > org.apache.wicket.ajax.AjaxRequestTargetTest
>> > > > > > > > > 2c2
>> > > > > > > > > < <style type="text/css"
>> > > > > > id="org-apache-wicket-ajax-MockComponent1-0">
>> > > > > > > > > ---
>> > > > > > > > >
>> > > > > > > > >> <style id="org-apache-wicket-ajax-MockComponent1-0"
>> > > > > > type="text/css">
>> > > > > > > > >>
>> > > > > > > > >
>> > > > > > > > > 2c2
>> > > > > > > > > < <link
>> > > > > > > > >
>> > > > > > > >
>> > > > > >
>> > > >
>> >
>> href="resources/org.apache.wicket.ajax.MockComponent3/mockStyleSheet3.css"
>> > > > > > > > > rel="stylesheet" type="text/css"/>
>> > > > > > > > > ---
>> > > > > > > > >
>> > > > > > > > >> <link rel="stylesheet" type="text/css"
>> > > > > > > > >>
>> > > > > > > > >
>> > > > > > > >
>> > > > > >
>> > > >
>> >
>> href="resources/org.apache.wicket.ajax.MockComponent3/mockStyleSheet3.css"/>
>> > > > > > > > >
>> > > > > > > > > [surefire] Tests run: 3, Failures: 2, Errors: 0, Time
>> > elapsed:
>> > > > 0.106sec
>> > > > > > > > > <<<<<<<< FAILURE !!
>> > > > > > > > > [INFO]
>> > > > > > > > >
>> > > > > >
>> > > >
>> >
>> ------------------------------------------------------------------------
>> > > > > > > > > [ERROR] BUILD ERROR
>> > > > > > > > > [INFO]
>> > > > > > > > >
>> > > > > >
>> > > >
>> >
>> ------------------------------------------------------------------------
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > > 2008/1/14, Igor Vaynberg <ig...@gmail.com>:
>> > > > > > > > >
>> > > > > > > > >> if you dont mind testing the patch that would be
>> great...
>> > > > > > > > >>
>> > > > > > > > >> -igor
>> > > > > > > > >>
>> > > > > > > > >>
>> > > > > > > > >> On Jan 14, 2008 11:18 AM, Martijn Lindhout <
>> > > > > > mlindhout@jointeffort.nl>
>> > > > > > > > >> wrote:
>> > > > > > > > >>
>> > > > > > > > >>> Uh.. oh, I'm sorry. Do you mean if I changed the source
>> > > > according
>> > > > > > to
>> > > > > > > > >>>
>> > > > > > > > >> Matt
>> > > > > > > > >>
>> > > > > > > > >>> Clark's comments? No.
>> > > > > > > > >>> I deduced from the discussion that that would be the
>> > problem.
>> > > > > > > > >>>
>> > > > > > > > >>> Of course I can download the source to apply the
>> patch...
>> > > > > > > > >>>
>> > > > > > > > >>>
>> > > > > > > > >>> 2008/1/14, Igor Vaynberg <ig...@gmail.com>:
>> > > > > > > > >>>
>> > > > > > > > >>>> so you applied the patch and it worked? if so i can
>> > commit it
>> > > > now
>> > > > > > and
>> > > > > > > > >>>> you can use the snapshot build
>> > > > > > > > >>>>
>> > > > > > > > >>>> -igor
>> > > > > > > > >>>>
>> > > > > > > > >>>>
>> > > > > > > > >>>> On Jan 14, 2008 10:19 AM, Martijn Lindhout <
>> > > > > > mlindhout@jointeffort.nl>
>> > > > > > > > >>>> wrote:
>> > > > > > > > >>>>
>> > > > > > > > >>>>> yep, you're right. Guess I'll have to wait till
>> 1.3.1?
>> > ;-)
>> > > > > > > > >>>>>
>> > > > > > > > >>>>> 2008/1/14, Igor Vaynberg <ig...@gmail.com>:
>> > > > > > > > >>>>>
>> > > > > > > > >>>>>
>> > > > > > > > >>>>>> could this be it?
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>> https://issues.apache.org/jira/browse/WICKET-1258
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>> also, the form should not be submitted, only the
>> value
>> > for
>> > > > that
>> > > > > > > > >>>>>>
>> > > > > > > > >> one
>> > > > > > > > >>
>> > > > > > > > >>>>>> radio component.
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>> -igor
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>> On Jan 14, 2008 5:51 AM, Martijn Lindhout <
>> > > > > > > > >>>>>>
>> > > > > > > > >> mlindhout@jointeffort.nl>
>> > > > > > > > >>
>> > > > > > > > >>>>>> wrote:
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>> When I do this, the underlying model object isn't
>> > updated.
>> > > > I
>> > > > > > > > >>>>>>>
>> > > > > > > > >> used
>> > > > > > > > >>
>> > > > > > > > >>>> the
>> > > > > > > > >>>>
>> > > > > > > > >>>>>> Wicket
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>> Ajax Debug and see that the form isn't posted, so
>> the
>> > > > > > > > >>>>>>>
>> > > > > > > > >> modelobject
>> > > > > > > > >>
>> > > > > > > > >>>>>> doesn't
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>> change.
>> > > > > > > > >>>>>>>
>> > > > > > > > >>>>>>> 2008/1/14, SantiagoA <s....@gmx.de>:
>> > > > > > > > >>>>>>>
>> > > > > > > > >>>>>>>
>> > > > > > > > >>>>>>>> Hi,
>> > > > > > > > >>>>>>>> what javascript method do you use?  onclick,
>> > onMouseDown,
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>> onMouseUp?
>> > > > > > > > >>>>
>> > > > > > > > >>>>>>>> I add
>> AjaxFormComponentUpdatingBehaviour("onchange")
>> > to
>> > > > > > > > >>>>>>>>
>> > > > > > > > >> Textfields
>> > > > > > > > >>
>> > > > > > > > >>>> and
>> > > > > > > > >>>>
>> > > > > > > > >>>>>> it
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>>> works fine.
>> > > > > > > > >>>>>>>> Using Radios in radioGroup i had to use
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>>>>>         radio.add(new
>> AjaxEventBehavior("onchange"){
>> > > > > > > > >>>>>>>>         private static final long serialVersionUID
>> =
>> > > > > > > > >>>>>>>> -5356375735369681460L;
>> > > > > > > > >>>>>>>>         @Override
>> > > > > > > > >>>>>>>>         protected void onEvent(AjaxRequestTarget
>> > target)
>> > > > {
>> > > > > > > > >>>>>>>>          do something;
>> > > > > > > > >>>>>>>>          target.addComponent(panelA);
>> > > > > > > > >>>>>>>>             target.addComponent(panelB);
>> > > > > > > > >>>>>>>>            }
>> > > > > > > > >>>>>>>> works fine for me.
>> > > > > > > > >>>>>>>> cheers,
>> > > > > > > > >>>>>>>> santiago
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>>>>> Martijn Lindhout wrote:
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>>>>>> Hi all
>> > > > > > > > >>>>>>>>> I'm lost. I've tried all kinds of combinations to
>> > get
>> > > > the
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >>>> following
>> > > > > > > > >>>>
>> > > > > > > > >>>>>>>>> working,
>> > > > > > > > >>>>>>>>> but I either received exceptions or nothing
>> > happened. So
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >> back to
>> > > > > > > > >>
>> > > > > > > > >>>>>> what I
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>>>> want:
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >>>>>>>>> I have a form with a question, which possible
>> > answers
>> > > > are
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >> 'yes'
>> > > > > > > > >>
>> > > > > > > > >>>> or
>> > > > > > > > >>>>
>> > > > > > > > >>>>>> 'no'.
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>>> I
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>>>>>> want to use a radio choice for it. Depending on
>> what
>> > the
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >> user
>> > > > > > > > >>
>> > > > > > > > >>>>>> chooses, I
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>>>> want to show a panel A or B using Ajax. I started
>> > with
>> > > > the
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >>>>>> RadioChoice
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>>>> component, but that way I have not enough control
>> > over
>> > > > the
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >>>> rendering
>> > > > > > > > >>>>
>> > > > > > > > >>>>>> of
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>>>> the
>> > > > > > > > >>>>>>>>> choices (CSS stuff etc), so I now have a
>> radiogroup
>> > and
>> > > > two
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >>>> radio's.
>> > > > > > > > >>>>
>> > > > > > > > >>>>>> I
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>>>> added
>> > > > > > > > >>>>>>>>> a AjaxFormChoiceComponentUpdatingBehavior to the
>> > > > RadioGroup.
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >> In
>> > > > > > > > >>
>> > > > > > > > >>>> the
>> > > > > > > > >>>>
>> > > > > > > > >>>>>>>>> onUpdate, I check the model value. Depending on
>> that
>> > > > value I
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >>>> modifiy
>> > > > > > > > >>>>
>> > > > > > > > >>>>>> the
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>>>> visibility of the panels A and B and add both of
>> > them to
>> > > > the
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >>>> target.
>> > > > > > > > >>>>
>> > > > > > > > >>>>>>>> Point
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>>>>>> is: the onUpdate isn't called.
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >>>>>>>>> What is the right way to do this?
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >>>>>>>>> --
>> > > > > > > > >>>>>>>>> Martijn Lindhout
>> > > > > > > > >>>>>>>>> JointEffort IT Services
>> > > > > > > > >>>>>>>>> http://www.jointeffort.nl
>> > > > > > > > >>>>>>>>> mlindhout@jointeffort.nl
>> > > > > > > > >>>>>>>>> +31 (0)6 18 47 25 29
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >>>>>>>>>
>> > > > > > > > >>>>>>>> --
>> > > > > > > > >>>>>>>> View this message in context:
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>
>> > > > > > > >
>> > > >
>> http://www.nabble.com/Ajax-enabled-radiogroup-tp14797035p14801893.html
>> > > > > > > > >>>>
>> > > > > > > > >>>>>>>> Sent from the Wicket - User mailing list archive
>> at
>> > > > > > Nabble.com
>> > > > > > > > >>>>>>>>
>> > > > > > > > >> .
>> > > > > > > > >>
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>
>> > > > > >
>> > ---------------------------------------------------------------------
>> > > > > > > > >>>>
>> > > > > > > > >>>>>>>> To unsubscribe, e-mail:
>> > > > users-unsubscribe@wicket.apache.org
>> > > > > > > > >>>>>>>> For additional commands, e-mail:
>> > > > users-help@wicket.apache.org
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>>>>>
>> > > > > > > > >>>>>>> --
>> > > > > > > > >>>>>>> Martijn Lindhout
>> > > > > > > > >>>>>>> JointEffort IT Services
>> > > > > > > > >>>>>>> http://www.jointeffort.nl
>> > > > > > > > >>>>>>> mlindhout@jointeffort.nl
>> > > > > > > > >>>>>>> +31 (0)6 18 47 25 29
>> > > > > > > > >>>>>>>
>> > > > > > > > >>>>>>>
>> > > > > > > > >>>>>>
>> > > > > > > > >>
>> > > > > >
>> > ---------------------------------------------------------------------
>> > > > > > > > >>
>> > > > > > > > >>>>>> To unsubscribe, e-mail:
>> > users-unsubscribe@wicket.apache.org
>> > > > > > > > >>>>>> For additional commands, e-mail:
>> > > > users-help@wicket.apache.org
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>>>
>> > > > > > > > >>>>> --
>> > > > > > > > >>>>> Martijn Lindhout
>> > > > > > > > >>>>> JointEffort IT Services
>> > > > > > > > >>>>> http://www.jointeffort.nl
>> > > > > > > > >>>>> mlindhout@jointeffort.nl
>> > > > > > > > >>>>> +31 (0)6 18 47 25 29
>> > > > > > > > >>>>>
>> > > > > > > > >>>>>
>> > > > > > > > >>>>
>> > > > > >
>> > ---------------------------------------------------------------------
>> > > > > > > > >>>> To unsubscribe, e-mail:
>> > users-unsubscribe@wicket.apache.org
>> > > > > > > > >>>> For additional commands, e-mail:
>> > users-help@wicket.apache.org
>> > > > > > > > >>>>
>> > > > > > > > >>>>
>> > > > > > > > >>>>
>> > > > > > > > >>> --
>> > > > > > > > >>> Martijn Lindhout
>> > > > > > > > >>> JointEffort IT Services
>> > > > > > > > >>> http://www.jointeffort.nl
>> > > > > > > > >>> mlindhout@jointeffort.nl
>> > > > > > > > >>> +31 (0)6 18 47 25 29
>> > > > > > > > >>>
>> > > > > > > > >>>
>> > > > > > > > >>
>> > > > > >
>> > ---------------------------------------------------------------------
>> > > > > > > > >> To unsubscribe, e-mail:
>> users-unsubscribe@wicket.apache.org
>> > > > > > > > >> For additional commands, e-mail:
>> > users-help@wicket.apache.org
>> > > > > > > > >>
>> > > > > > > > >>
>> > > > > > > > >>
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > > >
>> > > > > > > >
>> > > >
>> ---------------------------------------------------------------------
>> > > > > > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > > > > > > > For additional commands, e-mail:
>> users-help@wicket.apache.org
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > > --
>> > > > > > >
>> > > > > > > Martijn Lindhout
>> > > > > > > JointEffort IT Services
>> > > > > > > http://www.jointeffort.nl
>> > > > > > > mlindhout@jointeffort.nl
>> > > > > > > +31 (0)6 18 47 25 29
>> > > > > > >
>> > > > > >
>> > > > > >
>> > ---------------------------------------------------------------------
>> > > > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > > > > > For additional commands, e-mail: users-help@wicket.apache.org
>> > > > > >
>> > > > > >
>> > > > >
>> > > > >
>> > > > > --
>> > > > > Martijn Lindhout
>> > > > > JointEffort IT Services
>> > > > > http://www.jointeffort.nl
>> > > > > mlindhout@jointeffort.nl
>> > > > > +31 (0)6 18 47 25 29
>> > > > >
>> > > >
>> > > >
>> ---------------------------------------------------------------------
>> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > > > For additional commands, e-mail: users-help@wicket.apache.org
>> > > >
>> > > >
>> > >
>> > >
>> > > --
>> > > Martijn Lindhout
>> > > JointEffort IT Services
>> > > http://www.jointeffort.nl
>> > > mlindhout@jointeffort.nl
>> > > +31 (0)6 18 47 25 29
>> > >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
>>
>> --
>> Martijn Lindhout
>> JointEffort IT Services
>> http://www.jointeffort.nl
>> mlindhout@jointeffort.nl
>> +31 (0)6 18 47 25 29
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Ajax-enabled-radiogroup-tp14797035p16301529.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Ajax enabled radiogroup

Posted by Johan Compagner <jc...@gmail.com>.
Which new fix are you talking about?
What is currently in svn/snapshot doest traverse anymore
It let the document handle that for use by calling:
wicketGet(markupId).getElementsByTagName('input')

and markupId is the Choice itself.

So it should get all the inputs that are below that parent

johan


On Wed, Mar 26, 2008 at 5:38 PM, TonyVegas <an...@gmail.com> wrote:

>
> We encountered problems with the new fix because it traverses 2 levels
> deep
> instead of 1.
> The effect was that in our project, the Radios didn't work either.
>
> So we did the traversal in the Java code:
>
> public abstract class CustomAjaxFormChoiceComponentUpdatingBehaviour
> extends
> AjaxFormChoiceComponentUpdatingBehavior
> {
>
>        /* (non-Javadoc)
>         * @see
>
> org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior#onUpdate
> (org.apache.wicket.ajax.AjaxRequestTarget)
>         */
>        @Override
>        protected abstract void onUpdate(AjaxRequestTarget target);
>
>        @Override
>        public void renderHead(IHeaderResponse response)
>        {
>
>                //
>                // step through all children of this e.g. RadioGroup and
>                // attach an 'onclick' handler to all children which are of
> type Radio
>                final StringBuilder a=new StringBuilder(400);
>
>                ((MarkupContainer)getComponent()).visitChildren(new
> org.apache.wicket.Component.IVisitor()
>                {
>                        public Object component(org.apache.wicket.Componentcomponent)
>                        {
>                                if(component instanceof RadioGroup
>                                                || component instanceof
> RadioChoice)
>                                        return
> CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER;
>
>                                if(component instanceof Radio)
>                                {
>                                        // muss hier passieren, im onbind
> hat er noch keine kinder:
>                                        component.setOutputMarkupId(true);
>
>                                        // eventhandler:
>                                        a.append("Wicket.Event.add
> (wicketGet('")
>                                        .append(component.getMarkupId())
>                                        .append("'),'click', function() {")
>                                        .append(getEventHandler())
>                                        .append("});\n");
>                                }
>
>                                return CONTINUE_TRAVERSAL;
>                        }
>                });
>
>                response.renderOnLoadJavascript(a.toString());
>        }
>
> }
>
>
> Greetings, Tony
>
> --
> View this message in context:
> http://www.nabble.com/Ajax-enabled-radiogroup-tp14797035p16305395.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Ajax enabled radiogroup

Posted by TonyVegas <an...@gmail.com>.
We encountered problems with the new fix because it traverses 2 levels deep
instead of 1.
The effect was that in our project, the Radios didn't work either.

So we did the traversal in the Java code:

public abstract class CustomAjaxFormChoiceComponentUpdatingBehaviour extends
AjaxFormChoiceComponentUpdatingBehavior
{

	/* (non-Javadoc)
	 * @see
org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior#onUpdate(org.apache.wicket.ajax.AjaxRequestTarget)
	 */
	@Override
	protected abstract void onUpdate(AjaxRequestTarget target);
	
	@Override
	public void renderHead(IHeaderResponse response)
	{
		
		//
		// step through all children of this e.g. RadioGroup and
		// attach an 'onclick' handler to all children which are of type Radio
		final StringBuilder a=new StringBuilder(400);
		
		((MarkupContainer)getComponent()).visitChildren(new
org.apache.wicket.Component.IVisitor()
		{
			public Object component(org.apache.wicket.Component component)
			{
				if(component instanceof RadioGroup
						|| component instanceof RadioChoice)
					return CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER;
				
				if(component instanceof Radio)
				{
					// muss hier passieren, im onbind hat er noch keine kinder:
					component.setOutputMarkupId(true);	
					
					// eventhandler:
					a.append("Wicket.Event.add(wicketGet('")
					.append(component.getMarkupId())
					.append("'),'click', function() {")
					.append(getEventHandler())
					.append("});\n");									
				}
				
				return CONTINUE_TRAVERSAL;
			}
		});
		
		response.renderOnLoadJavascript(a.toString());
	}

}


Greetings, Tony

-- 
View this message in context: http://www.nabble.com/Ajax-enabled-radiogroup-tp14797035p16305395.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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