Fórum

Primefaces 6.1 dialog on Liferay 7 GA5 issue

thumbnail
William Gosse, modificado 6 Anos atrás.

Primefaces 6.1 dialog on Liferay 7 GA5 issue

Liferay Master Postagens: 533 Data de Entrada: 04/07/10 Postagens Recentes
Ok,I have a data table with a show detail column containing command buttons which pops up a dialog for the specific row clicked. It works fine the first time I go to the page but if I go to a different page and then back to the page with the data table the dialog won't pop until I do a page reload. After I reload the the page the dialog works fine again until I move to a different page and then back. I haven't seen this kind of behavior before on previous releases of Liferay 7. This is my first time using GA5 with Primefaces. I've attached my pom.xml , xhtml file and managed bean file.

Any suggestions would be greatly appreciated. Thanks.
thumbnail
William Gosse, modificado 6 Anos atrás.

RE: Primefaces 6.1 dialog on Liferay 7 GA5 issue (Resposta)

Liferay Master Postagens: 533 Data de Entrada: 04/07/10 Postagens Recentes
Ok, I figured this one out. The issue is was a JQuery conflict. I was using a bit of jQuery in my theme which was conflicting with Primefaces' jQuery. When I removed the jQuery from the theme my problem went away.

I love to to hear any suggestion to best resolve this kind of conflict specifically for Liferay themes. Its kind of a pain. I thought there was a way to do a noConflict in the portlet.
thumbnail
Kyle Joseph Stiemann, modificado 6 Anos atrás.

RE: Primefaces 6.1 dialog on Liferay 7 GA5 issue

Liferay Master Postagens: 760 Data de Entrada: 14/01/13 Postagens Recentes
Hi William,

When I removed the jQuery from the theme my problem went away.

I love to to hear any suggestion to best resolve this kind of conflict specifically for Liferay themes. Its kind of a pain. I thought there was a way to do a noConflict in the portlet.

It seems like removing jQuery from your theme was the best choice in this case. Liferay 7.0 includes jQuery on the page, and PrimeFaces also includes jQuery, so if you also include jQuery in your theme, jQuery will be included three times on the page. Here are three solutions that can fix the many conflicts (and performance issues) that can happen in this situation (ordered from best to worst in my opinion, although there may be aspects that I am missing):
  • Remove jQuery from your theme and use the jQuery version included on every Liferay page instead. If you rely on specific features of jQuery that are provided in more recent versions of jQuery than the Liferay included version, this solution won't work.
  • Rrevent PrimeFaces from loading its included jQuery using Liferay Faces Util's ResourceVerifier API and provide that same version through your theme. This is somewhat more risky than #1 since newer versions of PrimeFaces might require you to upgrade the jQuery version in your theme as well. However it will likely perform better than #3. If you are interested in this option, I can write a blog post about using the ResourceVerifier API to block certain JSF resources from loading since there aren't any tutorials for this yet (it might be a while though since I'm pretty busy at the moment).
  • Use jQuery's noConflict() feature in your theme so that it won't conflict with PrimeFaces jQuery. This will require changing any JavaScript which uses the theme's jQuery to use the new noConflict name of jQuery (it's worth noting that this is what Liferay 7.0 does with the included jQuery). I believe this is the worst option because it will still load 3 versions of jQuery on the page which seems like overkill.
There may be other options that I've missed, but these were the three I could think of off the top of my head.

- Kyle
thumbnail
William Gosse, modificado 6 Anos atrás.

RE: Primefaces 6.1 dialog on Liferay 7 GA5 issue

Liferay Master Postagens: 533 Data de Entrada: 04/07/10 Postagens Recentes
Please note I tried the butterfaces and bootfaces demos as well and I'm seeing some weird behavior with the control panel. It looks like the bootstrap in the portlets is interfering with the bootstrap in Liferay. See attached image file.
thumbnail
Kyle Joseph Stiemann, modificado 6 Anos atrás.

RE: Primefaces 6.1 dialog on Liferay 7 GA5 issue

Liferay Master Postagens: 760 Data de Entrada: 14/01/13 Postagens Recentes
Did you disable the bootstrap resources provided by BootsFaces and ButterFaces in your web.xml? You can see how to do this by looking at the source of the latest BootsFaces Portlet Archetype and ButterFaces Portlet Archetype. If that doesn't fix the issue, let us know.

- Kyle
thumbnail
William Gosse, modificado 6 Anos atrás.

RE: Primefaces 6.1 dialog on Liferay 7 GA5 issue

Liferay Master Postagens: 533 Data de Entrada: 04/07/10 Postagens Recentes
Again please note that this issue occurred with the out of the box bootfaces and butterfaces demo on GA5 with the classic theme.

In the bootfaces demo should the following be set to false or left true?
<!-- Exclude Bootstrap and FontAwesome from BootsFaces portlets since they are already present in Liferay Portal pages. -->
<context-param>
<param-name>net.bootsfaces.get_bootstrap_from_cdn</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>net.bootsfaces.get_fontawesome_from_cdn</param-name>
<param-value>true</param-value>
</context-param>

Its a little confusing. I'm assuming they should be set false. The bootfaces demo has it as true as shown above. Again I deployed the demo war after building with these two flags as true into GA5 and the issue occurs.

The same is true for the butterfaces demo. I deployed the demo directly as is into GA5. It has the following parameter set in its web.xml after being built:
<context-param>
<param-name>org.butterfaces.provideBootstrap</param-name>
<param-value>false</param-value>
</context-param>

With the setting above the issue still occurs.

Again the issue seems to be mainly impacting the admin theme.
thumbnail
Kyle Joseph Stiemann, modificado 6 Anos atrás.

RE: Primefaces 6.1 dialog on Liferay 7 GA5 issue

Liferay Master Postagens: 760 Data de Entrada: 14/01/13 Postagens Recentes
Hi William,
These settings are just BootsFaces settings and ButterFaces settings that stop the libraries from providing Bootstrap CSS (so that Liferay can provide it). We don't really have control over the naming of those options. The settings in each demo/archetype are correct.

I was able to reproduce your issue with only the BootsFaces Applicant Portlet (maybe try clearing your cache and reloading the page with ButterFaces to check if it's some kind of caching issue). I've opened FACES-3244 to track this issue.

Thanks for reporting this.

- Kyle
thumbnail
William Gosse, modificado 6 Anos atrás.

RE: Primefaces 6.1 dialog on Liferay 7 GA5 issue

Liferay Master Postagens: 533 Data de Entrada: 04/07/10 Postagens Recentes
Thanks Kyle!