Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
DO Hung Thuan
how use attribute "USE" in "<AUI:SCRIPT>" in LF6
November 2, 2010 3:30 AM
Answer

DO Hung Thuan

Rank: Junior Member

Posts: 52

Join Date: September 16, 2009

Recent Posts

Hi all,
i learn LF6, and i see tag <aui:script> have attribute "use".
anyone know use or document for it.
any type of use is: use="aui-base,selector-css3"; use="aui-io"....in <aui:script use="aui-base,selector-css3">; <aui:script use="aui-io">;
help me.
Krishna Melkote
RE: how use attribute "USE" in "<AUI:SCRIPT>" in
November 2, 2010 9:11 AM
Answer

Krishna Melkote

Rank: Junior Member

Posts: 52

Join Date: September 22, 2010

Recent Posts

Hi,

In your jsp, use the below example ..

The "use" just takes a comma separated list of modules you want to use, for example below, I am using aui-io-request to make use of ajax. You can also just write normal javascript inside this tag as you do in <script> tags.

 1
 2     <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui"%>
 3     <aui:script use="aui-io-request">
 4          
 5          Liferay.on(
 6          'someEvent',
 7        function(event) {
 8            var id = event.someId;
 9            var <portlet:namespace />uri = '<portlet:renderURL
10        windowState="EXCLUSIVE">
11        </portlet:renderURL>';
12       
13            var idParam = '&id=' + id;
14            var <portlet:namespace />portletDiv = A.one('#<portlet:namespace/>view');
15            var <portlet:namespace />parent = <portlet:namespace />portletDiv.get('parentNode');
16            <portlet:namespace />portletDiv.setContent('<div class="loading-animation" id="<portlet:namespace/>contentArea"></div>');
17            A.io.request(
18            <portlet:namespace />uri + idParam,
19                {
20                    method: 'POST',
21                    autoLoad: true,
22                    cache: false,
23                    on: {
24                           success: function() {
25                               var <portlet:namespace />fullContent = this.get('responseData');
26                               <portlet:namespace />parent.setContent(<portlet:namespace />fullContent);
27                           },
28            
29                        failure: function() {
30                            <portlet:namespace />parent.setContent('Failed retrieving data');
31                        }
32                    }
33                }
34            );
35        }
36    );
37   
38
39     </aui:script>
DO Hung Thuan
RE: how use attribute "USE" in "<AUI:SCRIPT>" in
November 8, 2010 12:03 AM
Answer

DO Hung Thuan

Rank: Junior Member

Posts: 52

Join Date: September 16, 2009

Recent Posts

Thanks Krishna Melkote!

i understand use "USE" in "<AUI:SCRIPT>". it's name of module in aui library.
Meenu charathu
RE: how use attribute "USE" in "<AUI:SCRIPT>" in
December 1, 2010 10:39 PM
Answer

Meenu charathu

Rank: New Member

Posts: 17

Join Date: November 15, 2010

Recent Posts

hii all


This is my normal javascript code

JavaScript function:
<script language="javascript" type="text/javascript">

function showHideDiv1(checkbox_obj,div_name)
{

div_name=""+div_name;
document.getElementById(div_name).style.display = (checkbox_obj.checked)? "block":"none";

}

</script>


Now i need to write the same function in alloy script
and this is field which is using the javascript code

Input Field:
<input id="chk1" onclick="showHideDiv1(this,'div1')" type="checkbox" /> <b>Creditcard</b>

<div id="div1" style="display: none;">
<input id="r1" name="group1" type="radio" value="600" />€ 40.000 (voordeel: +/- € 600.)<br />
<input id="r2" name="group1" type="radio" value="1500" /> € 100.000 (voordeel: +/- € 1500.)<br />
<input id="r3" name="group1" type="radio" value="4500" />€ 300.000 (voordeel: +/- € 4500.)</div>
</td>


pls help me how to write the same functionality in alloy script
or can anybody guide any document for <aui:script>
Nagendra Kumar Busam
RE: how use attribute "USE" in "<AUI:SCRIPT>" in
December 1, 2010 11:30 PM
Answer

Nagendra Kumar Busam

Rank: Liferay Master

Posts: 598

Join Date: July 7, 2009

Recent Posts

Hi Sasi,

Normally it won't matter where we keep our javascript related code

Whether in normal javascript invocation like below

1<script type="text/javascript">
2your-javascript-related-code
3</script>


OR

1<aui:script>
2your-javascript-related-code
3</aui:script>


You can keep your code in <aui:script></aui:script> - if you want aui style of invocation

Regards,
- Nagendra Kumar
Meenu charathu
RE: how use attribute "USE" in "<AUI:SCRIPT>" in
December 2, 2010 12:59 AM
Answer

Meenu charathu

Rank: New Member

Posts: 17

Join Date: November 15, 2010

Recent Posts

<script language="javascript" type="text/javascript">
function showHideDiv1()
{

alert("Welcome to method");
}

</script>

when am going to call this function using normal html input, its displaying alert
but using <aui:input> its not displaying



<aui:input name="creditcard" id="chk1" type="checkbox" onclick="showHideDiv()" />

<input id="chk2" onclick="showHideDiv1()" type="checkbox" />

can u guide any document for <aui:script>
David Ilechukwu
RE: how use attribute "USE" in "<AUI:SCRIPT>" in
February 28, 2013 12:36 PM
Answer

David Ilechukwu

Rank: Regular Member

Posts: 114

Join Date: June 7, 2010

Recent Posts

Hi People,
Why is it SOOOOOO DIFFICULT for Liferay to provide a SINGLE WORKING EXAMPLE of how to use Alloy library modules and Liferay javascript modules inside Liferay portlets? Only the Liferay-Dynamic-Select example is visible anywhere in the portal. What of the the other 63 Liferay javascript modules? Liferay-Auto-Fields? Liferay-Events? Liferay-History, etc?
There are tens of thousands of Google searches for the keyword "Alloy UI and Liferay UI" - doesn't that say something?
I don't get it. Simply beats me!

Nate and Eduardo (if you are seeing this) - PLEASE you guys URGENTLY need to craft together a simple working example of common usages of Alloy UI and Liferay UI in Liferay portlets- otherwise this is becoming ridiculous!

Take a look @ this post - for instance
Populate jsp variable using Alloy and Liferay UI

No response after more than 20 views. Information should be a little bit more accessible than this!
Liferay-based projects shouldn't be delayed unecessarily for lack of accessibility of available information, to common, non-EE folks like us!
Nate Cavanaugh
RE: how use attribute "USE" in "<AUI:SCRIPT>" in
June 28, 2013 9:33 AM
Answer

Nate Cavanaugh

LIFERAY STAFF

Rank: Junior Member

Posts: 63

Join Date: November 27, 2006

Recent Posts

Hi David,
Thanks for posting.
We are actually actively working on adding an AlloyUI chapter to the dev guide, as well as expanding our general documentation.

In addition, we've just recently added a section to the AlloyUI website for AlloyUI specific to Liferay 6.1: http://alloyui.com/versions/1.5.x/

Sorry for any frustration (I've just commented on the post you mentioned with some possible solutions), but we're definitely working hard on getting the documentation out.

Thanks David,
Milan Palian
RE: how use attribute "USE" in "<AUI:SCRIPT>" in
September 25, 2013 3:32 PM
Answer

Milan Palian

Rank: Junior Member

Posts: 43

Join Date: December 10, 2009

Recent Posts

I have to say that I fully share David's sentiments.

We love you guys for providing this wonderful piece of software and truly appreciate all the effort. However, it has been years and it is still difficult to get a simple working example as a starting point. The details are explained in the documentation, but there is no starting point. After all, this is just a fraction of the overall effort that is already going into documenting Liferay.