PrimeNG menu item problems.

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
paul.d.carlson
Posts: 33
Joined: 01 Oct 2016, 02:08

04 Oct 2016, 21:40

So -

I've downloaded and have the Ultima Theme working with PrimeNG Beta 17 components in our application - looks fantastic! But, I have a problem with menu items not activating in some cases.

I have two main components - a login component and a dashboard component. The first time a user logs in, everything seems to work fine. The second time the same users logs in, the menu items (specifically the top bar menu items) do not activate. If I click refresh, then everything is fine again until I log out.

On my dashboard component, I am calling:

ngAfterViewInit()
{
console.log("ngAfterViewInit called");
Ultima.init(this.el.nativeElement);
}

My gut tells me that the Ultima object doesn't like being re-initialized once it has been initialized, but perhaps there is something else going on. Any ideas? Is there anything I need to do in ngOnDestroy to clean up Ultima?

Thanks!
Paul

paul.d.carlson
Posts: 33
Joined: 01 Oct 2016, 02:08

04 Oct 2016, 23:20

Incidentally, I was able to work around this by doing the following when the user logs out:

(from my logout component)

public ngOnDestroy() : void
{
this.zone.runOutsideAngular(() => { location.reload(); });
}

This allowed me to work around the problem. But, I would like to know if there is a better way than this as I don't want to force reloads of my single page application!!

Thanks much everyone!
Paul

paul.d.carlson
Posts: 33
Joined: 01 Oct 2016, 02:08

05 Oct 2016, 13:41

I was able to reproduce this problem by:

Ultima.init(this.el.nativeElement);
Ultima.init(this.el.nativeElement);

Then, click on top-level menu items (like the gear). No response.

As Angular is a SPA framework, these Java script functions are going to get called multiple times without page reloads. I would consider this a defect. Please let me know if you guys feel differently or if there is something else I should be doing.

Thanks much!
Paul

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

06 Oct 2016, 00:06

We're working on this for next maintenance release. There is also the idea to make the menu as an Angular 2 component which eliminates the Ultima object altogether.

paul.d.carlson
Posts: 33
Joined: 01 Oct 2016, 02:08

06 Oct 2016, 03:27

That would be awesome - thanks much for the reply!

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

06 Oct 2016, 18:33

The issue is fixed in 1.0.2;

http://blog.primefaces.org/?p=4133

Post Reply

Return to “Ultima - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests