Chart inside accordion tab avoids event tabChange in 5.11

UI Components for JSF
Post Reply
soekris
Posts: 76
Joined: 29 Apr 2013, 16:54
Location: Barcelona

06 May 2016, 10:44

Hi

When there is a chart inside a tab on an accordionPanel, tabChange is not fired.

It works in 5.10

Thanks!!

Code: Select all

<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pm="http://primefaces.org/mobile">

    <f:view  contentType="text/html" renderKitId="PRIMEFACES_MOBILE" />

    <h:head>
        <h:outputStylesheet library="css" name="style.css"/> 
        <h:outputStylesheet library="css" name="jqm-icon-pack-fa.css"/> 
    </h:head>

    <h:body>

        <h:form id="form1">

            <pm:page id="first" swatch="a">

                <p:growl id="msgs" showDetail="true" />

                <pm:content>

                    <p:growl id="growlPlana" autoUpdate="true"/>   
                    
                    <p:accordionPanel  id="accordionGrafics" activeIndex="-1" multiple="false" dynamic="false" cache="true">
                        <p:ajax event="tabChange" listener="#{chartView.onTabChange}"  update=":form1:first:msgs" />
                        <p:tab title="Tab 1">
                             <!-- THIS TAB TRIGGERS LISTENER -->
                            <p:outputLabel value="tab1" />
                        </p:tab>

                        <p:tab title="Tab 2" >
                             <!-- THIS TAB DOES NOT TRIGGERS LISTENER -->
                            <p:chart  id="bar1" type="bar" model="#{chartView.barModel}" style="height:300px" responsive="true"/>
                        </p:tab>                        
                    </p:accordionPanel>
                    
                </pm:content>

            </pm:page>
        </h:form>

    </h:body>

</html>

PS: There is a console error "Uncaught Error: No data specified" but I can't attach here, forum does not allow to do it
Primefaces 5.3.X / 6.X
NetBeans 8.1
WildFly 10
Linux Mint & freeBSD

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

10 May 2016, 12:40

Thanks for the sample. I'll review and get back to you. 5.11 -> 5.3.11 right??

soekris
Posts: 76
Joined: 29 Apr 2013, 16:54
Location: Barcelona

10 May 2016, 18:13

oops, 5.3.11 exact! sorry
Primefaces 5.3.X / 6.X
NetBeans 8.1
WildFly 10
Linux Mint & freeBSD

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

11 May 2016, 12:48

Hi Soekris,

I tested this issue, but I didn't see a bug. I only removed h:outputStylesheet in your sample code. It works fine for me. Please check chartView.barModel values.

My onTabChange method;

Code: Select all

@ManagedBean
public class ChartView implements Serializable {
...
   public void onTabChange(TabChangeEvent e) {
         FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("TabChange", e.getTab().getTitle()));
   }
...
}
Screenshot;
Image

Leah Julius
Posts: 3
Joined: 02 Jun 2016, 11:42

03 Jun 2016, 13:39

These links shall be my best friends during this time of mobile web app development!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests