Primefaces PanelMenu accordion behavior
-
- Posts: 80
- Joined: 23 Nov 2011, 08:46
hi tlog, I got a panel menu working 100% in Primefaces 5.3.
Primefaces 5.3, Extensions 4.0.0
Glassfish 3.1.2.2, Wildfly-10.0.0.Final
JSF 2.2
Glassfish 3.1.2.2, Wildfly-10.0.0.Final
JSF 2.2
-
- Posts: 80
- Joined: 23 Nov 2011, 08:46
I'm experiencing the same problem trying to upgrade our application from 5.3 to 6.0.
Is there a way to implement this in a way that the panelMenu's "accordion behaviour" will not break with every new release?
Is there a way to implement this in a way that the panelMenu's "accordion behaviour" will not break with every new release?
Primefaces 5.3, Extensions 4.0.0
Glassfish 3.1.2.2, Wildfly-10.0.0.Final
JSF 2.2
Glassfish 3.1.2.2, Wildfly-10.0.0.Final
JSF 2.2
-
- Posts: 80
- Joined: 23 Nov 2011, 08:46
Hi Kukeltje,
Thank you for your response.
What do you mean with "Good Pull Request"?
Thank you for your response.
What do you mean with "Good Pull Request"?
Primefaces 5.3, Extensions 4.0.0
Glassfish 3.1.2.2, Wildfly-10.0.0.Final
JSF 2.2
Glassfish 3.1.2.2, Wildfly-10.0.0.Final
JSF 2.2
-
- Posts: 80
- Joined: 23 Nov 2011, 08:46
I migrated our application from 5.3 to 6.2 and was able to resolve the JavaScript error by encompassing it with the JQuery "$(document).ready.." tags:
Code that broke:
Fixed it with:
Code that broke:
Code: Select all
PF('hbPanelMenu').headers.click(function() {
var currHeader = $(this);
PF('hbPanelMenu').headers.each(function() {
var header = $(this);
if (header.text() !== currHeader.text()) {
PF('hbPanelMenu').collapseRootSubmenu(header);
header.removeClass('ui-state-hover');
}
});
});
Code: Select all
$(document).ready(function () {
/*
* Function adds accordion behaviour to the PrimeFaces PanelMenu:
* It collapses other menu headers on the selection of a menu header
* */
PF('hbPanelMenu').headers.click(function() {
var currHeader = $(this);
PF('hbPanelMenu').headers.each(function() {
var header = $(this);
if (header.text() !== currHeader.text()) {
PF('hbPanelMenu').collapseRootSubmenu(header);
header.removeClass('ui-state-hover');
}
});
});
});
Primefaces 5.3, Extensions 4.0.0
Glassfish 3.1.2.2, Wildfly-10.0.0.Final
JSF 2.2
Glassfish 3.1.2.2, Wildfly-10.0.0.Final
JSF 2.2
-
- Information
-
Who is online
Users browsing this forum: No registered users and 45 guests