Chart won't be rendered

UI Components for JSF
smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

29 Aug 2014, 13:34

Ronald, I'm surprised you did not ask what version of PrimeFaces.

@JasDA,

1. what version of PrimeFaces are you using? let's start there, first, so I don't assume anything.

2. if you are using PrimeFaces 5.0 Mobile, did you read the entire PrimeFaces mobile section in the PrimeFAces 5.0 user guide?

3. Did you select and/or specify the PRIMEFACES_MOBILE kit as advised in the user guide? reply with that code

4. where is your pm:header tag?

Code: Select all

<!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">
     
    <h:head>

    </h:head>
     
    <h:body>    
        <pm:page id="mainMenu">
            <pm:content>            
               <h:form id="mainForm">               
               <p:menu>
                   <p:submenu label="Test">
                       <p:menuitem value="Show chart" action="#{replenishmentBean.showChartTest}" />
                   </p:submenu>                
               </p:menu> 
               </h:form>            
            </pm:content> 
        </pm:page>
        
        
        <pm:page id="chart">
            <pm:content>            
         <p:barChart rendered="#{replenishmentBean.salesChartModel != null}" id="basic" value="#{replenishmentBean.salesChartModel}" legendPosition="ne" title="Sales Chart" animate="true" style="height:75vh"/>
            </pm:content>
        </pm:page>             
    </h:body>
     
</html>
and

Code: Select all

<!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">
     
    <h:head>

    </h:head>
     
    <h:body>    
        <pm:page id="chart">
            <pm:content>            
         <p:barChart rendered="#{replenishmentBean.salesChartModel != null}" id="basic" value="#{replenishmentBean.salesChartModel}" legendPosition="ne" title="Sales Chart" animate="true" style="height:75vh"/>
            </pm:content>
        </pm:page>             
    </h:body>
     
</html>
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

02 Sep 2014, 14:09

smithh032772 wrote:Ronald, I'm surprised you did not ask what version of PrimeFaces.
Shoot... I forgot ;-)
smithh032772 wrote:
@JasDA,

1. what version of PrimeFaces are you using? let's start there, first, so I don't assume anything.
It is not 5.0 since the barChart tag is used. In 5 it became chart with a type attribute
smithh032772 wrote:2. if you are using PrimeFaces 5.0 Mobile, did you read the entire PrimeFaces mobile section in the PrimeFAces 5.0 user guide?
He is not, see comment above (that you missed that ;-))

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

02 Sep 2014, 15:19

kukeltje wrote:It is not 5.0 since the barChart tag is used. In 5 it became chart with a type attribute
He is not, see comment above (that you missed that ;-))
Actually, barChart tag is not deprecated in PrimeFaces 5.0 Final release. I am still using barChart and other legacy-PrimeFaces chart tags in my PrimeFaces 5.0 web app. :)
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

02 Sep 2014, 15:24

Then it is maybe just deprecated and not removed yet... My bad...

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

02 Sep 2014, 16:48

does anyone see 'charts' as a supported component in the PrimeFaces MOBILE showcase ?? I don't.

It's best to use HTML_BASIC render kit instead of PRIMEFACES_MOBILE render kit.

Since PrimeFaces charts == jqplot && PRIMEFACES_MOBILE render kit == jquery mobile,

search google for

jquery mobile jqplot

and click on search results, and read them.

I found

The Rock n Coder: jQuery Mobile Charts

seems as though jquery mobile + jqplot works well together. :)
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

02 Sep 2014, 22:59

This forum topic motivated me to develop a PrimeFaces 5.0 mobile xhtml page for the existing HTML_BASIC page in my app that displays charts.

Below, is the PrimeFaces 5.0 mobile xhtml pages. When the page is first rendered in the browser, it shows multiple charts.

main charts page

Code: Select all

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      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"
      xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
      xmlns:o="http://omnifaces.org/ui"
      xmlns:of="http://omnifaces.org/functions">

    <ui:composition>

        <pm:page id="mainViewCharts">
            
            <pm:header title="CHARTS">
                <h:form id="viewChartsHeaderForm">
                    <ui:include src="/menuBtnForMobile.xhtml"/>
                    <p:commandButton styleClass="ui-btn-right ui-btn-inline"
                                     icon="ui-btn ui-icon-forward"
                                     value="Logout"
                                     action="#{pf_usersController.logout(true)}"
                                     ajax="false" immediate="true"
                                     onclick="displayLoadingImage(true);"/>
                </h:form>
            </pm:header>
            
            <pm:content>
                
                <h:form id="viewChartsForm" >

                    <p:growl id="formMessages" life="30000"
                             showDetail="true" showSummary="true"
                             globalOnly="false" escape="false"/>
                    
                    <p:commandButton icon="ui-icon-bullets"
                                     value="Chart options"
                                     action="pm:viewChartOptionsPage"
                                     ajax="false" immediate="true"
                                     onclick="displayLoadingImage(true);"/>
                    
                    <h:outputText value="#{pf_ordersController.selectedPieChart}"
                                  style="font-weight: bolder;"/>
                    
                    <ul data-role="listview" data-inset="true">

                        <li data-role="list-divider">Pie Chart</li>
                        <li>
                            <p:pieChart value="#{orderChartBean.pieChartModel}"
                                        fill="false" legendPosition="sw"
                                        showDataLabels="true" sliceMargin="5" diameter="150"/>
                        </li>

                        <li data-role="list-divider">Bar Chart</li>
                        <li>
                            <p:barChart value="#{orderChartBean.cartesianChartModel}"
                                        legendPosition="sw"
                                        datatipFormat="#{orderChartBean.datatipFormat}"/>
                        </li>

                        <li data-role="list-divider">Line Chart</li>
                        <li>
                            <p:lineChart value="#{orderChartBean.cartesianChartModel}"
                                         legendPosition="sw"
                                         datatipFormat="#{orderChartBean.datatipFormat}"/>
                        </li>

                    </ul>

                </h:form>

            </pm:content>
            
            <ui:include src="/menuForMobile.xhtml"/>
            
        </pm:page>
        
        <ui:include src="/orders/pf_ViewChartOptionsForMobile.xhtml"/>

    </ui:composition>

</html>
chart options page

Code: Select all

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      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"
      xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
      xmlns:o="http://omnifaces.org/ui"
      xmlns:of="http://omnifaces.org/functions">

    <ui:composition>

        <pm:page id="viewChartOptionsPage">
            
            <pm:header title="CHART OPTIONS">
                <h:form id="viewChartOptionsHeaderForm">
                    <p:commandButton styleClass="ui-btn-left ui-btn-inline"
                                     icon="ui-icon-back"
                                     value="Return"
                                     action="pm:mainViewCharts"
                                     ajax="false" immediate="true"
                                     onclick="displayLoadingImage(true);"/>
                    <p:commandButton styleClass="ui-btn-right ui-btn-inline"
                                     icon="ui-btn ui-icon-forward"
                                     value="Logout"
                                     action="#{pf_usersController.logout(true)}"
                                     ajax="false" immediate="true"
                                     onclick="displayLoadingImage(true);"/>
                </h:form>
            </pm:header>
            
            <pm:content>
                
                <h:form id="chartOptionsForm" >

                    <p:growl id="chartOptionsFormMessages" life="30000"
                             showDetail="true" showSummary="true"
                             globalOnly="false" escape="false"/>
                    
                    <h:panelGroup layout="block"
                                  rendered="#{!orderChartBean.isSelectedPieChart('Confirmed Trips: Total Revenue Per Year')}">
                        <pm:field>
                            <p:outputLabel value="Year:" for="filterYear"/>
                            <p:selectOneMenu id="filterYear" label="Year"
                                             value="#{pf_ordersController.filterYear}">
                                <f:selectItems value="#{pf_ordersController.allYears}"/>
                            </p:selectOneMenu>
                        </pm:field>
                    </h:panelGroup>

                    <h:panelGroup layout="block"
                                  rendered="#{orderChartBean.isSelectedPieChart('Confirmed Trips: Total Revenue Per Year')}">
                        <pm:field>
                            <p:outputLabel value="Year (FROM):" for="filterYear1"/>
                            <p:selectOneMenu id="filterYear1" label="Year (FROM)"
                                             value="#{pf_ordersController.filterYear}">
                                <f:selectItems value="#{pf_ordersController.allYears}"/>
                            </p:selectOneMenu>
                        </pm:field>
                        <pm:field>
                            <p:outputLabel value="Year (TO):" for="filterYear2"/>
                            <p:selectOneMenu id="filterYear2" label="Year (TO)"
                                             value="#{pf_ordersController.filterYear2}">
                                <f:selectItems value="#{pf_ordersController.allYears}"/>
                            </p:selectOneMenu>
                        </pm:field>
                    </h:panelGroup>

                    <p:menu id="viewChartOptionsMenu">
                        <p:menuitem value="Submit" icon="ui-icon-refresh" ajax="false"
                                    onclick="displayLoadingImage(true)"
                                    action="#{pf_ordersController.updateViewCharts()}"/>
                        <p:submenu label="Available Charts">
                            <p:menuitem value="Total Revenue"
                                        ajax="false"
                                        onclick="displayLoadingImage(true)"
                                        action="#{pf_ordersController.prepareViewCharts('Confirmed Trips: Total Revenue')}"/>
                            <p:menuitem value="Total Revenue Per Driver"
                                        ajax="false"
                                        onclick="displayLoadingImage(true)"
                                        action="#{pf_ordersController.prepareViewCharts('Confirmed Trips: Total Revenue Per Driver')}"/>
                            <p:menuitem value="Total Revenue Per Service"
                                        ajax="false"
                                        onclick="displayLoadingImage(true)"
                                        action="#{pf_ordersController.prepareViewCharts('Confirmed Trips: Total Revenue Per Service')}"/>
                            <p:menuitem value="Total Revenue Per Year"
                                        ajax="false"
                                        onclick="displayLoadingImage(true)"
                                        action="#{pf_ordersController.prepareViewCharts('Confirmed Trips: Total Revenue Per Year')}"/>
                            <p:menuitem value="Total Trips Per Driver"
                                        ajax="false"
                                        onclick="displayLoadingImage(true)"
                                        action="#{pf_ordersController.prepareViewCharts('Confirmed Trips: Total Trips Per Driver')}"/>
                            <p:menuitem value="Confirmed Trips/Miles" ajax="false"
                                        rendered="false"
                                        onclick="displayLoadingImage(true)"
                                        action="#{pf_ordersController.prepareViewCharts('Confirmed Trips: Miles')}"/>
                        </p:submenu>
                    </p:menu>

                </h:form>

            </pm:content>
            
        </pm:page>
        
    </ui:composition>

</html>
the error below occurs when I click 'Chart options' command button, which changes from main page to chart options page.

Code: Select all

Sep 02, 2014 3:18:59 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/mcmsweb] threw exception [null] with root cause
java.lang.NullPointerException
	at org.primefaces.component.chart.pie.PieChartRenderer.encodeData(PieChartRenderer.java:68)
	at org.primefaces.component.chart.pie.PieChartRenderer.encodeScript(PieChartRenderer.java:51)
	at org.primefaces.component.chart.pie.PieChartRenderer.encodeEnd(PieChartRenderer.java:36)
	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:674)
	at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:85)
	at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:68)
	at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:83)
	at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:68)
	at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:83)
	at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:68)
	at org.primefaces.mobile.component.page.PageRenderer.encodeContent(PageRenderer.java:71)
	at org.primefaces.mobile.component.page.PageRenderer.encodeEnd(PageRenderer.java:41)
	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:674)
	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:554)
	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:550)
	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:550)
	at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1891)
	at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:313)
	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:58)
	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:58)
	at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:116)
	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:267)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:200)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:98)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.omnifaces.filter.GzipResponseFilter.doFilter(GzipResponseFilter.java:149)
	at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:77)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at pf.LoginFilter.doFilter(LoginFilter.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1736)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1695)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
so, how would I fix (or 'avoid') this error? by doing something I did for another mobile xhtml page that I developed a few days ago. I will redesign this page to a single page instead of multiple page by using a bean attribute and ui:include.

remove the 2nd page (chart options page) from the same xhtml file that contains the main pm:page

Code: Select all

<ui:include src="/orders/pf_ViewChartOptionsForMobile.xhtml"/>
add bean attribute and methods that will be used by Chart options command button and Return button

Code: Select all

    private Boolean viewChartOptions;

        // initialized in PostConstruct
        viewChartOptions = false;

    public Boolean getViewChartOptions() {
        return viewChartOptions;
    }
    
    public String prepareViewChartOptionsForMobile() {
        viewChartOptions = true;
        return "pm:viewChartOptionsPage";
    }

    public String returnFromViewChartOptionsForMobile() {
        viewChartOptions = false;
        
        /* to avoid the exception, below, that occurs when click Return button (F5 key in HTML_BASIC, too)
        
java.lang.NullPointerException
	at org.primefaces.component.chart.pie.PieChartRenderer.encodeData(PieChartRenderer.java:68)
	at org.primefaces.component.chart.pie.PieChartRenderer.encodeScript(PieChartRenderer.java:51)
	at org.primefaces.component.chart.pie.PieChartRenderer.encodeEnd(PieChartRenderer.java:36)
	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:674)
	at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:85)
	...
        
        */
        orderChartBean.initPieChartModel(filterYear, filterYear2);
        
        return "pm:mainViewCharts";
    }
* the code above really has the fix for the exception *

Chart options command button (on main page): reference bean method

Code: Select all

                    <p:commandButton icon="ui-icon-bullets"
                                     value="Chart options"
                                     action="#{pf_ordersController.prepareViewChartOptionsForMobile()}"
                                     ajax="false" immediate="true"
                                     onclick="displayLoadingImage(true);"/>
Return button (on chart options page): reference bean method

Code: Select all

                    <p:commandButton styleClass="ui-btn-left ui-btn-inline"
                                     icon="ui-icon-back"
                                     value="Return"
                                     action="#{pf_ordersController.returnFromViewChartOptionsForMobile()}"
                                     ajax="false" immediate="true"
                                     onclick="displayLoadingImage(true);"/>
and i have the following ui:include, which conditionally references the non-mobile charts page, mobile charts options page, or mobile charts main page.

Code: Select all

<ui:include src="#{pf_usersController.primeFacesMobile ? (pf_ordersController.viewChartOptions ? '/orders/pf_ViewChartOptionsForMobile.xhtml' :'/orders/pf_ViewChartsForMobile.xhtml') : '/orders/pf_ViewChartsForNonMobile.xhtml'}"/>
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

03 Sep 2014, 17:56

I would HOPE that the render is selective... meaning, if there is a mobile version of a component, render that, if not, just render the normal one... If not that would be a huge, huge problem for me in the near future

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

03 Sep 2014, 18:30

kukeltje wrote:I would HOPE that the render is selective... meaning, if there is a mobile version of a component, render that, if not, just render the normal one... If not that would be a huge, huge problem for me in the near future
what i am finding/learning/recognizing is this... xhtml for PrimeFaces (core) components may differ a little. of course, size="..." will be for HTML_BASIC (render kit or) pages, but I always remove size="..." for PRIMEFACES_MOBILE (render kit or) pages.

It is the same for p:autoComplete, and PrimeFaces charts components, like pieChart diameter attribute. I removed diameter attribute for PRIMEFACES_MOBILE xhtml page. Why? so component will be sized to fit the mobile device. i'm testing on phone, tablet, and Google Chrome 'device emulation'.

i am very impressed with PrimeFaces 5.0 Final Mobile render kit. i'm developing mobile xhtml pages for HTML_BASIC pages in my app, so I can use same beans for mobile and non-mobile devices.

i hope that answers your question, Ronald.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

05 Sep 2014, 17:57

okay, OP included the following:

Code: Select all

                   <p:submenu label="Test">
                       <p:menuitem value="Show chart" action="#{replenishmentBean.showChartTest}" />
                   </p:submenu>                
My questions/observations:

1. p:menuitem ajax=true is default, I don't recommend using ajax=true in/with PrimeFaces (5.0) Mobile, especially if you have custom jquery Mobile tags on your page. I strongly recommend ajax=false for your use case and for most use cases.

2. where is the parent XHTML page that contains ui:include for mainmenu and chart mobile pages???

3. how do you navigate from mainmenu mobile page to chart mobile page with the following?

Code: Select all

   public String showChartTest()
   {
       ...
       
      return "pm:chart";
   }
4. I assume you have to have the XHTML file included in a parent XHTML file via ui:include, and then you use PrimeFaces Mobile navigation to navigate to pm:chart.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 42 guests