Pavel Rodionov Vor 13 Jahren Nice summary, but have some question. Can you clarify:"<header-portlet-javascript>http://code.jquery.com/jquery-1.4.2.min.js</header-portlet-javascript>That will add jQuery 1.4.2 into just that specific portlet."How it's possible to add jQuery per specific portltet? Is there some scope based Javascript processing in Liferay 6 that hidden somewhere? Because in earlier versions of Liferay header-portlet-javascript always meant that particular script will be included in page where portlet is rendered. So, there were never such (could it be ?) javascript per portlet functionality. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Nate Cavanaugh Pavel Rodionov Vor 13 Jahren Hi Pavel,Sorry for the confusion, I will revise that line, because it will add it to the page, but it will only add it when that portlet shows up.So it's inclusion is bound to the portlet, but it's execution context is not (if that makes sense). We don't do any sort of js sandboxing, though, so I'll correct this to be more clear.Thanks for pointing this out Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Nate Cavanaugh Pavel Rodionov Vor 13 Jahren Hi Pavel,Sorry for the confusion, I will revise that line, because it will add it to the page, but it will only add it when that portlet shows up.So it's inclusion is bound to the portlet, but it's execution context is not (if that makes sense). We don't do any sort of js sandboxing, though, so I'll correct this to be more clear.Thanks for pointing this out Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Bruno Vernay Vor 13 Jahren Also is there a standard solution for portet concerning the use of conflicting Javascript library ??A solution that would allow the portlet to be portable ?ThanksBruno Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Nate Cavanaugh Bruno Vernay Vor 13 Jahren Hi Bruno,Much of it depends upon the javascript library itself.Some libraries, like mootools, prototype, etc, are by their nature conflicting, because they modify the host objects of the browser, and in order to work, they kind of require the ability to modify all of the objects on the page.If you mean conflicting and multiple versions of jQuery on a page, there is a "standard" way to include multiple versions.Basically, jQuery has a way to assign itself to a specific variable.For example:// Include jQuery 1.2.6var jQuery126 = jQuery.noConflict(true);// Include jQuery 1.4.2var jQuery142 = jQuery.noConflict(true);Now you have both versions running on the same page. While this is helpful, it's really only useful if neither of those versions include any third party plugins, which we've found is pretty infrequent.Those third party plugins will be trying to modify a version of the library that doesn't exist.You could possibly work around this by including your version of jQuery and all of its plugins together, and always followed by a js file like so:window._myjQuery14 = jQuery.noConflict(true);That might work out having them on a per portlet basis.But let me know if you had some other libraries in mind Thanks Bruno, Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Bruno Vernay Nate Cavanaugh Vor 13 Jahren Thanks for your quick reply !I guess that Portlets cannot do more than what HTML / Javascript is currently capable of. Maybe HTML 6 will allow for easier composition / mashup at the UI level, since it may become more prevalent: http://blog.xebia.com/2010/07/21/service-integration-at-the-presentation-layer/Regards Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen krunal b soni Nate Cavanaugh Vor 13 Jahren Hi Nate,Yes you are quite right.By using jQuery.noConflict(true) I have implemented so many plugins in the application. But, the problem can be created by third party plugins when they are using jQuery variable in the function call like jQuery.method(). The only solution to that we have to implicitly change the jQuery variable with the name which we have defined using noConflict, say jQuery126 in your example. And that worked for me many times.Thanks Krunal Soni Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Nate Cavanaugh Bruno Vernay Vor 13 Jahren Hi Bruno,Much of it depends upon the javascript library itself.Some libraries, like mootools, prototype, etc, are by their nature conflicting, because they modify the host objects of the browser, and in order to work, they kind of require the ability to modify all of the objects on the page.If you mean conflicting and multiple versions of jQuery on a page, there is a "standard" way to include multiple versions.Basically, jQuery has a way to assign itself to a specific variable.For example:// Include jQuery 1.2.6var jQuery126 = jQuery.noConflict(true);// Include jQuery 1.4.2var jQuery142 = jQuery.noConflict(true);Now you have both versions running on the same page. While this is helpful, it's really only useful if neither of those versions include any third party plugins, which we've found is pretty infrequent.Those third party plugins will be trying to modify a version of the library that doesn't exist.You could possibly work around this by including your version of jQuery and all of its plugins together, and always followed by a js file like so:window._myjQuery14 = jQuery.noConflict(true);That might work out having them on a per portlet basis.But let me know if you had some other libraries in mind Thanks Bruno, Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Bruno Vernay Nate Cavanaugh Vor 13 Jahren Thanks for your quick reply !I guess that Portlets cannot do more than what HTML / Javascript is currently capable of. Maybe HTML 6 will allow for easier composition / mashup at the UI level, since it may become more prevalent: http://blog.xebia.com/2010/07/21/service-integration-at-the-presentation-layer/Regards Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen krunal b soni Nate Cavanaugh Vor 13 Jahren Hi Nate,Yes you are quite right.By using jQuery.noConflict(true) I have implemented so many plugins in the application. But, the problem can be created by third party plugins when they are using jQuery variable in the function call like jQuery.method(). The only solution to that we have to implicitly change the jQuery variable with the name which we have defined using noConflict, say jQuery126 in your example. And that worked for me many times.Thanks Krunal Soni Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Bruno Vernay Nate Cavanaugh Vor 13 Jahren Thanks for your quick reply !I guess that Portlets cannot do more than what HTML / Javascript is currently capable of. Maybe HTML 6 will allow for easier composition / mashup at the UI level, since it may become more prevalent: http://blog.xebia.com/2010/07/21/service-integration-at-the-presentation-layer/Regards Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
krunal b soni Nate Cavanaugh Vor 13 Jahren Hi Nate,Yes you are quite right.By using jQuery.noConflict(true) I have implemented so many plugins in the application. But, the problem can be created by third party plugins when they are using jQuery variable in the function call like jQuery.method(). The only solution to that we have to implicitly change the jQuery variable with the name which we have defined using noConflict, say jQuery126 in your example. And that worked for me many times.Thanks Krunal Soni Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
M. Ahamed Maqbool Vor 13 Jahren Hi,I was trying to implement multiple calendars when date picker is clicked. I could easily do it by changing 'numberOfMonths' in ui.datepicker.js in liferay 5.2.3.But couldn't trace out in liferay 6.0.2. Could you help me?Thanks,Ahamed Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Raja Nagendra Kumar Vor 13 Jahren If more than one portlet uses this<header-portlet-javascript>http://code.jquery.com/jquery-1.4.2.min.js</header-portlet-javascript>would inclusion of js file happen only once.. I hope this should be done once once.. else it has no meaning to say it is a global JavaScript.>That will add jQuery 1.4.2 onto the page wherever that portlet happens to be rendered.Does this mean, can other portlets on the same page be able to use this javascript, without defining <header-portlet-javascript>http://code.jquery.com/jquery-1.4.2.min.js</header-portlet-javascript>Assumption here is other portlet is always in the same page portlet A, which does define this script as headder-js..Regards,Raja Nagendra Kumar,C.T.Owww.tejaosoft.com Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Julian Bonilla Vor 13 Jahren Nate - I tried using AlloyUI to load up YUI 3.3.0. I basically want to use the new DataTable component. But there seems to be a conflict when using two version of YUI3 on the same page. Any advice on getting around this issue? Thanks. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Mykola M Vor 13 Jahren Tried <header-portlet-javascript>/html/js/jquery/jquery.js</header-portlet-javascript> - the resulting link was /myportlet/html/js/jquery/jquery.js which ofcourse didn't work.Had to change it to <header-portlet-javascript>/../html/js/jquery/jquery.js</header-portlet-javascript> to make it work, but it feels wrong.Am I missing something here? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Dhrutika Parekh Vor 13 Jahren Nice post!! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
(Sie) Vor 12 Jahren [...] I've found answer partially in this blog http://www.liferay.com/web/nathan.cavanaugh/blog/-/blogs/using-jquery-or-any-javascript-library-in-liferay-6-0 In my case I can link necessary libraries in my... [...] Read More Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Yerra Somesh Vor 12 Jahren I have a jquery file which i uploaded into js folder but the jruery code in any portal is not working. can u please help me? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Rahul Parashar Yerra Somesh Vor 12 Jahren "So instead of calling YUI() in the portal, we created AUI(). By creating the "AUI" namespace, we are able to guarantee that our environment won't conflict with someone who wants to upgrade their version of YUI3 in the future"Nate, can you suggest how to upgrade to YUI 3.3. As we are facing conflicts between YUI 3.2 (which core portal internally uses) and YUI 3.3 (which we are using in our custom portlet). Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Rahul Parashar Yerra Somesh Vor 12 Jahren "So instead of calling YUI() in the portal, we created AUI(). By creating the "AUI" namespace, we are able to guarantee that our environment won't conflict with someone who wants to upgrade their version of YUI3 in the future"Nate, can you suggest how to upgrade to YUI 3.3. As we are facing conflicts between YUI 3.2 (which core portal internally uses) and YUI 3.3 (which we are using in our custom portlet). Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Kirk Stork Vor 11 Jahren Nate,I've been wanting to use a more up to date YUI (particularly the Model/View/Handlebars stuff), just as one other person commented a while back. I wonder if you would comment on the best ways to incorporate later versions of YUI without creating problems in AUI, as it seems that for YUI, things might be a little different than for JQuery and others.For example, could you comment on (technical parts of ) the answer posted here:http://stackoverflow.com/questions/7726261/yui-version-conflict-issue-in-portlet Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Meenu R Vor 10 Jahren wan to implement datepicker using jquery? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen