MenuButton Not Working IE8

UI Components for JSF
Post Reply
cmpa.prime
Posts: 34
Joined: 12 Jan 2012, 17:44

28 Mar 2012, 21:47

When I go to the following link in the showcase (using IE8), the menubutton works perfectly:

http://www.primefaces.org/showcase/ui/menubutton.jsf

However when I take the code shown in that particular example and put it on my xhtml page it doesn't work....the menu portion doesn't show up and instead the IE 'info bar' (where it normally alerts you regarding JavaScript errors) says something to the effect of:

"(2 items remaining) Downloading picture _http://localhost......../javax.faces.resource/images/ui-bg_glass......

Code: Select all

<h:form>
	<p:growl id="messages"/>
	
	<p:menuButton value="Options">
		<p:menuitem value="Save" update="messages" actionListener="#{buttonBean.save}" icon="ui-icon-disk"/>
		<p:menuitem value="Update" update="messages" actionListener="#{buttonBean.update}" icon="ui-icon-arrowrefresh-1-w"/>
		<p:menuitem value="Delete" icon="ui-icon-close" actionListener="#{buttonBean.delete}" ajax="false"/>
        <p:separator />
		<p:menuitem value="Homepage" url="http://www.primefaces.org" icon="ui-icon-extlink"/>
	</p:menuButton>
</h:form>

If anyone has any thoughts it would be much appreciated.

Thanks !
PrimeFaces 3.2 Final, Java EE 6, NetBeans 7.0.1, Mojarra 2.1.6 (JSF 2.1), Apache Tomcat - 7.0.20

cmpa.prime
Posts: 34
Joined: 12 Jan 2012, 17:44

29 Mar 2012, 16:26

Before the upgrade to Primefaces 3.2 we were able to fix the issue using some JQuery, however it no longer works:

Code: Select all

function setMenuButtonClickEvent() {
	if (jQuery.browser.msie) {
		jQuery("#logoutForm\\:welcomeMenuButton_button").bind('click',
			function() {
				var currentVal = jQuery("#logoutForm\\:welcomeMenuButton_menu").css("display");
				if (currentVal == "block") {
					jQuery("#logoutForm\\:welcomeMenuButton_menu").css("display", "none");
				} else {
					jQuery("#logoutForm\\:welcomeMenuButton_menu").css("display", "block");
				}
			});
	}
}
Before the upgrade to Primefaces 3.2 we were able to fix the issue using some JQuery:Before the upgrade to Primefaces 3.2 we were able to fix the issue using some JQuery:




Ideally we'd like to be able to use the component as shown out of the box. Given that it works in IE in the showcase there must be something we're doing in our code that causes it to fail. Our .xhtml file is as follows:

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">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:p="http://primefaces.org/ui"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:ui="http://java.sun.com/jsf/facelets">
    <f:view>
            <ui:composition id="headerPanel">
				<p:graphicImage id="workspaceHeaderImage" style="margin: 4px 4px 4px 10px;"  value="#{resource['images/efmLogo.png']}" />
				<h4 id="workspaceHeaderText" class="page-header-text">
					<h:form id="logoutForm" >
						<p:menuButton id="welcomeMenuButton" value="#{msg['ws-page.welcome']} #{userSessionBean.loggedInUser.firstName} #{userSessionBean.loggedInUser.lastName} !" rendered="#{view.viewId == '/ws.xhtml'}">
							<p:menuitem value="#{msg['ws-page.signout']}" actionListener="#{loginBean.logout}" style="display: inline-block !important;"/>
						</p:menuButton>
					</h:form>
				</h4>
			</ui:composition>
    </f:view>
</html>
We have a fairly straightforward implementation but it doesn't want to work in IE for some reason....
PrimeFaces 3.2 Final, Java EE 6, NetBeans 7.0.1, Mojarra 2.1.6 (JSF 2.1), Apache Tomcat - 7.0.20

voltpt
Posts: 1
Joined: 06 Mar 2012, 19:55

18 Apr 2012, 16:27

Hi cmpa.prime,

I have the same problem. You find some solution ?

Thanks!
Carlos

shahbaz
Posts: 1
Joined: 24 Apr 2012, 11:32

24 Apr 2012, 11:36

Hi,
My problem is little bit different. I am using menubutton, its working fine on page A but on page B it don't. If I use above solution then its start working on Page B and on page A menu appears and disappear at same time.

Please let me know the solution of this problem as soon as possible.

Regards

Shahbaz Sajjad

cmpa.prime
Posts: 34
Joined: 12 Jan 2012, 17:44

24 Apr 2012, 14:55

Hey.

We haven't got it working perfect in IE yet. I believe now it shows up if we double click the button. This happened after we switched to Primefaces Extensions Layout.

It's an odd error as it works in the Primefaces Showcase when using IE8.
PrimeFaces 3.2 Final, Java EE 6, NetBeans 7.0.1, Mojarra 2.1.6 (JSF 2.1), Apache Tomcat - 7.0.20

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

24 Apr 2012, 16:48

Funny, I have not had any problems using MenuButton in conjunction with IE8 at all.
Something you are doing wrong which I cannot see is the problem.
Are you including this from inside a form? If that is the case then that could well be your problem.
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

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests