my case is:
there is a javascript variable (let say "var STATE;") that will be updated
througout the client side javascript event
there is a link (for example) that I want to use to pass the "STATE" through
ajax to server.
in your codes, does client side javascript method
"DnDSortableBehavior.asQueryString()" generate the query string and append
to the wicketAjaxGet? and you parse the parameters in the server side?
I think you have already given me good hints and I will continue work on
that, thanks very much
David Bernard-2 wrote:
>
> Currently I have no simple example :-(
> In my case (wicketstuff-jquery), I've got a link that call a javascript
> function generated (with a template on server side).
> In this function :
> var wcall = wicketAjaxGet('${callbackUrl}&' +
> DnDSortableBehavior.asQueryString(), function(){}, function(){});
>
> And the method DnDSortableBehavior.asQueryString() is in charge of
> formated collected state, params,...
> var DnDSortableBehavior = {
> ...
> asQueryString : function() {
> return 'itemId=' + this.itemId + '&srcContainerId=' +
> this.srcContainerId + '&srcPosition=' + this.srcPosition +
> '&destContainerId='+ this.destContainerId + '&destPosition=' +
> this.destPosition;
> }
> };
>
> In my case I use jquery to retrieve states, values.
>
> If I've got time this evening, I'll try to create a sample.
> Which type of information do you want to send back to server ?
>
> ywtsang wrote:
>> i have traced the wicket source codes at the place that how it generates
>> the
>> ajax js like
>> wcall=wicketAjaxGet('xxx')
>> but i don't know exactly what this does, so how to "add parameter" to the
>> wicket ajax request?
>>
>> i can add custom js to the wicket ajax javascript, but how can I pass the
>> some dynamic js state into that ajax request, e.g. i trigger the ajax
>> request by a link with AjaxEventBehavior on onclick event.
>>
>> would you mind show me a simple example?
>>
>>
>>
>>
>> David Bernard-2 wrote:
>>> For a similar case, I override (in MyBehavior)
>>> @Override
>>> public final void respond(AjaxRequestTarget target) {
>>> try {
>>> Request req = RequestCycle.get().getRequest();
>>> String param1 = req.getParameter("param1");
>>> // to stuff
>>> super.respond(target); //??
>>> } catch (RuntimeException exc) {
>>> throw exc;
>>> } catch (Exception exc) {
>>> throw new RuntimeException("wrap: " + exc.getMessage(),
>>> exc);
>>> }
>>> }
>>>
>>> And you need to override (server or client side) the callbackUrl to add
>>> parameter.
>>>
>>>
>>>
>>> ywtsang wrote:
>>>> How to pass information (stored in an attribute of a html tag, or
>>>> javascript
>>>> variable) through ajax without involving form?
>>>>
>>>> e.g. there is an ajax link and after I click this ajax link, an ajax
>>>> event
>>>> is triggered and I want to get the states of other html
>>>> elements/javascript
>>>> states in this ajax event
>>>>
>>>> it is no problem to use form, but we have a restriction that no form is
>>>> used
>>>> (may look weird to all here), so I would like to see if there is
>>>> workaround
>>>> in wicket.
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/pass-information-through-ajax-without-form-tf4560660.html#a13017389
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]