jquery-mobileprimefaces-mobile

commandButton with ajax=false using primefaces-mobile doesn't navigate correctly


I noticed commandButton with ajax=false is not working in primefaces mobile. I want to make non-ajax call to navigate to different url when user press the button. If I remove ajax=false, it hits the bean manager class but this will not navigate to different page. What is the fix for this?

ui:composition template="/mobile/templates/masterLayout.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui"
    xmlns:cc="http://java.sun.com/jsf/composite/composite"
    xmlns:pm="http://primefaces.org/mobile">
    <ui:define name="center">
        <pm:page title="Test">
            <pm:view id="main">
                <pm:header title="Test" swatch="b" />
                <pm:content>
                    <p:messages />
                    <h:form id="mainForm" prependId="false">
                        <p:inputText id="title" value="#{bean.title}"
                            required="true" label="title" />
                        <p:inputText id="wbUserName"
                            value="#{bean.creator}" required="true"
                            label="User name" />
                        <p:commandButton id="dialogButton" value="Create" ajax="false"
                            actionListener="#{bean.create}">
                        </p:commandButton>
                    </h:form>
                </pm:content>
            </pm:view>
        </pm:page>

</ui:composition>

Upate:

I have replaced p:commandButton with h:commandButton and I able hit the managed bean function, but it is not forwarding to the url which it suppose to.

bean.class

 public String create(){
                    return "pretty:newPage";
    }

pretty-config.xml

 <url-mapping id="newPage">
        <pattern value="/test/"/>
        <view-id value="/views/test.jsf"/>
    </url-mapping>

Solution

  • It seems that there is currently a bug in the PrimeFaces mobile tags that causes all navigation to fail: See example app here: http://ocpsoft.org/wp-content/uploads/2013/08/pretty-prime-post-mobile.tar.gz?0decbc - As you can see. the application navigation works successfully for non-mobile tags, but with the prime-faces mobile tags, the navigation fails. I've notified the primefaces devs of this issue.