webtier@glassfish.java.net

Re: [webtier] JSF 2.0 PR Ajax Question

From: Jim Driscoll <Jim.Driscoll_at_Sun.COM>
Date: Tue, 06 Jan 2009 12:28:45 -0800

Interesting, and worrying.

As I said, that code (the ajax edit code) works fine - but it's only
been tested under Glassfish, not Tomcat. And no, what you're seeing is
not the expected behavior, as I'm sure you guessed.

There should also be additional update entities that have the ids of the
fields being updated, as listed in the request's "render" option.

For simplicity's sake, if you could try one of the basic-ajax examples,
also in the jsf-demo directory, they have far less going on than the
edit example. "count.xhtml" is probably the simplest example. If that
doesn't work, then we've narrowed the problem considerably, and I'll
have to install all this on Tomcat and give it a spin to see what's
going on.

I beleive that I covered the "count" example in my blog as well, though
the API has changed a bit since then.

Jim

Lincoln Baxter, III wrote:
> Hey Jim,
>
> Thanks for your reply, I'm already loving JSF2.0. Great work!
>
> I checked out your sources and built with the Mojarra 2008/01/04
> Snapshot. Is this normal behavior?
> This is all I get back from my ajax request:
>
> <partial-response>
> <changes>
> <update id="javax.faces.ViewState">j_id47:j_id48</update>
> </changes>
> </partial-response>
>
>
> If I click 'reload', I see that the value has indeed updated, but no
> ajax DOM update occurs. Is that normal? Would I have to do something
> extra to re-render a region? It seems like the jsf.ajax.request() call
> should be taking care of that.
>
> I am running on Tomcat 6.0.18, Ubuntu Linux 8.10.
>
> Thanks again,
> Lincoln
>
> On Mon, 2009-01-05 at 09:56 -0800, Jim Driscoll wrote:
>> Hello -
>>
>> Good to see someone looking at this.
>>
>> A number of changes happened to the Ajax API besides the change in the
>> library name - and most of those changes happened right at the end of
>> the development process. While I haven't updated the blog entries, I
>> have kept their associated code up to date and running in the Mojarra
>> source base.
>>
>> Future versions of the JSF builds will distribute these demos, but for
>> now, you can find the full, working source code for this example at:
>>
>> https://mojarra.dev.java.net/source/browse/mojarra/trunk/jsf-demo/basic-ajax-edit/
>>
>> This is the same link that you can find in the blog entry itself.
>>
>> If you can't get that working, let me know, but I just did a test build,
>> and it works fine.
>>
>> Jim Driscoll
>>
>> Lincoln Baxter, III wrote:
>> > Hi All,
>> >
>> > First, I noticed that the library ajax.js does not exist in the PR
>> > release. It seems to have been incorporated with jsf.js in the
>> > "javax.faces" namespace/library.
>> >
>> > Second. I'm trying to put together the editable text ajax example from
>> > Jim Driscoll's blog here:
>> > http://weblogs.java.net/blog/driscoll/archive/2008/11/another_jsf_20_1.html
>> > but I'm running in to an issue where the AJAX request fires just fine,
>> > but the only element returned by the "render: list of ids" parameter is
>> > the javax.faces.ViewState element, all other elements are ignored.
>> >
>> > Also, the value of the inputText field is not populated in the managed
>> > bean. (it is however, passed as a POST parameter)
>> >
>> > Any thoughts?
>> > I can post source if required, but it's pretty much straight from Jim's
>> > example. (Plus the action method on submit just to verify that anything
>> > happens at all)
>> >
>> > Thanks,
>> > Lincoln
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net <mailto:webtier-unsubscribe_at_glassfish.dev.java.net>
>> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net <mailto:webtier-help_at_glassfish.dev.java.net>
>>