Using <h:form> at template and topBar pages

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
quevaig
Posts: 7
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" />
.
.
.

mert.sincan
Posts: 5281
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: 7
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

mert.sincan
Posts: 5281
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: 7
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?

mert.sincan
Posts: 5281
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]);
        ....

Dsleeper
Posts: 119
Joined: 29 Jul 2010, 13:33
Location: Bergen, Norway
Contact:

25 Mar 2019, 17:45

I am also using spring-boot and the changes from aragorn fixes the issue for me. Make sure you do a hard refresh of your browser cache to see if that might be the issue. I.e that your browser has the old layout.js still running
Primefaces, Mojarra, Tomcat

http://www.dsleeper.net
https://www.mylog.no

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

26 Mar 2019, 09:12

Hi @Dsleeper,

Glad to hear, thanks a lot for the update!

Best Regards,

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

16 Apr 2019, 10:55

Dsleeper wrote:
25 Mar 2019, 17:45
I am also using spring-boot and the changes from aragorn fixes the issue for me. Make sure you do a hard refresh of your browser cache to see if that might be the issue. I.e that your browser has the old layout.js still running

I did "hard refresh" how you told and now works fine. Thanks!!!

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

17 Apr 2019, 08:16

Glad to hear, thanks a lot for the update!

Best Regards,

Post Reply

Return to “Roma - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests