Child components of AccordionPanel not executed

UI Components for JSF
Post Reply
michael.kurz
Posts: 5
Joined: 02 Dec 2011, 12:11
Contact:

02 Dec 2011, 12:19

Hi,

for a customer I tried to create an accordion panel with input fields in different tabs (PrimeFaces 3.0 M4). Via a listener, the entered data should be saved on every tab change. The xhtml looks like this:

<p:accordionPanel id="accordion" dynamic="false">
<p:ajax event="tabChange" process="@form" update=":form:accordion"
listener="#{page1Controller.tabChangeListener}"/>
<p:tab id="tab1" title="Tab 1">
<h:inputText id="string1" value="#{page1Controller.string1}"/>
</p:tab>
...
</p:accordionPanel>

The form fields never get submitted. I also found the problem: AccordionPanel only processes child components in its processXXX() methods if it is not the source of the ajax request:

if(isRequestSource(context)) {
return;
}

Could anyone explain to me why this is done?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

02 Dec 2011, 12:30

Ideas was to avoid validation errors on tab change, that code was there before migration of events to ajax behaviors to it might be better to let the users define what to process with p:ajax? What do you think?

michael.kurz
Posts: 5
Joined: 02 Dec 2011, 12:11
Contact:

02 Dec 2011, 13:17

+1 for letting the user control what to process. Because the way it is implemented now the behavior can't be changed. I don't know what the default value for process on p:ajax is (@this I guess?) but I guess the default behavior won't change for users of the component if the checks are taken out.

I can create an issue for that if you want.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

02 Dec 2011, 14:13

Please create an issue and post the issue link here. There is pending accordion-tabview maintenance for 3.0.RC1 so we can have a look in detail. Thanks.

michael.kurz
Posts: 5
Joined: 02 Dec 2011, 12:11
Contact:

02 Dec 2011, 15:57

Created issue 2962 ([1]) including patch and test web app.

[1]: http://code.google.com/p/primefaces/iss ... il?id=2962

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

02 Dec 2011, 16:06

Great, thanks, we'll look in detail before RC1.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 28 guests