PrimeFaces.widget.Freya initialized - not happening

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
herbarium
Posts: 8
Joined: 18 Mar 2018, 03:20

15 Jun 2023, 02:07

I have a Quarkus + Primefaces web app. The theme (using the dark one) is loaded and all the components (except of vertical spinner) are looking great. But it looks like there is some problem with the layout.js initialization.

I can see this line (17) in the freya-layout/layout.js:

Code: Select all

console.log('PrimeFaces.widget.Freya initialized');
However, I don't see corresponding log entry in the browser. console.
Also, functionality that requires this JS initialization doesn't work. For example, I copied the html for the toolbar search field and user/avatar menu from the Freya demo, but it's not working (nothing happens when i click on it).

I can see the layout.js loaded in the Network browser dev tools tab. How to make sure/verify it is properly initialized?

herbarium
Posts: 8
Joined: 18 Mar 2018, 03:20

22 Jun 2023, 06:50

I have some WIP project that uses Primefaces & Freya online: https://dev.collarclubvernon.ca - use Google login or special credentials I created (freya:prime)

Feel free to use this app to reproduce. It's also super easy for me to change anything and re-deploy, just let me know what I can do to help to resolve it.
Last edited by herbarium on 22 Jun 2023, 21:22, edited 1 time in total.

olgubasak
Posts: 98
Joined: 05 Jan 2023, 11:05

22 Jun 2023, 11:30

Hi,

I have installed the Freya template in my own development environment, but I didn't encounter the warning you mentioned. Since I'm not using Quarkus and I didn't receive the same warning, it might be specific to Quarkus. Therefore, I recommend that you perform the relevant checks related to Quarkus.

Best Regards,

herbarium
Posts: 8
Joined: 18 Mar 2018, 03:20

22 Jun 2023, 15:15

Hi,

I didn't say there is a warning, it just doesn't work (because Freya's layout.js is not initialized, looks like). The project has the same structure as @melloware quarkus-faces project + added Freya, and everything except of Freya's JavaScript works as expected.

Here is what I can see:

I added the same kind of log to the quarkus-faces showcase/layout.js initialization, here is how it looks:

Code: Select all

App = {
    init: function() {
        this.wrapper = $(document.body).children('.layout-wrapper');
        this.topbar = this.wrapper.children('.layout-topbar');
        this.topbarMenu = this.topbar.find('> form > .topbar-menu');
        this.sidebar = this.wrapper.children('.layout-sidebar');
        this.menu = this.sidebar.children('.layout-menu');
        this.menuLinks = this.menu.find('a');
        this.mask = this.wrapper.children('.layout-mask');
        this.menuButton = this.topbar.children('.menu-button');
        this.configurator = this.wrapper.children('.layout-config');
        this.configuratorButton = $('#layout-config-button');
        this.configuratorCloseButton = $('#layout-config-close-button');
        this.filterPanel = $('.layout-sidebar-filter-panel');
        this.activeSubmenus = [];
        
        this._bindEvents();
        this.restoreMenu();
        $(document).ready(function() {
            document.getElementsByTagName("html")[0].style.visibility = "visible";
        });

        console.log('PrimeFaces.showcase.layout.js initialized');
    }
I can see this log entry in the Chrome inspector console and everything javascript related is working as expected.

Here is Freya current initialization which is not called (and I don't see the log in the console), so nothing js related is working:

Code: Select all

PrimeFaces.widget.Freya = PrimeFaces.widget.BaseWidget.extend({

    init: function(cfg) {
        this._super(cfg);
        this.wrapper = $(document.body).children('.layout-wrapper');
        var $this = this;

        $(function() {
            $this._init();
        });

        this.restoreMenuState();
        this.expandedMenuitems = this.expandedMenuitems||[];
        console.log('PrimeFaces.widget.Freya initialized');
    },
Obviously, there are some differences, but I'm not sure what to make out of this information... I'm stuck because I want to put hamburger in the topbar and it relies on layout.js as well most likely.

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

23 Jun 2023, 19:16

I think I answered that here already: https://github.com/melloware/quarkus-faces/issues/274
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

olgubasak
Posts: 98
Joined: 05 Jan 2023, 11:05

26 Jun 2023, 12:11

Hi Melloware,

Thank you for your support.

Best Regards,

Post Reply

Return to “Freya - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest