You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Raghav@directi" <ra...@gmail.com> on 2009/02/16 12:06:57 UTC

Adding multiple ajax behavious on same event

I am using an AjaxLink which has a javascript for onclick event now i want to
add AjaxFormValidatingBehavior  to this link on the same event "onclick"
...i tried adding the same...but the link does not  work properly...i think
the actual javascript is replaced....can any one please help me how to do
this...

I had a look at IAjaxCallDecorator  also...... If i hv understood
IAjaxCallDecorator  correctly i can use it to append to the javascript....so
one way could be to have a look at the javascript generated by
AjaxFormValidatingBehavior   and append it to the javascript of
ajaxlink.....but is there a cleaner way to do this......
-- 
View this message in context: http://www.nabble.com/Adding-multiple-ajax-behavious-on-same-event-tp22035278p22035278.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: Adding multiple ajax behavious on same event

Posted by "Raghav@directi" <ra...@gmail.com>.
found something called CompositeBehavior in misc.....but it does not
seem to be working....may be i din get how to use it......

this is what i m trying to do


new AjaxFallbackLink("checkAvailablity") {

               {
                   final AjaxFormValidatingBehavior
ajaxFormValidatingBehavior = new AjaxFormValidatingBehavior(Form.this,
"onclick") {
                       @Override
                       protected void onError(AjaxRequestTarget target) {
                          // add components to target
                       }

                       @Override
                       protected void onSubmit(AjaxRequestTarget target) {
                        // add components to target
                       }
                   };
                   final CompositeBehavior behavior = new
CompositeBehavior(ajaxFormValidatingBehavior);
                   add(behavior);
               }

               @Override
               public void onClick(final AjaxRequestTarget target) {
                 // do smthing
               }
           }

But when i did this i got this exception trace...........

Behavior [RequestCycle@1feffac thread=btpool0-2] was not registered
with this component: [MarkupContainer [Component id =
checkAvailablity,......
    at org.apache.wicket.RequestCycle.urlFor(RequestCycle.java:789)
    at org.apache.wicket.Component.urlFor(Component.java:3124)
    at
org.apache.wicket.behavior.AbstractAjaxBehavior.getCallbackUrl(AbstractAjaxBehavior.java:123)
    at
org.apache.wicket.behavior.AbstractAjaxBehavior.getCallbackUrl(AbstractAjaxBehavior.java:92)
    at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.getEventHandler(AjaxFormSubmitBehavior.java:98)
    at
org.apache.wicket.ajax.AjaxEventBehavior.onComponentTag(AjaxEventBehavior.java:108)
    at
org.apache.wicket.behavior.AbstractAjaxBehavior.onComponentTag(AbstractAjaxBehavior.java:132)
    at
org.wicketstuff.misc.behaviors.CompositeBehavior.onComponentTag(CompositeBehavior.java:55)
    at org.apache.wicket.Component.renderComponentTag(Component.java:3815)
    at org.apache.wicket.Component.renderComponent(Component.java:2469)
    at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411)
    at org.apache.wicket.Component.render(Component.java:2315)
    at
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1297)
    at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1476)


Can anyone please help..... I need to get this working asap.....



Raghav@directi wrote:
> 
> I guess minis is part of wicketstuff-core....i did not find any
> CompoundBehavior in minis project. 
> 
> 
> martin-g wrote:
>> 
>> see CompoundBehavior in wicketstuff-minis
>> 
>> El lun, 16-02-2009 a las 03:06 -0800, Raghav@directi escribió:
>>> I am using an AjaxLink which has a javascript for onclick event now i
>>> want to
>>> add AjaxFormValidatingBehavior  to this link on the same event "onclick"
>>> ...i tried adding the same...but the link does not  work properly...i
>>> think
>>> the actual javascript is replaced....can any one please help me how to
>>> do
>>> this...
>>> 
>>> I had a look at IAjaxCallDecorator  also...... If i hv understood
>>> IAjaxCallDecorator  correctly i can use it to append to the
>>> javascript....so
>>> one way could be to have a look at the javascript generated by
>>> AjaxFormValidatingBehavior   and append it to the javascript of
>>> ajaxlink.....but is there a cleaner way to do this......
>> 
>> 
>> ---------------------------------------------------------------------
>> 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/Adding-multiple-ajax-behaviour-on-same-event-tp22035278p22133352.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: Adding multiple ajax behavious on same event

Posted by "Raghav@directi" <ra...@gmail.com>.
I guess minis is part of wicketstuff-core....i did not find any
CompoundBehavior in minis project. 


martin-g wrote:
> 
> see CompoundBehavior in wicketstuff-minis
> 
> El lun, 16-02-2009 a las 03:06 -0800, Raghav@directi escribió:
>> I am using an AjaxLink which has a javascript for onclick event now i
>> want to
>> add AjaxFormValidatingBehavior  to this link on the same event "onclick"
>> ...i tried adding the same...but the link does not  work properly...i
>> think
>> the actual javascript is replaced....can any one please help me how to do
>> this...
>> 
>> I had a look at IAjaxCallDecorator  also...... If i hv understood
>> IAjaxCallDecorator  correctly i can use it to append to the
>> javascript....so
>> one way could be to have a look at the javascript generated by
>> AjaxFormValidatingBehavior   and append it to the javascript of
>> ajaxlink.....but is there a cleaner way to do this......
> 
> 
> ---------------------------------------------------------------------
> 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/Adding-multiple-ajax-behaviour-on-same-event-tp22035278p22073547.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: Adding multiple ajax behavious on same event

Posted by Martin Grigorov <mc...@e-card.bg>.
see CompoundBehavior in wicketstuff-minis

El lun, 16-02-2009 a las 03:06 -0800, Raghav@directi escribió:
> I am using an AjaxLink which has a javascript for onclick event now i want to
> add AjaxFormValidatingBehavior  to this link on the same event "onclick"
> ...i tried adding the same...but the link does not  work properly...i think
> the actual javascript is replaced....can any one please help me how to do
> this...
> 
> I had a look at IAjaxCallDecorator  also...... If i hv understood
> IAjaxCallDecorator  correctly i can use it to append to the javascript....so
> one way could be to have a look at the javascript generated by
> AjaxFormValidatingBehavior   and append it to the javascript of
> ajaxlink.....but is there a cleaner way to do this......


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