there's a really strange behaviour with Primefaces Mobile an JSF selectOneMenu.
Simple example:
First Page: link to second.jsf
Second Page: h:selectOneMenu, data-native-menu=false
If I clikc on the menu a dialog comes up to select a menuitem. Now I click on the close button. Effect: selectOneMenu get's closed and I got redirected to first.jsf
Why is this happening?
I played arround with faces-redirect, but nothing helped...
Has anyone a solution for this problem?
Thanks in advance
Sebastian
Environment: Primefaces 3.0M3-SNAPSHOT, JSF 2.0, Tomcat 7
Example-Pages (deploy, open first.xhtml, click button, open selectOneMenu and close it via button in rop right corner):
first.xhtml
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!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:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:pm="http://primefaces.prime.com.tr/mobile"
contentType="text/html">
<pm:page title="first" id="page">
<h:head>
</h:head>
<pm:view id="main" swatch="d">
<pm:content>
<h:form id="formOne" prependId="false">
<p:commandButton type="submit" id="findButton"
action="second.jsf?faces-redirect=true" value="Next" />
</h:form>
</pm:content>
</pm:view>
</pm:page>
</f:view>
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!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:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:pm="http://primefaces.prime.com.tr/mobile"
contentType="text/html">
<pm:page title="second" id="page">
<h:head>
</h:head>
<pm:view id="main" swatch="d">
<pm:content>
<h:form id="formOne" prependId="true">
<pm:field>
<h:selectOneMenu id="selMenu" required="true">
<f:selectItem itemValue="1" itemLabel="1" />
<f:selectItem itemValue="3" itemLabel="2" />
<f:selectItem itemValue="22" itemLabel="3" />
<f:selectItem itemValue="23" itemLabel="4" />
<f:selectItem itemValue="1" itemLabel="1" />
<f:selectItem itemValue="3" itemLabel="2" />
<f:selectItem itemValue="22" itemLabel="3" />
<f:selectItem itemValue="23" itemLabel="4" />
<f:selectItem itemValue="1" itemLabel="1" />
<f:selectItem itemValue="3" itemLabel="2" />
<f:selectItem itemValue="22" itemLabel="3" />
<f:selectItem itemValue="23" itemLabel="4" />
<f:selectItem itemValue="1" itemLabel="1" />
<f:selectItem itemValue="3" itemLabel="2" />
<f:selectItem itemValue="22" itemLabel="3" />
<f:selectItem itemValue="23" itemLabel="4" />
<f:selectItem itemValue="22" itemLabel="3" />
<f:selectItem itemValue="23" itemLabel="4" />
<f:selectItem itemValue="1" itemLabel="1" />
<f:selectItem itemValue="3" itemLabel="2" />
<f:selectItem itemValue="22" itemLabel="3" />
<f:selectItem itemValue="23" itemLabel="4" />
<f:selectItem itemValue="1" itemLabel="1" />
<f:selectItem itemValue="3" itemLabel="2" />
<f:selectItem itemValue="22" itemLabel="3" />
<f:selectItem itemValue="23" itemLabel="4" />
</h:selectOneMenu>
</pm:field>
</h:form>
</pm:content>
<script type="text/javascript">
$(document).ready(function() {
$("select").attr("data-native-menu", "false");
});
</script>
</pm:view>
</pm:page>
</f:view>