For starters I'm brand new to ExtJS
Thanks for taking a moment to look at my problem, so far I haven't been able to find any equivalent questions anywhere. I'm attempting to transition a webapp interface from Tiles/Spring/jQuery to a Tiles/Spring/ExtJS interface, but I'm having trouble in getting some of the basics started.
For starters, the code:
Ext.onReady(function() {
Ext.QuickTips.init();
var login = new Ext.FormPanel({
title: "Please Login",
url: 'j_spring_security_check',
labelWidth: 80,
frame: true,
defaultType: 'textField',
width: 300,
height: 150,
monitorValid: true,
bodyStyle: 'padding:10px',
items: [{
fieldLabel: 'Username',
name: 'j_username',
id: 'userName',
allowBlank: false,
listeners: {
afterrender: function(field) {
field.focus();
}
}
}, {
fieldLabel: 'Password',
name: 'j_password',
inputType: 'password',
allowBlank: false
}],
buttons: [{
text: 'Login',
formBind: true,
handler: function() {
loginSubmit();
}
}, {
text: 'Reset',
formBind: true,
handler: function() {
reset();
}
}],
listeners: {
afterRender: function(thisForm, options) {
this.keyNav = Ext.create('Ext.util.KeyNav', this.el, {
enter: loginSubmit,
scope: this
});
}
}
});
function reset() {
login.getForm().reset();
}
function loginSubmit() {
login.getForm().submit({
method: 'POST',
success: function(form, action) {
window.location = 'home';
},
failure: function(form, action) {
Ext.Msg.alert('Login Failed!', 'Login Failed');
reset();
}
});
}
login.render('login');
});
And this is wrapped properly in the script tags, in a jsp page.
I import the extJS files in the tile page that this JSP renders to:
<link type="text/css" rel="stylesheet" href="extjs/resources/css/ext-all.css" />
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
And at this point I'd expect things to render somehow, but instead I get this:
Strangely, the files do load successfully (at least they don't appear with an error) except that it shows a responseBody of 0 bytes, as you can see in lines 2 and 3 below.
I've looked around and already tried all the easy fixes to the best of my ability, I'm hoping someone here will be able to help. Thanks again for taking the time to look at my problem.
Update
When I changed out the script reference to the sencha CDN, I get past this error on to a new one, but I want to stick with this and resolve this first.
My best guess now based on the comments below is that I'm either missing ext-base.js (which is not included in the ExtJS I have downloaded) or I somehow have my file location/Spring config wrong. I've added these entries to my spring config now:
<mvc:resources location="/WEB-INF/extjs/*" mapping="/extjs/**" />
....
<security:intercept-url pattern="/appName/extjs/**"
access="permitAll" requires-channel="any" />
And yet I still have the same error. I've got the extjs folder in my WEB-INF directory, shouldn't that mvc:resources above fix that so I can reference it like so:
< script type="text/javascript" src="extjs/ext-all-debug.js"
Yet I still get the "302 found" error