From <menu.xhtml, I changed the menu to : <pu:menu widgetVar="module" model="#{sideMenuModel.model}"/> (org.primefaces.model.menu.MenuModel)
My menu model has Submenus having items (dynamically created in java).
The problem is with the current item highlited after having select one : somteimes it' OK (the selmected item is the one hihlited), sometimes (very often indeed) another item is higlited instead of the current selected one.
You will find below a small video showing that ( perahaps better than a long pdf ...)
http://37.187.93.92/pbMenu.webm
I think I miss something that will be evident to you !!
Kindest regards
Philippe
Strange menu behavior (solved)
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
For stateful feature on menu, all menuitems and submenuitems need to have different ids in model. Please check it. Then, please clear browser cache and try again.
Github Profile: https://github.com/mertsincan
Hi Aragorn?.
*
I am currently using the DynamicMenuModel.generateUniqueIds() at the end of menuModel creation.
I check with the debugger to have a look on the model, all seems fine :
level1 item have ids 1,2,3,4,,...
and sub menu items : 1_0, 1_1,...
and for the Missions subMenu (3), items are 3_1,3_2,3_3 and their children 3_1_1, 3_1_1, and so on ...
One thing I have noticed :
- Each time I log out and log in (so the menu model is recreated) the menu item highlighted is the last one highlighted before login out and in (even if the main page is the dashboard k)
- If I close the browser, reopen it, log in : the menu is collapsed : ok
- open a submenu, click on one item : The main changes (ok) but the menu collapses alone(always reproduce)
- If I do the same thing a second time (re open the submenu, click on one item) , then it is ok, the submenu stays expanded and the menu Item highlighted.
Kindest regards and again thanks for your help
Philippe
*
I am currently using the DynamicMenuModel.generateUniqueIds() at the end of menuModel creation.
I check with the debugger to have a look on the model, all seems fine :
level1 item have ids 1,2,3,4,,...
and sub menu items : 1_0, 1_1,...
and for the Missions subMenu (3), items are 3_1,3_2,3_3 and their children 3_1_1, 3_1_1, and so on ...
One thing I have noticed :
- Each time I log out and log in (so the menu model is recreated) the menu item highlighted is the last one highlighted before login out and in (even if the main page is the dashboard k)
- If I close the browser, reopen it, log in : the menu is collapsed : ok
- open a submenu, click on one item : The main changes (ok) but the menu collapses alone(always reproduce)
- If I do the same thing a second time (re open the submenu, click on one item) , then it is ok, the submenu stays expanded and the menu Item highlighted.
Kindest regards and again thanks for your help
Philippe
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
You can try to call PF('mainmenu').clearMenuState() after clicking logout button/link;
in topbar.xhtml
More information is at;
https://www.beyondjava.net/blog/jsf-2-2 ... eat-sheet/
http://www.oracle.com/technetwork/artic ... 27136.html
Code: Select all
<pu:menu widgetVar="mainmenu">
...
</pu:menu>
Code: Select all
..
xmlns:p="http://primefaces.org/ui"
xmlns:jsf="http://xmlns.jcp.org/jsf">
...
<li role="menuitem">
<a href="#" jsf:action="#{bean.logout}">
<i class="material-icons"></i>
<span>Logout</span>
</a>
</li>
...
https://www.beyondjava.net/blog/jsf-2-2 ... eat-sheet/
http://www.oracle.com/technetwork/artic ... 27136.html
Github Profile: https://github.com/mertsincan
Thanks, it works for the logout/login case.
But I still have the original problem (http://37.187.93.92/pbMenu.webm). Any other so good idea for that !
kindest regards
Philippe
But I still have the original problem (http://37.187.93.92/pbMenu.webm). Any other so good idea for that !
kindest regards
Philippe
Another idea that perhaps may help ... :
The first time I expand a DefaultSubMenu and then select an item, the menu get collapsed (the opened defaultSubMenu gets collapsed) . The seond time it stays open
Hope this may help.
Just tell me if yo need the code ...
The first time I expand a DefaultSubMenu and then select an item, the menu get collapsed (the opened defaultSubMenu gets collapsed) . The seond time it stays open
Hope this may help.
Just tell me if yo need the code ...
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Glad to hear, thanks a lot for the update!
Github Profile: https://github.com/mertsincan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 2 guests