Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
DO Hung Thuan
how use attribute "USE" in "<AUI:SCRIPT>" in LF6
2 de Novembro de 2010 03:30
Resposta

DO Hung Thuan

Ranking: Junior Member

Mensagens: 54

Data de entrada: 16 de Setembro de 2009

Mensagens recentes

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
2 de Novembro de 2010 09:11
Resposta

Krishna Melkote

Ranking: Junior Member

Mensagens: 52

Data de entrada: 22 de Setembro de 2010

Mensagens recentes

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
8 de Novembro de 2010 00:03
Resposta

DO Hung Thuan

Ranking: Junior Member

Mensagens: 54

Data de entrada: 16 de Setembro de 2009

Mensagens recentes

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
1 de Dezembro de 2010 22:39
Resposta

Meenu charathu

Ranking: New Member

Mensagens: 17

Data de entrada: 15 de Novembro de 2010

Mensagens recentes

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
1 de Dezembro de 2010 23:30
Resposta

Nagendra Kumar Busam

Ranking: Liferay Master

Mensagens: 653

Data de entrada: 7 de Julho de 2009

Mensagens recentes

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
2 de Dezembro de 2010 00:59
Resposta

Meenu charathu

Ranking: New Member

Mensagens: 17

Data de entrada: 15 de Novembro de 2010

Mensagens recentes

<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
28 de Fevereiro de 2013 12:36
Resposta

David Ilechukwu

Ranking: Regular Member

Mensagens: 128

Data de entrada: 7 de Junho de 2010

Mensagens recentes

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
28 de Junho de 2013 09:33
Resposta

Nate Cavanaugh

LIFERAY STAFF

Ranking: Junior Member

Mensagens: 87

Data de entrada: 27 de Novembro de 2006

Mensagens recentes

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
25 de Setembro de 2013 15:32
Resposta

Milan Palian

Ranking: Junior Member

Mensagens: 43

Data de entrada: 10 de Dezembro de 2009

Mensagens recentes

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.