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

[jsr372-experts] Re: [jsr372-experts mirror] Re: Partial Execution with Non-Ajax

From: Kito Mann <kito.mann_at_virtua.com>
Date: Mon, 19 Jan 2015 11:05:43 -0500

+1

I think this is pretty easy to implement, but gives us a lot more
flexibility, especially since it solves the subform use case (at least on
the surface). Just the right kind of thing to add to a point release.

On Fri, Jan 16, 2015 at 1:24 PM, Cagatay Civici <cagatay.civici_at_gmail.com>
wrote:

> Hi,
>
> My intention is a proper partial execution, same as ajax.
>
> I've implemented this before actually to see if it is possible, however in
> Mojarra I lost the view state rendering whereas it worked in MyFaces. It is
> a simple if check, nothing big. So that we could have;
>
> <h:form>
> <h:inputText id="txt1" value="#{bean.value1}" required="true"/>
> <h:inputText id="txt2" value="#{bean.value2}" />
> <h:commandButton value="Check Value 2" execute="@this txt2"
> actionListener="#{bean.check}"/>
> </h:form>
>
> Right now, you must use f:ajax to avoid validation of txt1 and have your
> check() method invoked with value2 model updated.
>
> So instead of subforms or anything similar, idea is to run partial
> execution at jsf lifeycycle in a non-ajax request as well.
>
> Currently PartialViewContext has isPartialRequest() method which needs to
> check for a request parameter like javax.partial.request=true.
>
> I think this is a useful add-on, users are kinda forced to use ajax when
> they need partial execution of components, or use immediate which is
> usually confusing for newcomers.
>
> Regards,
>
> Cagatay Civici
> PrimeFaces Lead
> PrimeTek Informatics
> www.primefaces.org
>
> On Friday 16 January 2015 at 20:09, Michael Müller wrote:
>
> Hello together,
>
> Am 15.01.2015 um 23:43 schrieb arjan tijms:
>
> If I understood the case correctly, I'd say just as you normally do.
> The execute attribute is about what fields the server processes. For
> instance suppose you have:
>
> <h:inputText id="name" value="#{bean.name}" />
> <h:inputText id="email" value="#{bean.email}" />
>
> Now consider that in some cases you only want that "name" is
> processed, and that "email" is ignored (server side). Ignored here
> then means no converter or validator runs for the "email" component
> and no value (if any was provided) is pushed into the model.
>
> Ok, I got you point.
> @Cagatay Is this your intention? Not a real parial request, but to
> ignore some elements?
>
> Hazem's mention of subform is quite interesting. Thus, only parts might
> be send during the post back, still initiating a full response (?).
>
> Now, let's consider a situation where you dynamically want to decide,
> which parts (not a whole [sub]form, just a single or couple of elements)
> shall be processed at server side or not.
> What about adding a special attribute? Missing defaults to false which
> is existing behavior.
>
> <h:inputText id="name" value="#{bean.name}"
> ignore="#{bean.ignoreNameCondition}"/>
> <h:inputText id="email" value="#{bean.email}"
> ignore="#{bean.ignoreNameCondition}"/>
>
> Might this be a usefull addition to [sub]form?
>
> Best,
> Michael
>
>
>