Page 1 of 1

Update breaks icarus sub menu

Posted: 15 Nov 2016, 12:05
by vit.hlavacek
I have a problem with icarus template menu

Whenever i try to update element around icarus menu (form) it removes events on sub menus, so they cannot be closed or opened.

example code. After pressing test button menu stops working.

Code: Select all

<h:form id="menuform">
  <pi:menu widgetVar="appMenu">
    <p:submenu label="Tasks" icon="fa fa-tasks" >
      <p:menuitem value="Active" icon="fa fa-tasks" />
  <p:commandButton value="test" update="menuform"></p:commandButton>
I fixed it by changing layout.js bindEvents to

Code: Select all

bindEvents: function() {        
        var $this = this;
        this.sidebarNav.nanoScroller({flash: true});
        this.slimToggleButton.on('click', function(e) {
        //TODO find a better way to allow update
        this.menulinks = $('a.menuLink');
        this.menulinks.on('click',function(e) {
I know its not the right way to fix it, but this is working for me, at least for now.

Re: Update breaks icarus sub menu

Posted: 25 Nov 2016, 10:35
by aragorn