
primefaces - issue #4143
TabView-Accordion Execute validations on dynamic load or ajax tabchange
I have a tavbiew with 4 tabs, each have 1 form inside. The problem it's that when i change from the tab A to the tab B executes the validations of the form inside the tab A and display the messages and growl.
This behavior only occurs when the tabview has dynamic="true" and doesn't occur in previous version of PF.
ENV : PrimeFaces 3.3-SNAPSHOT (2012.05.20)
<p:tabView id="acuerdos" orientation="top" dynamic="true" cache="false" >
<p:tab title="Tab A">
<h:form id="formA">
<p:messages />
<h:panelGrid columns="2">
<h:outputLabel value="field A" />
<p:inputText value="#{fooController.valueA}" required="true" />
</h:panelGrid>
<p:commandButton value="OK" actionListener="#{fooController.saveA}" update="@form" />
</h:form>
</p:tab>
<p:tab title="Tab B">
<h:form id="formB">
<p:messages />
<h:panelGrid columns="2">
<h:outputLabel value="field B" />
<p:inputText value="#{fooController.valueB}" required="true" />
</h:panelGrid>
<p:commandButton value="OK" actionListener="#{fooController.saveB}" update="@form"/>
</h:form>
</p:tab>
</p:tabView>
@ManagedBean(name = "fooController") @ViewScoped public class FooController implements Serializable { String valueA; String valueB;
public String getValueA(){ return valueA; } public void setValueA(String value){ valueA=value; }
public String getValueB(){ return valueB; } public void setValueB(String value){ valueB=value; }
public void saveA(ActionEvent event){ //none to do }
public void saveB(ActionEvent event) //none to do } }
Comment #1
Posted on Jun 3, 2012 by Quick GiraffeForum topic (URL below) is always required as the (new issue) forum stated.
Comment #2
Posted on Jun 3, 2012 by Happy DogThis is created and new issues right ?
Comment #3
Posted on Jun 14, 2012 by Grumpy HippoFor us, this is very important! It completely broke our application. We are unable to update to 3.3. I want to understand if this is just a bug or the consequence of the internal ajax changes.
Comment #4
Posted on Jun 14, 2012 by Quick Giraffe@Karsten...@gmail.com, search issue tracker for tabview and wizard (2 separate searches), and see recent fixes (where target version = 3.3).
Wizard is implemented very similar to tabview tabchange dynamic. that's why i said search for wizard, too, because I think there was a fix for dynamic tabview tabchange (or 'wizard').
Comment #5
Posted on Jun 14, 2012 by Happy DogI did not find anything related to tabview or wizard, it sounds like big fix should be on the tabChange event , but i did not find any fix that made related to that, if you any of you find please post here.
Comment #6
Posted on Jun 15, 2012 by Quick GiraffeRead the comments on the following (and look at any related/referenced URLs):
Comment #7
Posted on Jun 28, 2012 by Grumpy Lionin our project we have the same problem both tabView and Accordion. Each tab has a form and when the tab is loaded dynamically all the form which have been preloaded are validated.
Comment #8
Posted on Aug 6, 2012 by Happy DogSolution for this issue .
hey guys , i find the solution for this issue.
function handleTabChange(event, index) { document.getElementById('activeTabIndexId').value = index; onTabChange(); }
Comment #9
Posted on Sep 1, 2012 by Happy OxHave same problem
Comment #10
Posted on Jan 22, 2013 by Helpful OxOnly on chrome. Firefox works fine.
Comment #11
Posted on Feb 2, 2013 by Happy OxComment deleted
Comment #12
Posted on Feb 8, 2013 by Happy HorseI noticed the same problem on chrome with accordionpanel :(
Comment #13
Posted on Feb 20, 2013 by Happy Panda8, your solutions work in IE 9 and google chrome, but is not working in firefox 19
anyway to solve in firefox?
Comment #14
Posted on Mar 22, 2013 by Happy Pandahi all, I solved my problem by adding the code: FacesContext.getCurrentInstance().renderResponse(); under TabChangeEvent method in backign bean..
eg: public void onTabChange(TabChangeEvent event) { FacesContext.getCurrentInstance().renderResponse(); }
Comment #15
Posted on Jul 3, 2013 by Helpful KangarooI have the same problem, someone managed to fix it?
Comment #16
Posted on Jul 3, 2013 by Helpful KangarooPrimefaces 3.5.8 still has this bug.
Comment #17
Posted on Sep 19, 2013 by Grumpy ElephantComment deleted
Comment #18
Posted on Feb 22, 2014 by Swift Rhino(No comment was entered for this change.)
Comment #19
Posted on Feb 22, 2014 by Swift Rhino(No comment was entered for this change.)
Status: Fixed
Labels:
Priority-Medium
Type-Defect
TargetVersion-5.0
TargetVersion-3.5.25
TargetVersion-4.0.9