0

我注意到带有 ajax=false 的 commandButton 在 primefaces mobile 中不起作用。当用户按下按钮时,我想进行非 ajax 调用以导航到不同的 url。如果我删除 ajax=false,它会命中 bean 管理器类,但这不会导航到不同的页面。解决方法是什么?

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>

更新:

我已经用 h:commandButton 替换了 p:commandButton 并且我可以点击托管 bean 函数,但它没有转发到它假设的 url。

豆类

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

漂亮的配置.xml

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

1 回答 1

0

似乎 PrimeFaces 移动标签中当前存在导致所有导航失败的错误:请参阅此处的示例应用程序:http: //ocpsoft.org/wp-content/uploads/2013/08/pretty-prime-post-mobile .tar.gz?0decbc - 如您所见。应用程序导航成功地适用于非移动标签,但使用 prime-faces 移动标签,导航失败。我已将此问题通知了 primefaces 开发人员。

于 2013-08-10T15:13:57.123 回答