Ah ok, thanks for the clarification. The parameters in 'getCallbackFunction()' 
would definitely be a cleaner approach.

Thanks,
-David Phillips - USAA

-----Original Message-----
From: Sebastien [mailto:seb...@gmail.com] 
Sent: Friday, October 26, 2012 4:50 PM
To: users@wicket.apache.org
Subject: Re: EXTERNAL: Migration of generateCallbackScript to Wicket 6

Ooooops, I wrote a mistake: #getCallbackParameters does not exists; it my own 
method!
However, the way to specify/handle callback parameters is still to provide an 
array of CallbackParameter (wicket-6.x, then) to
AbstractDefaultAjaxBehavior#getCallbackFunction()

You will find the static methods (context, explicit, resolved & context) and 
their corresponding javadoc in 
org.apache.wicket.ajax.attributes.CallbackParameter

Sorry for the confusion,
Sebastien.


On Fri, Oct 26, 2012 at 8:18 PM, Phillips, David <david.phill...@usaa.com>wrote:

> I don't see that API in AbstractAjaxBehavior or 
> AbstractDefaultAjaxBehavior (I'm looking at 6.2). Where is that available?
>
> Thanks,
> -David Phillips - USAA
>
> -----Original Message-----
> From: Sebastien [mailto:seb...@gmail.com]
> Sent: Friday, October 26, 2012 1:03 PM
> To: users@wicket.apache.org
> Subject: Re: EXTERNAL: Migration of generateCallbackScript to Wicket 6
>
> Hi,
>
> >If you want to add in additional parameters you can override
> 'getCallbackUrl()' and return your additional params.
> Although it's still valid in wicket 6, the best is now to override
> getCallbackParameters()
>
> protected CallbackParameter[] getCallbackParameters() { return new 
> CallbackParameter[] { CallbackParameter.converted(...), 
> CallbackParameter.explicit(...), CallbackParameter.context(...),
> CallbackParameter.resolved(...)
> };
> }
>
> See javadoc for difference between converted, explicit, etc
>
> Best regards,
> Sebastien
>
> On Fri, Oct 26, 2012 at 7:52 PM, Phillips, David 
> <david.phill...@usaa.com
> >wrote:
>
> > 'generateCallbackScript()' was removed, but 'getCallbackScript()'
> > still remains. You can call that to retrieve the necessary scripts, 
> > or 'getCallbackFunction()' if you want to generate a full function.
> >
> > If you want to add in additional parameters you can override 
> > 'getCallbackUrl()' and return your additional params.
> >
> > Thanks,
> > -David Phillips - USAA
> >
> > -----Original Message-----
> > From: Adriano dos Santos Fernandes [mailto:asfernan...@gmail.com] On 
> > Behalf Of Adriano dos Santos Fernandes
> > Sent: Friday, October 26, 2012 11:36 AM
> > To: wicket-users
> > Subject: EXTERNAL: Migration of generateCallbackScript to Wicket 6
> >
> > Hi!
> >
> > I'm migrating from Wicket 1.5 to 6, and I have a couple of 
> > generateCallbackScript usage that I have no idea what to do.
> >
> > An example:
> >
> >     class ToolbarBehaviour extends AbstractDefaultAjaxBehavior
> >     {
> >         private static final long serialVersionUID = 1L;
> >
> >         @Override
> >         protected void respond(AjaxRequestTarget target)
> >         {
> >             int itemNumber =
> > getRequest().getRequestParameters().getParameterValue("item").toInt();
> >             ToolItem item = Toolbar.this.registeredItems.get(itemNumber);
> >             item.onClick(target);
> >         }
> >
> >         public CharSequence getAjaxUrl(String params)
> >         {
> >             return generateCallbackScript("wicketAjaxGet('" +
> > getCallbackUrl() +
> >                 "&" + params + "'");
> >         }
> >     };
> >
> >
> > This is an integration with ExtJS toolbar, and getAjaxUrl() isused 
> > to build an ajax call in another place.
> >
> > I do also have similar JQueryBehavior's using generateCallbackScript 
> > and adding parameters to them.
> >
> > How to code this with Wicket 6?
> >
> >
> > Adriano
> >
> >
> > --------------------------------------------------------------------
> > - 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
> >
> >
>
> ---------------------------------------------------------------------
> 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

Reply via email to