process all components except one

UI Components for JSF
Post Reply
m_sergiuv
Posts: 9
Joined: 06 Jan 2012, 09:42

06 Jan 2012, 10:00

Hi guys!

I've a question, suppose I've this code:

<p:outputPanel id="panelId" layout="block">
<p:inputText id="inputId" value="#{bean.property}"/>
<p:inputText value="#{bean.property}"/>
</p:outputPanel>

<p:commandButton value="Submit" action="#{bean.save}" process="panelId"/>

The question is, when I press on submit button, it process all outputPanel with panelId Id. But I want to process all components from panelId,
except component with inputId Id. Can do so somewhat?

Thanks in advance!

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

06 Jan 2012, 11:29

It's not possible.
I would so something like this:

Code: Select all

<p:outputPanel id="panelId" layout="block">
       <p:inputText id="inputId" value="#{bean.property}"/>
       <p:outputPanel id="containerToProcess">
             <p:inputText value="#{bean.property}"/>
       </p:outputPanel>
</p:outputPanel>
<p:commandButton value="Submit" action="#{bean.save}" process="containerToProcess"/>
Or list all sub components which should be processed.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

m_sergiuv
Posts: 9
Joined: 06 Jan 2012, 09:42

06 Jan 2012, 17:39

zoigl, thank you for answer...

Example that I gave is simple, but in my case I have something more complicated, for example:

<p:outputPanel id="panelId" layout="block">
<p:inputText id="oneId" value="#{bean.property}"/>
<p:inputText id="twoId" value="#{bean.property}"/>
<p:inputText id="threeId" value="#{bean.property}"/>
<p:inputText id="fourId" value="#{bean.property}"/>
<p:inputText id="fiveId" value="#{bean.property}"/>
<p:inputText id="sixId" value="#{bean.property}"/>
</p:outputPanel>

And suppose I don't have to process component - twoId and fiveId:

One of the possibilities can be next: to write all ids for components that I want to process <p:commandButton value="submit" process="oneId threeId fourId sixId">

But I thought it was a possibility to write something like this: <p:commandButton value="submit" process="@all !twoId !fiveId">
It could be quite ok...
Good luck;

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests