Export to GitHub

primefaces - issue #4143

TabView-Accordion Execute validations on dynamic load or ajax tabchange


Posted on Jun 3, 2012 by Happy Dog

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>

                &lt;p:tab title=&quot;Tab B&quot;&gt;
                             &lt;h:form id=&quot;formB&quot;&gt;
                                  &lt;p:messages /&gt;
                                  &lt;h:panelGrid columns=&quot;2&quot;&gt;
                                       &lt;h:outputLabel value=&quot;field B&quot; /&gt;
                                       &lt;p:inputText value=&quot;#{fooController.valueB}&quot; required=&quot;true&quot; /&gt;
                                  &lt;/h:panelGrid&gt;
                                  &lt;p:commandButton value=&quot;OK&quot; actionListener=&quot;#{fooController.saveB}&quot;  update=&quot;@form&quot;/&gt;
                             &lt;/h:form&gt;
                &lt;/p:tab&gt;

            &lt;/p:tabView&gt;

@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 Giraffe

Forum topic (URL below) is always required as the (new issue) forum stated.

http://forum.primefaces.org/viewtopic.php?f=3&t=22229

Comment #2

Posted on Jun 3, 2012 by Happy Dog

This is created and new issues right ?

Comment #3

Posted on Jun 14, 2012 by Grumpy Hippo

For 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 Dog

I 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 Giraffe

Read the comments on the following (and look at any related/referenced URLs):

http://code.google.com/p/primefaces/issues/detail?id=3423

Comment #7

Posted on Jun 28, 2012 by Grumpy Lion

in 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 Dog

Solution 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 Ox

Have same problem

Comment #10

Posted on Jan 22, 2013 by Helpful Ox

Only on chrome. Firefox works fine.

Comment #11

Posted on Feb 2, 2013 by Happy Ox

Comment deleted

Comment #12

Posted on Feb 8, 2013 by Happy Horse

I noticed the same problem on chrome with accordionpanel :(

Comment #13

Posted on Feb 20, 2013 by Happy Panda

8, 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 Panda

hi 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 Kangaroo

I have the same problem, someone managed to fix it?

Comment #16

Posted on Jul 3, 2013 by Helpful Kangaroo

Primefaces 3.5.8 still has this bug.

Comment #17

Posted on Sep 19, 2013 by Grumpy Elephant

Comment 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