Page 1 of 1

Child components of AccordionPanel not executed

Posted: 02 Dec 2011, 12:19
by michael.kurz
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?

Re: Child components of AccordionPanel not executed

Posted: 02 Dec 2011, 12:30
by cagatay.civici
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?

Re: Child components of AccordionPanel not executed

Posted: 02 Dec 2011, 13:17
by michael.kurz
+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.

Re: Child components of AccordionPanel not executed

Posted: 02 Dec 2011, 14:13
by cagatay.civici
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.

Re: Child components of AccordionPanel not executed

Posted: 02 Dec 2011, 15:57
by michael.kurz
Created issue 2962 ([1]) including patch and test web app.

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

Re: Child components of AccordionPanel not executed

Posted: 02 Dec 2011, 16:06
by cagatay.civici
Great, thanks, we'll look in detail before RC1.