p:menuitem navigation is not working in internet explorer

UI Components for JSF
Post Reply
imby
Posts: 9
Joined: 29 May 2010, 21:20

30 May 2010, 07:24

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

cagatay.civici
Prime
Posts: 17987
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

30 May 2010, 17:37

Hi,

Are you sure your logout method is called with IE? Can you make sure of that?

imby
Posts: 9
Joined: 29 May 2010, 21:20

02 Jun 2010, 19:49

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

cagatay.civici
Prime
Posts: 17987
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

04 Jun 2010, 10:52

Just to get more information, have you tried with IE7 and IE8 or is it just IE6 related.

jlourenco
Posts: 2
Joined: 14 Feb 2011, 13:52

14 Feb 2011, 18:57

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

jimarmol
Posts: 5
Joined: 30 Jan 2012, 15:40

30 Jan 2012, 15:42

I have the same problem, have you found any solution for this?
primefaces 5.1
wildfly 8.1

clement
Posts: 25
Joined: 27 Feb 2014, 12:32

03 Mar 2014, 15:15

Problem still exist in 2014 with PrimeFaces 4.0 and ie9.

Any solution or workaround?

Thanks.
--
Clément

Primefaces 6.0
Primefaces Extension 6.0.0
JSF 2.2.13
JBoss 7.1.3

User avatar
andyba
Expert Member
Posts: 2475
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

03 Mar 2014, 16:15

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.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

clement
Posts: 25
Joined: 27 Feb 2014, 12:32

03 Mar 2014, 16:27

ok, i will create the same post with similary code --> http://forum.primefaces.org/viewtopic.p ... 0&p=116759

Thanks.
--
Clément

Primefaces 6.0
Primefaces Extension 6.0.0
JSF 2.2.13
JBoss 7.1.3

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests