Re: menu highlight
Posted: 29 Jun 2017, 07:53
I couldn't replicate this issue. Which Ultima version are you using?
wandyer wrote: ↑27 Jun 2017, 05:32The line:aragorn wrote: ↑13 Jun 2017, 10:18Could you please try the following code?//menu.xhtmlCode: Select all
<script type="text/javascript"> //<![CDATA[ $(document).ready(function() { var $this = PF('me'); if($this) { var pathname = window.location.pathname; if(pathname.indexOf('.xhtml') > 0) { var activeLink = $this.menulinks.filter('[href^="' + pathname + '"]'); $this.expandedMenuitems = []; $this.clearMenuState(); var item = activeLink.parent('li'); $this.addMenuitem(item.attr('id')); addParentItems($this, item); rc(); } } }); function addParentItems($this, item) { if(item && item.length) { var parent = item.parents('li:first'); $this.addMenuitem(parent.attr('id')); if(!parent.parent('ul').hasClass('ultima-menu')) { addParentItems($this, parent); } else { return; } } return; } //]]> </script>
Code: Select all
<h:form id="menuform"> .... <p:remoteCommand name="rc" update="menuform:menu" /> <pu:menu id="menu" widgetVar="me"> ..
makes any top-bar item stop working for me, including the main menu button.Code: Select all
rc();
If I remove that line, they start working again but the menus are not highlighted anymore when I open the page from a URL.
My menu.xhtml:Code: Select all
... <p:remoteCommand name="rc" update="menuform:menu" /> <pu:menu id="menu" widgetVar="me" model="#{menuView.model}" /> ...
sistemaslume wrote: ↑20 Nov 2017, 15:31Hi, we use version 1.0.5 and have the same problem reported by wandyer
Any sugestions??
wandyer wrote: ↑27 Jun 2017, 05:32The line:aragorn wrote: ↑13 Jun 2017, 10:18Could you please try the following code?//menu.xhtmlCode: Select all
<script type="text/javascript"> //<![CDATA[ $(document).ready(function() { var $this = PF('me'); if($this) { var pathname = window.location.pathname; if(pathname.indexOf('.xhtml') > 0) { var activeLink = $this.menulinks.filter('[href^="' + pathname + '"]'); $this.expandedMenuitems = []; $this.clearMenuState(); var item = activeLink.parent('li'); $this.addMenuitem(item.attr('id')); addParentItems($this, item); rc(); } } }); function addParentItems($this, item) { if(item && item.length) { var parent = item.parents('li:first'); $this.addMenuitem(parent.attr('id')); if(!parent.parent('ul').hasClass('ultima-menu')) { addParentItems($this, parent); } else { return; } } return; } //]]> </script>
Code: Select all
<h:form id="menuform"> .... <p:remoteCommand name="rc" update="menuform:menu" /> <pu:menu id="menu" widgetVar="me"> ..
makes any top-bar item stop working for me, including the main menu button.Code: Select all
rc();
If I remove that line, they start working again but the menus are not highlighted anymore when I open the page from a URL.
My menu.xhtml:Code: Select all
... <p:remoteCommand name="rc" update="menuform:menu" /> <pu:menu id="menu" widgetVar="me" model="#{menuView.model}" /> ...
Code: Select all
<p:remoteCommand name="rc" update="menu" ignoreAutoUpdate="true"/>