Forums de discussion

Ext JS MVC portlet deployed in Liferay - Controller loading fails

arun sastry, modifié il y a 10 années.

Ext JS MVC portlet deployed in Liferay - Controller loading fails

New Member Publications: 2 Date d'inscription: 03/09/13 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
arun sastry, modifié il y a 10 années.

RE: Ext JS MVC portlet deployed in Liferay - Controller loading fails

New Member Publications: 2 Date d'inscription: 03/09/13 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!