How can I use PrimeFaces Mobile properly

UI Components for JSF
Post Reply
scharlih
Posts: 1
Joined: 17 Mar 2014, 14:48

17 Mar 2014, 15:30

Hi all,

I'm trying to create a mobile version of a web application. I'm using the following versions of PF:
primefaces-4.0.jar
primefaces-mobile-1.0-20130917.203632-1.jar

with myfaces 2.1.14

Unfortunately, some things do not work properly or I get no satisfying informations:
- growl is not working (neither on update nor with autoUpdate)
- the calendar is not working: JS error:
Uncaught TypeError: Object [object Object] has no method 'mobiscroll' primefaces-mobile.js.jsf?ln=primefaces-mobile&v=1.0-SNAPSHOT:1
PrimeFaces.widget.Calendar.PrimeFaces.widget.BaseWidget.extend.init primefaces-mobile.js.jsf?ln=primefaces-mobile&v=1.0-SNAPSHOT:1
prototype.(anonymous function) core.js.jsf?ln=primefaces&v=4.0:1
Class core.js.jsf?ln=primefaces&v=4.0:1
PrimeFaces.createWidget core.js.jsf?ln=primefaces&v=4.0:1
PrimeFaces.cw core.js.jsf?ln=primefaces&v=4.0:1
(anonymous function) main_mobile.jsf:49
b3 jquery.js.jsf?ln=primefaces&v=4.0:25
cb.fireWith jquery.js.jsf?ln=primefaces&v=4.0:25
bI.extend.ready jquery.js.jsf?ln=primefaces&v=4.0:14
bW

- There are no example codes for the PF mobile 1.0 snapshot showcase
- How can I get this mystic PFM 5.0?
- and some more...

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	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:t="http://myfaces.apache.org/tomahawk"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pm="http://primefaces.org/mobile" contentType="text/html"
	renderKitId="PRIMEFACES_MOBILE">
	
	<pm:page id="page" title="title">

		<pm:header title="header" />
		<h:body>
			<h:form id="form">
				<p:growl id="growl" autoUpdate="true" />
				<p:commandButton value="test" update="growl" action="#{testBean.testMethod }" />				
				<p:calendar value="#{testBean.date}" />
			</h:form>
		</h:body>
	</pm:page>
</f:view>

Code: Select all

@ManagedBean
@ViewScoped
public class TestBean implements Serializable {
    private static final long serialVersionUID = -4408360089443835102L;
    private Date date;

    public Date getDate() {
	if (date == null) {
	    setDate(new Date());
	}
	return new Date();
    }

    public void setDate(Date date) {
	this.date = date;
    }

    public void testMethod() {
	FacesContext context = FacesContext.getCurrentInstance();
	context.addMessage(null, new FacesMessage("Successful", "Hello "));
    }
}
At the end, what can I do to get a reliable framework for my mobile application? Should I become a ELITE user and everything is working fine?

I have worked with PrimeFaces (regular version) several times, yet and everything was fine, but in the mobile version, one Problem leads to another.

Thank you for your answer!

Best regards
Stefan

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 35 guests