BootsFaces-OSP: b:dataTable causes JavaScript errors in Liferay 7.0 due to CDN resource

Liferay 7.0 exposes an AMD loader and certain JS resources do no behave well when an AMD loader is present due to anonymous modules. In order to work around these errors, the Liferay Faces Bridge filters the content of these resources slightly to disable their AMD loader features. datatables.min.js is one of the resources that we must filter. With BootsFaces v1.1.2 things worked fine, but with v1.1.3 datatables.min.js was moved to using a CDN. Since datatables.min.js is no longer present on the server, the Liferay Faces custom ResourceHandler can no longer filter the datatables.min.js resource to make it compatible with Liferay 7.0’s frontend JS.

In order to fix this, datatables.min.js should be included in the BootsFaces jar (or a ResLib jar) as it was in v1.1.2 and an option should probably be included to enable loading the resource from a CDN.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 3
  • Comments: 16 (3 by maintainers)

Commits related to this issue

Most upvoted comments

@stephanrauh and @TheCoder4eu, there are any news about this issue? Our client machines does not have internet connection, so we need this issue resolved in order to upgrade BootsFaces version.

I’ve finished the first demo at https://staging.bootsfaces.net/Showcase/layout/resourcemanagement.jsf.

Currently, the demo only demonstrates how to use the web.xml parameter. The other detection mechanisms still need a demo in the showcase.

@stephanrauh, looks good 😃 Minor tweaks:

You may be able to skip the looping check if get_datatable_from_cdn == false. You may be able to abort the loop (break) when loadDatatables is set to false.

@stephanrauh Is this enhancement planned to be in upcoming releases? I can’t update my version of Bootsfaces without a solution for this.

@stephanrauh nice idea.

@stephanrauh, include datatables.min.js and datatables.min.css in to jar, otherwise <b:dataTable /> not going to work without internet connection.