Forum

Accueil » Liferay Portal » English » 3. Development

Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
arun sastry
Ext JS MVC portlet deployed in Liferay - Controller loading fails
1 octobre 2013 09:14
Réponse

arun sastry

Rang: New Member

Publications: 2

Date d'inscription: 3 septembre 2013

Publications Récentes

hi,
I am trying to host an Ext JS portlet in Liferay developed using MVC architecture. So it has an app.js at the root level and folders -> Controller, Model, View and Store with their respective files in it. Obviously I cannot mention these files as dependencies as in liferay-portlet.xml since they have to be loaded at at run time.

So what is the correct way to do this as I keep getting this error -

Failed to load resource: the server responded with a status of 404 (Not Found) url/admin/app/controller/TreeTopologyController.js

Note: The application works perfectly fine as it is when hosted in a seperate web server (ex: xamp);
I have also previously successfully hosted ExtJS applications in liferay but none of them load js files dynamically I have listed them as dependencies in liferay-portlet.xml in the order they have to be loaded.

Ext JS - 4.11
Liferay - 6
Kan Zhang
RE: Ext JS MVC portlet deployed in Liferay - Controller loading fails
1 octobre 2013 12:57
Réponse

Kan Zhang

Rang: Junior Member

Publications: 66

Date d'inscription: 1 décembre 2010

Publications Récentes

arun sastry
RE: Ext JS MVC portlet deployed in Liferay - Controller loading fails
2 octobre 2013 08:17
Réponse

arun sastry

Rang: New Member

Publications: 2

Date d'inscription: 3 septembre 2013

Publications Récentes

Thanks for your quick reply - I renamed all my classes with full namespace definition and used Ext.Loader setConfigh and setpath and it started working after that.
However two things to keep in mind -
1) When we add through it as a portlet dependancy in liferay-portlet.xml it automatically sets its path internally to portlet-name/app/..etc/
but the same thing when set through setPath has to be given like portlet-name/app/..etc/ explicitly as Ext JS has no way of knowing the actual path name used in the portlet when deployed.

2) Always use fully qualified class names like - DrawApp.controller.DrawController etc, throughout the application.

Just a few CSS issues left now!

Nonetheless, Thanks again!