RE: How to Resolve "DevExtreme bundle already included"?

thumbnail
Mahammad Ashik A, modified 6 Years ago. Junior Member Posts: 81 Join Date: 7/17/17 Recent Posts
Hi,

I included below source in my Jsp.

<link rel="stylesheet" type="text/css"
    href="https://cdn3.devexpress.com/jslib/18.2.7/css/dx.common.css" />
<link rel="dx-theme" data-theme="generic.light"
    href="https://cdn3.devexpress.com/jslib/18.2.7/css/dx.light.css" />
<script src="https://cdn3.devexpress.com/jslib/18.2.7/js/dx.all.js"></script>

While i am loading page below error showing in console.

Uncaught Error: E0024 - DevExtreme bundle already included.

PFA

​​​​​​​Thank You
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
We never ever add CSS and/or JS resources this way because there is no way for the portal to aggregate them when multiple portlets want to use the same files.

Use the @Component propery keys header-portlet-css, header-portlet-js, footer-portlet-css, footer-portlet-js, etc to properly inject your portlet resources.
thumbnail
Mahammad Ashik A, modified 6 Years ago. Junior Member Posts: 81 Join Date: 7/17/17 Recent Posts
Hi David,
Thanks for your support.

@Component(
    immediate = true,
    property = {
       



        "com.liferay.portlet.header-portlet-js=/js/dx.all.js",
        "com.liferay.portlet.header-portlet-css=/css/dx.common.css",
        "com.liferay.portlet.header-portlet-css=/css/dx.light.css",



    },
    
    service = Portlet.class
)



Created js and css folders in path /src/main/resources/META-INF/resources/js/**** and ****/css/****


​​​​​​​But file is not loading
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
My bad, I shouldn't have shortened the header property key. It actually should be: 
​​​​​​​
"com.liferay.portlet.header-portlet-javascript=/js/main.js"