Hi!
> The pprSubmit is something like a generic autoSubmit feature for
> command components (see also autoSubmit attribute in trinidad).
>   
? pprSubmit does nothing else than rendering the javascript to hook on
the new components too, no?
I do not understand what you mean with autoSubmit here.

> Adding this feature to pprSubmit would somehow break the existing ppr
> behavior, where the triggered components register themselves for
> updates.
>   
I do not change the existing ppr behavior, just how the data sent by it
will be processed on the server. If this will break the ppr philosophy
then I think the ppr is broken at all, isn't it?

Just to be sure everyone understand what I would like to have.
The interesting part of this view is:
* a single form
* a required customer name
* a country/zip pair which needs to be available in the model during ppr
* a city which will be computed out of the country/zip data during ppr

The problem is, that due to the required customer the ppr will not work
due to the validation error which will happen.

<h:form>
    <s:pprPanelGroup partialTrigger="lookupCity">
        <t:panelGrid columns="2">
            <h:outputText value="Customer Name" />
            <h:inputText id="name" value="#{bean.name}" required="true" />

            <h:outputText value="Country" />
            <h:selectOneMenu id="country" value="#{bean.country}" />

            <h:outputText value="Zip" />
            <h:inputText id="zip" value="#{bean.zip}" required="true">
                <s:submitOnEvent event="change" for="lookupCity" />
            </h:inputText>

            <h:outputText value="City" />
            <h:panelGroup>
                <h:outputText id="cityAuto" value="#{bean.cityAuto}"
renderer="#{bean.cityAuto}"/>
                <h:commandButton action="#{bean.overrideCity}"
renderer="#{bean.cityAuto}"/>
                <h:inputText id="cityMan" value="#{bean.cityMan}"
renderer="#{!bean.cityAuto}" required="true" />
                <h:commandButton action="#{bean.resetCityToAutomatic}"
renderer="#{!bean.cityAuto}"/>
            </h:panelGroup>

        </t:panelGrid>

    </s:pprPanelGroup>

<h:commandButton id="lookupCity" action="#{bean.lookupCity}" style="hidden">
    <s:pprSubmit processComponentIds="country,zip" />
</h:commandButton>

<h:commandButton action="#{bean.save}" />
</h:form>

The complicated thing is, that the pprSubmit enhancement would require a
custom LifeCycle for PPR requests (why is it a PhaseListener by now?)


Another possibility to fix that would be to enhance subForm to nicely
work in a nested mode so that you can have a subForm with multiple
subForms within and a logical name (new attribute) to group the subForms
together.
Then ppr as it is today might work then, the resulting view wouldn't
look nice though.

Or, using RichFaces with its ajax implementation which might allow this
already ... adding this library for just one function seems weird to me
though :-(

Ciao,
Mario

Reply via email to