Hi Jeffery,

I would be interested to know what put you off about wiquery, any feedback
is always welcome.

Anyway, for ajax communication, add an AbstractAajxBehaviour to your page /
component, and use the url this generates to pass to your jquery ajax
something like this:

String callbackurl  = ajaxBehaviour.getCallbackUrl(true).toString().

String ajaxJs = "$.get('" + callbackurl +"', function(data){alert('Data
Loaded: ' + data);});"

When you make an ajax request to this url the onRequest method is called,
mine typically look like this:

public void onRequest() {
    final RequestCycle requestCycle = RequestCycle.get();

    final PageParameters pageParameters = new
PageParameters(requestCycle.getRequest().getParameterMap());
                
}

Using the page parameters object lets you get access to the request
parameters easily.  If you do not intend to return a result then you should
add this line in:

RequestCycle.get().setRequestTarget(EmptyRequestTarget.getInstance());

to stop a response being sent.

As for ajax replacing of ui components, I usually find that re-running the
javascript code to create the ui component works fine.  Or another way to
get round the problem is to have a element inside the main javascript ui
container, and only replace that.

Hope this helps

Regards - Richard Wilkinson
Developer,
jWeekend: OO & Java Technologies - Development and Training
http://jWeekend.com



Jeffrey Schneller wrote:
> 
> I am trying to determine how to use Wicket and JQuery.  I would prefer
> not using wiQuery or similar.  I would like to just include the jQuery
> libraries in my html and then use jQuery as javascript and not wrap
> everything in java on the server side to generate the client code.
> 
>  
> 
> How would one go about doing this?  I assume the basic jQuery
> functionality is straight forward.  However how would you implement
> jQuery code that uses Ajax to communicate back to the server using
> Wicket on the server?  Or would the recommendation be to let Wicket
> handle the Ajax communication and only use jQuery for the UI components
> such as "Lightbox", "Greybox", apple like sliders, etc.
> 
>  
> 
> Any ideas?
> 
>  
> 
> Thanks.
> 
>  
> 
>  
> 
> 
> 


-----
http://richard-wilkinson.co.uk My blog: http://richard-wilkinson.co.uk 
-- 
View this message in context: 
http://www.nabble.com/Wicket-and-JQuery-tp26085243p26091993.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

Reply via email to