Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
Siva K
YUI 3 not working in Liferay 6.1.2
16 luglio 2013 16.01
Risposta

Siva K

Punteggio: New Member

Messaggi: 5

Data di Iscrizione: 17 giugno 2013

Messaggi recenti

How can I use YUI 3.10.2 in Liferay 6.1.2 ? I am getting error resource not load . Please check the following code. This code is working out of liferay portlet but not working in liferay portlet.

<script src="http://yui.yahooapis.com/3.10.2/build/yui/yui-min.js"></script>
<script>
YUI({
gallery: 'gallery-2013.01.16-21-05'
}).use( 'datatable-sort', 'datatable-scroll', 'cssfonts', 'cssbutton', 'dataschema-json',
'datatable-datasource', 'datasource-io', "datasource-jsonschema",
'model-sync-rest', "gallery-datatable-paginator", 'gallery-paginator-view',
function(Y) {

Y.one("body").setStyle("visibility","");

var fmtComma2 = function(o) {
return Y.DataType.Number.format( o.value, {thousandsSeparator:",", decimalPlaces:2} );
}

var fmtComma = function(o) {
var ndec = ( o.column.ndec ) ? o.column.ndec : 0;
return Y.DataType.Number.format( o.value, {thousandsSeparator:",", decimalPlaces:ndec} );
}


var jsRandom500 =[
{ "pkey": 1,pint: 7228,pdbl: 1363479.963233347,ptxt: "990LaVqXYTtSk7C",pdt: "1995-04-03T00:22:44.394Z"},
{ "pkey": 2,pint: -10597,pdbl: 3755734.427248584,ptxt: "gf9xkOzS27DhryT",pdt: "2002-01-21T17:34:08.855Z"},
{ "pkey": 3,pint: -20284,pdbl: 3034587.0258341944,ptxt: "PhNLQ6yJlF5tf24",pdt: "1974-08-20T06:14:50.990Z"}

];
var colsA = [
{ key: "pkey", label: "pkey" },
{ key: "ptxt", label: "Random Text" },
{ key: "pdbl", label: "Random Float", className:'align-right', formatter:fmtComma2 },
{ key: "pint", label: "Random Int", className:'align-right', formatter:fmtComma },
{ key: "pdt", label: "Random Date/Time" }
];
var dtableC = new Y.DataTable({
columns: colsA,
data: jsRandom500,
scrollable: 'y',
height: '265px',

paginator: new Y.PaginatorView({
model: new Y.PaginatorModel({itemsPerPage:5}),
container: '#pagContA',
paginatorTemplate: '#tmpl-buttons',
maxPageLinks: 6,
pageLinkFiller: '...',
linkListOffset: 1,
pageLinkTemplate: '<button data-pglink="{page}" class="yui3-button {pageLinkClass}" title="Page No. {page}">{page}</button>'
})

}).render('#tableA');
});

</script>

I got error in the browser

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/html/js/aui/attribute-extras/attribute-extras-min.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/html/js/aui/base-core/base-core-min.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/html/js/aui/base-observable/base-observable-min.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/html/js/aui/datatable-core/datatable-core-min.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/html/js/aui/datatable-head/datatable-head-min.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/html/js/aui/datatable-body/datatable-body-min.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/html/js/aui/datatable-table/datatable-table-min.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/html/js/aui/color-base/color-base-min.js

I got warn message in tomcat console

22:52:26,918 WARN [http-bio-8080-exec-8][404_jsp:109] /html/js/aui/attribute-extras/attribute-extras-min.js
22:52:26,921 WARN [http-bio-8080-exec-1][404_jsp:109] /html/js/aui/base-core/base-core-min.js
22:52:26,923 WARN [http-bio-8080-exec-7][404_jsp:109] /html/js/aui/base-observable/base-observable-min.js
22:52:26,925 WARN [http-bio-8080-exec-4][404_jsp:109] /html/js/aui/datatable-core/datatable-core-min.js
22:52:26,936 WARN [http-bio-8080-exec-9][404_jsp:109] /html/js/aui/datatable-head/datatable-head-min.js
22:52:26,938 WARN [http-bio-8080-exec-10][404_jsp:109] /html/js/aui/datatable-body/datatable-body-min.js
22:52:26,940 WARN [http-bio-8080-exec-8][404_jsp:109] /html/js/aui/datatable-table/datatable-table-min.js
22:52:26,943 WARN [http-bio-8080-exec-1][404_jsp:109] /html/js/aui/color-base/color-base-min.js


Please tell me how to resolve this.