Using <h:form> at template and topBar pages

Post Reply
quevaig
Posts: 3
Joined: 07 Nov 2018, 10:46

11 Mar 2019, 10:46

Hello.

In the template page or in topBar I need to put a form tag "<h:form>" for using an action tag at topBar page. The problem is that after doing it, (burger menu) stop working.


This is the code at template page: (I´ve tried to put this form on the topbar page but it didn´t work too).

<h:body>
<div class="layout-wrapper #{guestPreferences.menuMode} #{guestPreferences.menuColor} #{guestPreferences.topBarColor}">
<h:form id="formulariTopbar">
<ui:include src="./topbar.xhtml"></ui:include>
</h:form>
<ui:include src="./menu.xhtml"></ui:include>
<ui:include src="./right-panel.xhtml" />
.
.
.

User avatar
aragorn
Posts: 3429
Joined: 29 Jun 2013, 12:38

11 Mar 2019, 15:55

Fixed now. Please change the following lines in layout.js;

Code: Select all

init: function(cfg) {
        this._super(cfg);
        this.wrapper = $(document.body).children('.layout-wrapper');
        this.topbar = this.wrapper.find('.layout-topbar');
        this.menuButton = this.topbar.find('.layout-menu-button');
        this.menuContainer = this.wrapper.find('.layout-menu-container');
        ...

quevaig
Posts: 3
Joined: 07 Nov 2018, 10:46

13 Mar 2019, 19:24

I've changed the lines that you told but It didn't work.
Still the same problem

User avatar
aragorn
Posts: 3429
Joined: 29 Jun 2013, 12:38

15 Mar 2019, 09:27

Interesting! The above code works fine for me with the changes that you make in template. Please try with our sample project after adding the above js changes into layout.js.

Or Please attach your layout.js. Also, do you get a js error on console?

Best Regards,

quevaig
Posts: 3
Joined: 07 Nov 2018, 10:46

18 Mar 2019, 12:23

I've tried with your sample project after adding the above js changes into layout.js and works fine.
But in my project doesn't work.
I'm using Spring Boot with jsf. The folder structure is different.
In your sample project is: src/main/webapp
in my project is: src/main/resources/META-INF/resources.
maybe the problem is here?

User avatar
aragorn
Posts: 3429
Joined: 29 Jun 2013, 12:38

20 Mar 2019, 14:09

I'm not sure. Could you please add a console.log to init method in layout.js? Then, could you please attach the console results ?

Code: Select all

init: function(cfg) {
        this._super(cfg);
        this.wrapper = $(document.body).children('.layout-wrapper');
        this.topbar = this.wrapper.find('.layout-topbar');
        this.menuButton = this.topbar.find('.layout-menu-button');
        this.menuContainer = this.wrapper.find('.layout-menu-container');
        this.menu = this.jq;
        this.menulinks = this.menu.find('a');
        this.nanoContainer = this.menuContainer.find('.nano');
        this.nanoScrollContent = this.nanoContainer.children('.nano-content');
        this.expandedMenuitems = this.expandedMenuitems||[];
        
        console.log("***********************");
        console.log(this.topbar[0]);
        console.log(this.menuButton[0]);
        console.log(this.menuContainer[0]);
        ....

Post Reply

Return to “Roma - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest