Fórumok
Javascript in Liferay Portal
Égon Lima, módosítva 11 év-val korábban
Javascript in Liferay Portal
Junior Member Bejegyzések: 25 Csatlakozás dátuma: 2012.04.23. Legújabb bejegyzések
Hello people
Does anyone know how to import a javascript library to incorporate the structure of a Liferay Portal. I'm developing some portlets and am having trouble because my libraries conflict with giving estam alloy yui libraries already existing in Liferay
Does anyone know how to import a javascript library to incorporate the structure of a Liferay Portal. I'm developing some portlets and am having trouble because my libraries conflict with giving estam alloy yui libraries already existing in Liferay
David H Nebinger, módosítva 11 év-val korábban
RE: Javascript in Liferay Portal
Liferay Legend Bejegyzések: 14915 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
The alloy libs are already available, you do not have to import them again. Just use them as if they were imported.
Hitoshi Ozawa, módosítva 11 év-val korábban
RE: Javascript in Liferay Portal
Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
I think your question is not about loading javascript into your portlet but about avoiding conflict with existing AlloyUI.
Which library are you using? Try changing your library to avoid conflict is all I can say from the current description of your problem.
Which library are you using? Try changing your library to avoid conflict is all I can say from the current description of your problem.
Égon Lima, módosítva 11 év-val korábban
RE: Javascript in Liferay Portal
Junior Member Bejegyzések: 25 Csatlakozás dátuma: 2012.04.23. Legújabb bejegyzések
I am using a graphics library called Highcharts, which is very good by the way, but the problem is the conflict it generates portal page, disabling multiple functions of the original page.
Note I'm newbie in the development of portals and portlets.
But again I ask, anyone know any way to avoid conflict between the JavaScript libraries inside Liferay Portal Server.
Note I'm newbie in the development of portals and portlets.
But again I ask, anyone know any way to avoid conflict between the JavaScript libraries inside Liferay Portal Server.
Hitoshi Ozawa, módosítva 11 év-val korábban
RE: Javascript in Liferay Portal
Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
You have to remember that there is actually only 1 html page. Portal just combines generated html scriptlets representing portlets.
Égon Lima, módosítva 11 év-val korábban
RE: Javascript in Liferay Portal
Junior Member Bejegyzések: 25 Csatlakozás dátuma: 2012.04.23. Legújabb bejegyzések
Is there any way to add more javascript libraries to the portal. As if we were complementing AlloyUi
David H Nebinger, módosítva 11 év-val korábban
RE: Javascript in Liferay Portal
Liferay Legend Bejegyzések: 14915 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Sure, again using the theme. That's how I pull in jquery and some other libs.
Égon Lima, módosítva 11 év-val korábban
RE: Javascript in Liferay Portal
Junior Member Bejegyzések: 25 Csatlakozás dátuma: 2012.04.23. Legújabb bejegyzések
Thank you,
But I think my problem is in Portal because I find it strange what is happening. For you to understand better my problem my Liferay Portal is not displaying the right of the portal page JavaScript code, not the Portlets that I created. The funny thing is that Google Chrome in the portal works perfectly.
I'm working on that error plus or minus one week and I'm tired because I can not find. It takes me to believe now that must have been some error in Liferay Portal, try the installation again.
If anyone ever had a similar experience, please comment!
Gracias
But I think my problem is in Portal because I find it strange what is happening. For you to understand better my problem my Liferay Portal is not displaying the right of the portal page JavaScript code, not the Portlets that I created. The funny thing is that Google Chrome in the portal works perfectly.
I'm working on that error plus or minus one week and I'm tired because I can not find. It takes me to believe now that must have been some error in Liferay Portal, try the installation again.
If anyone ever had a similar experience, please comment!
Gracias
Égon Lima, módosítva 11 év-val korábban
RE: Javascript in Liferay Portal
Junior Member Bejegyzések: 25 Csatlakozás dátuma: 2012.04.23. Legújabb bejegyzések
Personal solved the problem
Deploy the javascript on the theme of the portal so that now use it freely without any conflict within the portal page with portlets
Thank you
Deploy the javascript on the theme of the portal so that now use it freely without any conflict within the portal page with portlets
Thank you
raja gopal, módosítva 11 év-val korábban
RE: Javascript in Liferay Portal
New Member Bejegyzés: 1 Csatlakozás dátuma: 2012.07.23. Legújabb bejegyzések
hi
please tell me the steps need to do for Highcharts working in liferay.
please tell me the steps need to do for Highcharts working in liferay.
David H Nebinger, módosítva 11 év-val korábban
RE: Javascript in Liferay Portal
Liferay Legend Bejegyzések: 14915 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
I use highcharts too. Created a theme to pull the script in automagically in the page footer.
Portlets using charts just use it, they don't have to have anything in the liferay-portlet.xml file indicating they need it, don't have to deploy it with the portlets, and upgrading is easy because I just have to do it in the theme.
I don't have any conflicts, so I'm guessing that it's actually something you're doing which is causing the conflict...
Portlets using charts just use it, they don't have to have anything in the liferay-portlet.xml file indicating they need it, don't have to deploy it with the portlets, and upgrading is easy because I just have to do it in the theme.
I don't have any conflicts, so I'm guessing that it's actually something you're doing which is causing the conflict...
Jason Dobyns, módosítva 10 év-val korábban
RE: Javascript in Liferay Portal
Junior Member Bejegyzések: 36 Csatlakozás dátuma: 2013.07.31. Legújabb bejegyzések
I have add this snipset into .../html/theme/classic/template/portal_normal.vm file
"<script type="text/javascript" src="$javascript_folder/highcharts.js"></script>"
But then i call:
$('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Historic World Population by Region'
},
subtitle: {
text: 'Source: Wikipedia.org'
},
xAxis: {
categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania'],
title: {
text: null
}
},
yAxis: {
min: 0,
title: {
text: 'Population (millions)',
align: 'high'
},
labels: {
overflow: 'justify'
}
},
tooltip: {
valueSuffix: ' millions'
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -40,
y: 100,
floating: true,
borderWidth: 1,
backgroundColor: '#FFFFFF',
shadow: true
},
credits: {
enabled: false
},
series: [{
name: 'Year 1800',
data: [107, 31, 635, 203, 2]
}, {
name: 'Year 1900',
data: [133, 156, 947, 408, 6]
}, {
name: 'Year 2008',
data: [973, 914, 4054, 732, 34]
}]
});
It said "highcharts is not a function" althought i see page loaded highcharts.js file
"<script type="text/javascript" src="$javascript_folder/highcharts.js"></script>"
But then i call:
$('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Historic World Population by Region'
},
subtitle: {
text: 'Source: Wikipedia.org'
},
xAxis: {
categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania'],
title: {
text: null
}
},
yAxis: {
min: 0,
title: {
text: 'Population (millions)',
align: 'high'
},
labels: {
overflow: 'justify'
}
},
tooltip: {
valueSuffix: ' millions'
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -40,
y: 100,
floating: true,
borderWidth: 1,
backgroundColor: '#FFFFFF',
shadow: true
},
credits: {
enabled: false
},
series: [{
name: 'Year 1800',
data: [107, 31, 635, 203, 2]
}, {
name: 'Year 1900',
data: [133, 156, 947, 408, 6]
}, {
name: 'Year 2008',
data: [973, 914, 4054, 732, 34]
}]
});
It said "highcharts is not a function" althought i see page loaded highcharts.js file
David H Nebinger, módosítva 10 év-val korábban
RE: Javascript in Liferay Portal
Liferay Legend Bejegyzések: 14915 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
When using jquery, you must drop all $() syntax and use the regular jquery() syntax instead.
Jason Dobyns, módosítva 10 év-val korábban
RE: Javascript in Liferay Portal
Junior Member Bejegyzések: 36 Csatlakozás dátuma: 2013.07.31. Legújabb bejegyzésekDavid H Nebinger:
When using jquery, you must drop all $() syntax and use the regular jquery() syntax instead.
Because liferay using too old version of jquery?
David H Nebinger, módosítva 10 év-val korábban
RE: Javascript in Liferay Portal
Liferay Legend Bejegyzések: 14915 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzésekJason Dobyns:
David H Nebinger:When using jquery, you must drop all $() syntax and use the regular jquery() syntax instead.
Because liferay using too old version of jquery?
No, because AUI also uses $() syntax.
Jason Dobyns, módosítva 10 év-val korábban
RE: Javascript in Liferay Portal
Junior Member Bejegyzések: 36 Csatlakozás dátuma: 2013.07.31. Legújabb bejegyzések
Also, still not get more lucky. It's difficult to understand the reason, i have never got this problem, don't know why.