jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] Re: [jsr372-experts mirror] Re: Re: Re: Re: [JSF spec issues] [JIRA] (JAVASERVERFACES_SPEC_PUBLIC-907) Improve Ajax Http.Get support to (re)render parts of the page

From: Frank Caputo <frank_at_frankcaputo.de>
Date: Mon, 14 Sep 2015 11:35:40 +0200

Hi Werner,

I’m pretty sure, this code doesn’t cover all possible use cases. It was built for a stateless page for a really simple use case. It is simply an idea, what could be done.

Ciao Frank

> Am 14.09.2015 um 10:45 schrieb Werner Punz <werner.punz_at_gmail.com>:
>
> Hi there is a problem, you have to take the jsf.ajax post queue into consideration, otherwise you might get parallel or out of order requests considering that our http post is a queued asynchronous pattern.
>
> Kind regards
>
> Werner
>
>
> On Mon, Sep 14, 2015 at 10:38 AM, Frank Caputo <frank_at_frankcaputo.de <mailto:frank_at_frankcaputo.de>> wrote:
> Hi,
>
> here we go. I’ve done it with jQuery, because it’s really hard to change things in the jsf-javascript-library. I implemented jsf.ajax.get and jsf.ajax.render. Render simply uses get. I implemented get for simple navigation. The key is to handle the responses with jsf.ajax.response.
> jsf.ajax.get = function(userSettings) {
> var settings = $.extend({
> url:window.location.href,
> headers:{
> 'Faces-Request':'partial/ajax'
> },
> cache:false,
> error:function (data, textStatus, jqXHR) {
> jsf.ajax.response(jqXHR, {formid:'none'});
> },
> beforeSend: function () {
> // show a loader or whatever you want
> },
> success: function (data, textStatus, jqXHR) {
> jsf.ajax.response(jqXHR, {formid:'none'});
> }
> }, userSettings);
> $.ajax(settings);
> };
>
> jsf.ajax.render = function(ids, data) {
> data = data || {};
> data['javax.faces.partial.render'] = ids;
> data['javax.faces.partial.ajax'] = true;
> jsf.ajax.get('', {
> type: 'POST',
> data: data
> });
> };
> Hope this is understandable.
>
> Ciao Frank
>
>> Am 11.09.2015 um 22:21 schrieb Edward Burns <edward.burns_at_oracle.com <mailto:edward.burns_at_oracle.com>>:
>>
>>>>>>> On Fri, 11 Sep 2015 10:11:44 -0500, Josh Juneau <juneau001_at_gmail.com <mailto:juneau001_at_gmail.com>> said:
>>
>> JJ> +1, I'd also be interested in seeing your implementation. Thanks
>>
>> Me too.
>>
>> --
>> | edward.burns_at_oracle.com <mailto:edward.burns_at_oracle.com> | office: +1 407 458 0017 <tel:%2B1%20407%20458%200017>
>> | 39 Business days til JavaOne 2015
>> | 54 Business days til DOAG 2015
>
>