Foros de discusión

how use attribute "USE" in "<AUI:SCRIPT>" in LF6

thumbnail
DO Hung Thuan, modificado hace 13 años.

how use attribute "USE" in "<AUI:SCRIPT>" in LF6

Junior Member Mensajes: 55 Fecha de incorporación: 16/09/09 Mensajes recientes
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.
thumbnail
Krishna Melkote, modificado hace 13 años.

RE: how use attribute "USE" in "<AUI:SCRIPT>" in

Junior Member Mensajes: 52 Fecha de incorporación: 22/09/10 Mensajes recientes
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.


     &lt;%@ taglib uri="http://liferay.com/tld/aui" prefix="aui"%&gt;
     <aui:script use="aui-io-request">
           
          Liferay.on(
          'someEvent',
        function(event) {
            var id = event.someId;
            var <portlet:namespace />uri = '<portlet:renderurl windowstate="EXCLUSIVE">
        </portlet:renderurl>'; 
        
            var idParam = '&amp;id=' + id;
            var <portlet:namespace />portletDiv = A.one('#<portlet:namespace />view');
            var <portlet:namespace />parent = <portlet:namespace />portletDiv.get('parentNode');
            <portlet:namespace />portletDiv.setContent('<div class="loading-animation" id="<portlet:namespace/>contentArea"></div>');
            A.io.request( 
            <portlet:namespace />uri + idParam, 
                {
                    method: 'POST',
                    autoLoad: true,
                    cache: false,
                    on: {
                           success: function() {
                               var <portlet:namespace />fullContent = this.get('responseData');
                               <portlet:namespace />parent.setContent(<portlet:namespace />fullContent);
                           },
            
                        failure: function() {
                            <portlet:namespace />parent.setContent('Failed retrieving data');
                        }
                    }
                }
            );
        }
    );
    

     </aui:script>

thumbnail
DO Hung Thuan, modificado hace 13 años.

RE: how use attribute "USE" in "<AUI:SCRIPT>" in

Junior Member Mensajes: 55 Fecha de incorporación: 16/09/09 Mensajes recientes
Thanks Krishna Melkote!

i understand use "USE" in "<AUI:SCRIPT>". it's name of module in aui library.
thumbnail
sasi kala, modificado hace 13 años.

RE: how use attribute "USE" in "<AUI:SCRIPT>" in

New Member Mensajes: 18 Fecha de incorporación: 15/11/10 Mensajes recientes
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>
thumbnail
Nagendra Kumar Busam, modificado hace 13 años.

RE: how use attribute "USE" in "<AUI:SCRIPT>" in

Liferay Master Mensajes: 678 Fecha de incorporación: 7/07/09 Mensajes recientes
Hi Sasi,

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

Whether in normal javascript invocation like below

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


OR

<aui:script>
your-javascript-related-code
</aui:script>


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

Regards,
- Nagendra Kumar
thumbnail
sasi kala, modificado hace 13 años.

RE: how use attribute "USE" in "<AUI:SCRIPT>" in

New Member Mensajes: 18 Fecha de incorporación: 15/11/10 Mensajes recientes
<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, modificado hace 11 años.

RE: how use attribute "USE" in "<AUI:SCRIPT>" in

Regular Member Mensajes: 154 Fecha de incorporación: 7/06/10 Mensajes recientes
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!
thumbnail
Nate Cavanaugh, modificado hace 10 años.

RE: how use attribute "USE" in "<AUI:SCRIPT>" in

Junior Member Mensajes: 94 Fecha de incorporación: 27/11/06 Mensajes recientes
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,
thumbnail
Milan Palian, modificado hace 10 años.

RE: how use attribute "USE" in "<AUI:SCRIPT>" in

Junior Member Mensajes: 43 Fecha de incorporación: 10/12/09 Mensajes recientes
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.