PDA

View Full Version : [CLOSED]Ext.Loader tries to load state/Manager.js instead of direct/Manager.js



jmariani
29 Apr 2011, 8:57 PM
I have this index.php


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?php
// include the config file
include "config.php";

// include the scripts autload class
include "autoload/jsload.php";
?>

<html>
<head>
<title><?php echo SYSTEM_NAME?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="lib/ext4/resources/css/ext-all.css">
<script type="text/javascript" src="lib/ext4/ext-debug.js"></script>
<!-- <script type="text/javascript" src="lib/ext4/ext-all-debug.js"></script> -->
<!-- <script type="text/javascript" src="lib/wow/auth/auth4.js"></script> -->
</head>
<body>
<script type="text/javascript">
Ext.Loader.setConfig({
enabled: true,
paths: {
'Ext': 'lib/ext4/src',
'Wow': 'lib/wow'
}
});
</script>
<script type="text/javascript" src="app.js"></script>
<script type="text/javascript" src="<?php echo BASE_URL.INDEX_PAGE?>direct/api"></script>

</body>
</html>

This line

<script type="text/javascript" src="<?php echo BASE_URL.INDEX_PAGE?>direct/api"></script>
resolves to:


Ext.ns('Ext.app'); Ext.app.REMOTING_API = {"url":"http:\/\/localhost:8888\/wow4\/backend\/index.php\/direct\/router","type":"remoting","actions":{"Group":[{"name":"listPrivileges","len":1},{"name":"listForMargem","len":1},{"name":"index","len":1},{"name":"show","len":1},{"name":"save","len":1,"formHandler":true},{"name":"saveBatch","len":1},{"name":"remove","len":1}],"Privilege":[{"name":"teste","len":1},{"name":"index","len":1},{"name":"show","len":1},{"name":"save","len":1,"formHandler":true},{"name":"saveBatch","len":1},{"name":"remove","len":1}],"User":[{"name":"checkSession","len":1},{"name":"teste","len":1},{"name":"requestLogon","len":1},{"name":"requestLogout","len":1},{"name":"listTecnicos","len":1},{"name":"index","len":1},{"name":"show","len":1},{"name":"save","len":1,"formHandler":true},{"name":"saveBatch","len":1},{"name":"remove","len":1}]},"descriptor":"Ext.app.REMOTING_API","namespace":"Ext.app"};Ext.direct.Manager.addProvider(Ext.app.REMOTING_API);

Ext.Loader should try load Ext.direct.Manager, but in Firebug I get this:


uncaught exception: Failed loading 'lib/ext4/src/state/Manager.js', please verify that the file exists

Any clues?

Jacky Nguyen
30 Apr 2011, 12:56 AM
Not sure exactly how you got that error since you didn't post the content of app.js. However it looks like you didn't require Ext.direct.Manager. This should work:



Ext.require([
'Ext.direct.Manager'
]);

Ext.onReady(function() {
Ext.ns('Ext.app');
Ext.app.REMOTING_API = {...};
Ext.direct.Manager.addProvider(Ext.app.REMOTING_API);
});

jmariani
30 Apr 2011, 1:52 AM
I'm just doing nothing else.

jmariani
30 Apr 2011, 1:53 AM
Sorry.

The error happens while loading the app.

evant
30 Apr 2011, 2:02 AM
If you're including ext-all-debug, why are you trying to load any Ext files? The whole lib is already included.

Jacky Nguyen
30 Apr 2011, 2:04 AM
If you're including ext-all-debug, why are you trying to load any Ext files? The whole lib is already included.

Evan - that line was commented out.

evant
30 Apr 2011, 2:13 AM
So it is!

jmariani
30 Apr 2011, 12:25 PM
Ext.syncRequire saved the day.

Thank you for your attention.

Cya!