在primefaces mobile中显示来自辅助bean的对话框

时间:2016-08-05 20:28:24

标签: jquery-mobile mobile jsf-2 primefaces primefaces-mobile

我正在使用PF mobile进行网站的移动转换。我试图在使用Primefaces mobile的对话框中打开视图。它在桌面浏览器中工作得很好,但在移动版本中却不行。页面一直在等待加载但没有任何反应。它是不是在PF mobile中实现的,还是我的代码有问题?

以下是视图 - webapp / m / dlg / sampledlg.xhtml

<!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 renderKitId="PRIMEFACES_MOBILE" /><h:head></h:head><h:body><pm:page id="main"><pm:header title="Main Page">/pm:header><pm:content><p:link outcome="pm:second" value="Go" /></pm:content></pm:page><pm:page id="second" lazy="true"><pm:header title="Second Page"></pm:header><pm:content>Sample content</pm:content></pm:page></h:body></html>

以下是来自支持bean的代码。

RequestContext.getCurrentInstance().openDialog("dlg/sampledlg");
return;

此外,仅显示消息的基本对话框在移动页面中也不起作用。它可以在桌面上工作。

RequestContext.getCurrentInstance().showMessageInDialog("This is sample text");

face-config.xml具有以下内容:

<navigation-handler>
     org.primefaces.application.DialogNavigationHandler
  </navigation-handler>

  <view-handler>org.primefaces.application.DialogViewHandler</view-handler>

  <navigation-handler>org.primefaces.mobile.application.MobileNavigationHandler</navigation-handler>

如果需要,我绝对可以添加更多信息。这里的任何帮助非常感谢。提前谢谢。

这是我的平台信息:   - Tomee 7.0.0 M3   - Primefaces 6.0   - Jsf 2.2.12   - Jdk 1.7   - Jee 7

1 个答案:

答案 0 :(得分:0)

工作解决方案:

豆:

...
<p:dialog header="confirmation" widgetVar="dlgDelete" >
    <p:outputLabel value="Are you...?"/>
    <p:commandButton value="yes" action="#{appBean.deleteMethod()}" update="tblParts" oncomplete="PF('dlgDelete').hide();" icon="ui-icon-check" iconPos="right" styleClass="ui-btn-inline"/>
    <p:commandButton value="no" onclick="PF('dlgDelete').hide();" icon="ui-icon-forbidden" iconPos="right" styleClass="ui-btn-inline"/>
</p:dialog>

XHTML:

Dictionary<T, T2>

相关问题