webtier@glassfish.java.net

Re: [webtier] JSF 2.0 Ajax question

From: Lincoln Baxter, III <lincolnbaxter_at_gmail.com>
Date: Tue, 13 Jan 2009 19:12:31 -0500

Awesome. I'll check out your blogs. What I'm concerned about is the
ability to call a server-side function, and retrieve results, without
the need for attaching it to another component. It's just standalone,
providing a javascript function to perhaps be consumed by a window
on-load event, or timer event. (For instance, if I wanted to send the
position of the mouse-cursor back to the server every 0.5 seconds.)

--Lincoln

On Sun, 2009-01-11 at 17:00 -0800, Jim Driscoll wrote:

> Lincoln Baxter, III wrote:
> > Just a quick question in case this use case isn't already out there. How
> > would I use the current JSF 2.0 ajax functionality to call a server-side
> > method through ajax, preferably without needing to render a hidden
> > command***** field. Is that possible?
> >
> > A4J enabled this through the <a4j:jsFunction> tag.
>
>
>
> I'm not sure I understand exactly what you're asking for (I don't know
> A4J), but attaching an ActionListener to a an action calls that method
> when it's used for Ajax (and you can do something similar with
> ValueChangeListener). Is that what you're looking for? The method
> signatures aren't arbitrary (which might be what you mean by hidden
> fields), but it can do any action within that constraint. The docs I
> found for jsfunction (at
> http://www.jboss.org/file-access/default/members/jbossajax4jsf/freezone/docs/tlddoc/a4j/jsFunction.html)
> seems to imply similar usage.
>
> The demos (even the simple ones) have that usage sprinkled about - I
> still need to write a demo that does a ValueChange using the js
> functions, but the ajax-tag demo does that using the <f:ajax> tag.
>
> Let me know if that answers your question.
>
> Jim
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>