Page 1 of 1
p:menuitem navigation is not working in internet explorer
Posted: 30 May 2010, 07:24
by imby
I am working with <p:menubar/> and i am using primefaces-2.0.2-SNAPSHOT.jar
When "Logout" menuitem is clicked action is working, but navigation is not happening?
This happening in IntenetExplorer 6 and working properly in Firefox
The following are the code snippet
Menu.xhtml
----------
Code: Select all
<h:panelGrid id="menu" cellspacing="0" cellpadding="0" style="width: 100%">
<p:menubar effect="NONE" rendered="#{ValidationBean.rendered}" style="width: 100%">
<p:submenu label="Menu">
<p:menuitem value="ScreenCapture" url="#{request.contextPath}/contents/controls.jsf"></p:menuitem>
</p:submenu>
<p:submenu>
<f:facet name="label">
<p:menuitem value="Logout" action="#{ValidationBean.logout}" ajax="false" />
</f:facet>
</p:submenu>
</p:menubar>
</h:panelGrid>
BeanClass
----------
Code: Select all
public String logout() {
HttpSession session = (HttpSession) FacesContext.getCurrentInstance()
.getExternalContext().getSession(false);
if (session != null) {
session.invalidate();
}
rendered = false;
return "success";
}
faces-config.xml
-----------------
Code: Select all
<navigation-rule>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/contents/home.jsf</to-view-id>
</navigation-case>
</navigation-rule>
Any idea would be appreciated
Re: p:menuitem navigation is not working in internet explorer
Posted: 30 May 2010, 17:37
by cagatay.civici
Hi,
Are you sure your logout method is called with IE? Can you make sure of that?
Re: p:menuitem navigation is not working in internet explorer
Posted: 02 Jun 2010, 19:49
by imby
After changing
<p:menuitem value="Logout" action="#{ValidationBean.logout}" ajax="false" />
to
<p:menuitem value="Logout" action="#{ValidationBean.logout}" />
Working on IntenetExplorer 6 after removing ajax="false", otherwise not working
Re: p:menuitem navigation is not working in internet explorer
Posted: 04 Jun 2010, 10:52
by cagatay.civici
Just to get more information, have you tried with IE7 and IE8 or is it just IE6 related.
Re: p:menuitem navigation is not working in internet explore
Posted: 14 Feb 2011, 18:57
by jlourenco
Greetings,
I'm working with Primefaces since JSF2.0 was released (along with Glassfish v3 as the first JEE 6 Application Server).
I've worked with other vendors like MyFaces, Icefaces, Richfaces, etc.
As Team Leader, I´m able to choose wich JSF Component Vendor to work with and my choice was obvious: Primefaces!
Apart from other components our project has the following technology: JEE5 (WebLogic 10.3), JSF 1.2 (Primefaces 1.1).
We are having a similar behavior: MenuItem is not working as expected in IE 6. With IE 7 and 8, and Firefox it works perfectly.
index.xhtml
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui">
<head>
<title>INDEX</title>
<p:resources />
</head>
<body>
<h:form>
<p:menubar autoSubmenuDisplay="true">
<p:submenu label="test">
<p:menuitem value="page" action="#{index.getPage}" ajax="false"/>
</p:submenu>
</p:menubar>
</h:form>
</body>
</html>
faces-config.xml
Code: Select all
<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
<navigation-rule>
<from-view-id>/index.xhtml</from-view-id>
<navigation-case>
<from-outcome>case1</from-outcome>
<to-view-id>/page.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<managed-bean>
<managed-bean-name>index</managed-bean-name>
<managed-bean-class>pt.ptp.teste_menu.indexController</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>page</managed-bean-name>
<managed-bean-class>pt.ptp.teste_menu.pageController</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/page.xhtml</from-view-id>
<navigation-case>
<from-outcome>case1</from-outcome>
<to-view-id>/index.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
web.xml
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>TESTE_MENU</display-name>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/primefaces_resource/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>primefaces.skin</param-name>
<param-value>none</param-value>
</context-param>
</web-app>
page.xhtml
Code: Select all
<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
<title>PAGE</title>
<p:resources />
</head>
<body>
<h:form>
<p:menubar autoSubmenuDisplay="true">
<p:submenu label="test">
<p:menuitem value="index" action="#{page.getIndex}" ajax="false"/>
</p:submenu>
</p:menubar>
</h:form>
</body>
</html>
pageController
Code: Select all
package pt.ptp.teste_menu;
/**
*
* @author xkep005
*/
public class pageController {
public pageController() {
System.out.println("PageController");
}
public String getIndex() {
return "case1";
}
}
indexController
Code: Select all
package pt.ptp.teste_menu;
/**
*
* @author xkep005
*/
public class indexController {
/**
* @return the page
*/
public indexController(){
System.out.println("IndexController");
}
public String getPage() {
System.out.println("getPage");
return "case1";
}
}
I can provide you with the full maven project, if that helps.
Can you give us some help here please?
BR,
JL
Re: p:menuitem navigation is not working in internet explore
Posted: 30 Jan 2012, 15:42
by jimarmol
I have the same problem, have you found any solution for this?
Re: p:menuitem navigation is not working in internet explore
Posted: 03 Mar 2014, 15:15
by clement
Problem still exist in 2014 with PrimeFaces 4.0 and ie9.
Any solution or workaround?
Thanks.
Re: p:menuitem navigation is not working in internet explore
Posted: 03 Mar 2014, 16:15
by andyba
clement wrote:Problem still exist in 2014 with PrimeFaces 4.0 and ie9.
Any solution or workaround?
Thanks.
Can you not resurrect dead Threads please. Refer to the Forum Rules if in doubt (follow the first link at the bottom of my post).
If this really is an issue then create a new Thread. I would also urge people to provide code that can be used to reproduce the issue.
Currently I have not experienced any issues with IE 9 and PrimeFaces when things are done correctly.
As you have not provided any code we cannot say this with any certainty.
Re: p:menuitem navigation is not working in internet explore
Posted: 03 Mar 2014, 16:27
by clement
ok, i will create the same post with similary code -->
http://forum.primefaces.org/viewtopic.p ... 0&p=116759
Thanks.