-1

I am doing mobile conversion of our website using PF mobile. In that I am trying to open views in a dialog using Primefaces mobile. It works just fine in desktop browser but not in mobile version. The page keeps waiting to load but nothing happens. Is it not implemented in PF mobile or is something wrong with my code?

Following is the view - 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>

Following is the code from the backing bean.

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

Also basic dialog like the following that displays only a message doesnt work either in mobile pages. It works in desktop though.

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

face-config.xml has the following:

<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>

I can absolutely add more information if needed. Any help here is much appreciated. Thank you in advance.

Here is my platform information: - Tomee 7.0.0 M3 - Primefaces 6.0 - Jsf 2.2.12 - Jdk 1.7 - Jee 7

Jude
  • 7
  • 3
  • Can you add version info? – Kukeltje Aug 06 '16 at 09:13
  • @Kukeltje Here is my platform information:Tomee 7.0.0 M3, Primefaces 6.0, Jsf 2.2.12, Jdk 1.7, Jee 7. I have updated the question also. Appreciate your inputs. Thank you. – Jude Aug 08 '16 at 19:55

1 Answers1

0

Working solution:

bean:

...
RequestContext.getCurrentInstance().execute("PF('dlgDelete').show();");

xhtml:

...
<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>

user3158918
  • 121
  • 1
  • 5