構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Joel Kozikowski
jQuery usage examples?
2008/02/15 13:49
答え

Joel Kozikowski

ランク: Expert

投稿: 405

参加年月日: 2006/06/27

最近の投稿

Are there any current portlets and/or other code samples that use jQuery? I'm just now starting to use it (its pretty cool), but a lot of it is new to me.

Specifically, I'm looking for implementations that use the

 1Liferay.Portlet.ready(
 2
 3    /*
 4    This function gets loaded after each and every portlet on the page.
 5
 6    portletId: the current portlet's id
 7    jQueryObj: the jQuery wrapped object of the current portlet
 8    */
 9
10    function(portletId, jQueryObj) {
11    }
12);


but am also looking any/all usage examples as it pertains to Liferay.

Ideas?
Michael Young
RE: jQuery usage examples?
2008/02/15 14:24
答え

Michael Young

LIFERAY STAFF

ランク: Liferay Master

投稿: 843

参加年月日: 2004/08/04

最近の投稿

Not exactly what you're looking for, but here's an AOP example using jQuery:


http://www.liferay.com/web/ncavanaugh/home/blogs/hooking_into_liferay_s_javascript_functions
Joel Kozikowski
RE: jQuery usage examples?
2008/02/16 9:17
答え

Joel Kozikowski

ランク: Expert

投稿: 405

参加年月日: 2006/06/27

最近の投稿

Michael Young:
Not exactly what you're looking for, but here's an AOP example using jQuery:


http://www.liferay.com/web/ncavanaugh/home/blogs/hooking_into_liferay_s_javascript_functions


Great stuff! I'm going to start reading Nate's blogs on a regular basis. Very interesting stuff.

I must say once again I'm really impressed with the design of the new theme system that came along in 4.3. It makes dealing with browser quirks SO much easier, and it gives a LOT of flexibility. Kudos to Nate and anyone else involved in its architecture.

BTW - I found some good jQuery usage examples in the javascript.js file of the official liferay-jedi theme I downloaded from the official plug-ins page. It was close enough to what I was looking for to give me an example of typical jQuery usage.

If anyone else has any other examples, however, I'm still looking for tips! emoticon
Madhura Raut
RE: jQuery usage examples?
2010/11/15 2:33
答え

Madhura Raut

ランク: Junior Member

投稿: 41

参加年月日: 2010/11/11

最近の投稿

Hi,
I am new to portal and currently using Liferay 6.
I wanted to implement pop-up using jQuery. My code is working fine in JSF2. But its not working on liferay.Following is my code. Can you tell me why its not working. I am not getting any exceptions or errors. Please please help me.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:pcc="http://java.sun.com/jsf/composite/pcc"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:portlet="http://java.sun.com/portlet_2_0">

<h:head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>

<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.js "></script>

<script type='text/javascript' >

jQuery('#btnResult').click(function(){

var $element = $('#result'); // hidden div's ID
$element.dialog({
modal: true,
resizable:true,
draggable:true,
title:"Result",
close: function() {
},
buttons: {
ok : function() {
$element.dialog("close");
}
}
}).show();

});


});

</script>
</h:head>
<h:form>
<div id="result" style="display:none">
<h:outputLabel id="lblResult" value="#{adminToolSearchBean.result}"></h:outputLabel>
</div>
<h:commandButton id="btnResult" value="Open the dialog" />
</h:form>
</ui:composition>

I have tried writing the script in the form. But its not working
Dave Weitzel
RE: jQuery usage examples?
2010/11/15 6:16
答え

Dave Weitzel

ランク: Regular Member

投稿: 193

参加年月日: 2009/11/18

最近の投稿

One thing that may be causing the problem is if you have that comment in there.
I believe (I am reasonably new to Liferay as well) that they minify javascript during the jsp processing, single line comments with " //comment " will extend to the end. you need to use block comments " /* comment */ ".

Have you looked at the finished code on the page to check?
Tanweer .
RE: jQuery usage examples?
2010/11/15 10:09
答え

Tanweer .

ランク: Expert

投稿: 319

参加年月日: 2010/03/11

最近の投稿

Hi Madhura,

I think you can use the AUI pop , provided in LR6.

 1  <aui:script>
 2    Liferay.provide(window,'<portlet:namespace />callPopup',
 3    function(url1) {
 4    var A = AUI();
 5    var data = {};
 6    var dialog = new A.Dialog(
 7    {
 8    centered: true,
 9    destroyOnClose: true,
10    modal: true,
11    title: Liferay.Language.get('Display-Content'),
12    width: 600
13    }
14    ).render();
15    dialog.plug(
16    A.Plugin.IO,
17    {
18    data: data,
19    uri: url1
20    }
21    );
22    },
23    ['aui-dialog', 'aui-io']
24    );
25
26</aui:script>
Madhura Raut
RE: jQuery usage examples?
2010/11/15 20:33
答え

Madhura Raut

ランク: Junior Member

投稿: 41

参加年月日: 2010/11/11

最近の投稿

Hi Tanweer,

Can u tell me how to bind dynamic data. Coz I have to display the the information searched by the user in a tabular format.

Thank u emoticon
Madhura Raut
RE: jQuery usage examples?
2010/11/15 20:34
答え

Madhura Raut

ランク: Junior Member

投稿: 41

参加年月日: 2010/11/11

最近の投稿

Hi,
I have tried by removing all the comments but still its not working on the portal.emoticon
Apoorva Prakash
RE: jQuery usage examples?
2010/11/15 20:45
答え

Apoorva Prakash

ランク: Liferay Master

投稿: 659

参加年月日: 2010/06/15

最近の投稿

 1<script type="text/javascript">
 2
 3    jQuery(document).ready(function() {
 4        jQuery("#addform").validate({
 5            rules:{
 6                empCode:{required: true,number:true},
 7                firstName:"required",
 8                mobile:{required: true,number:true},
 9                technology:"required",
10                email: {// compound rule
11                    required: false,
12                    email: true
13
14            },
15            }
16        });
17    });
18</script>


Hope this will help...

Thanks and Regards...
Madhura Raut
RE: jQuery usage examples?
2010/11/16 5:29
答え

Madhura Raut

ランク: Junior Member

投稿: 41

参加年月日: 2010/11/11

最近の投稿

Hi Apoorv,

Thanks for the help. But for some reason I need to know whts wrong with my code. Why its not working. Is it the logical mistake or something else. Please help me.
john paolo sagenes
RE: jQuery usage examples?
2010/11/22 8:40
答え

john paolo sagenes

ランク: New Member

投稿: 1

参加年月日: 2010/11/22

最近の投稿

Hi guys!! Are you a Jquery user? I just want to share something. I found a website that might help you on using jquery and here are some of the website's links:

http://www.jquery4u.com/basic-syntax/5-basic-jquery-syntax/
The link is about 5 Useful Basic jQuery Syntax like:
• Hide/Show
• Fade in/Fade out
• Stop
• Animate
• Slide Toggle

http://www.jquery4u.com/animation-and-effects/10-amazing-jquery-image-slider/
The link is about the 10 Amazing jQuery Image Slider

http://www.jquery4u.com/articles/benefits-jquery/
The link is about the benefits of using jquery

http://www.jquery4u.com/news/load-jquery-google-libraries-api/
The link is about Load jQuery with Google Libraries API

http://www.jquery4u.com/forms/5-awesome-jquery-drop-boxes/
The link is about the 5 Awesome JQuery Drop Down Boxes

So try visit it now and I hope this site helped you! emoticon
Dave Weitzel
RE: jQuery usage examples?
2010/11/22 9:06
答え

Dave Weitzel

ランク: Regular Member

投稿: 193

参加年月日: 2009/11/18

最近の投稿

Have you debugged it using alert() statements to ascertain how far the code gets?
What is displayed in your browsers debugging tools (firebug or chrome "inspect element")?
I suspect you just may need to wrap everything with a
$(document).ready(function(){
....
)}

block to initiate your jQuery objects?
Apoorva Prakash
RE: jQuery usage examples?
2010/11/22 20:30
答え

Apoorva Prakash

ランク: Liferay Master

投稿: 659

参加年月日: 2010/06/15

最近の投稿

Hello Sagenes,
Useful infoarmation, thanks !!!
Madhura Raut
RE: jQuery usage examples?
2010/11/22 21:22
答え

Madhura Raut

ランク: Junior Member

投稿: 41

参加年月日: 2010/11/11

最近の投稿

Hey thank you so much. I have tried using alert boxes too. but its not entring the function which i have written. I will try using the block you have suggested and will let you know. thank u once again