PDA

View Full Version : Enter key causes error



frrogoy
21 Dec 2010, 7:04 AM
In chrome, when testing my app, if I press enter instead of using the button I get Failed to load resource: the server responded with a status of 404 (Not Found).
I'm inexperienced with with phone apps. Do I have to handle this? Or is it unique to testing in a browser?

mrsunshine
21 Dec 2010, 11:59 AM
normally i you will develop and test you app on your pc browser so thats okay ;-)

the issue seems like a bug in you app so maybe posting the responding code help to figure out what the problem is

frrogoy
21 Dec 2010, 12:23 PM
I think you're right. It's probably because I have a form without a url. When I used a submit with a url on the login form, I couldn't get the response module to display anything. So I rewrote it using an ajax call to load a store, hide the form, and show another panel with the returned list. The url it's looking for (on enter) is my correct path/null instead of path/module.php.

var lform = new Ext.Panel({
fullscreen: true,
items: [{
xtype: 'form',
id: 'loginform',
items: [{
xtype: 'fieldset',
title: 'CIM Sales DB Login',
instructions: 'Please enter the information above.',
defaults: {
labelWidth: '30%'
},
items: [{
xtype: 'emailfield',
name: 'eml',
id: 'eml',
label: 'Email',
placeHolder: 'me@mycompany.com',
useClearIcon: true
}, {
xtype: 'passwordfield',
id: 'pw',
name: 'pw',
label: 'Password',
useClearIcon: true
}]
}],
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items: [{
xtype: 'spacer'
},{
name: 'Login',
text: 'Log In',
centered: true,
width: 100,
handler: function(){
emlin = Ext.getCmp('eml').getValue();
pwin = Ext.getCmp('pw').getValue();
listStore.proxy.extraParams = {eml: emlin, pw: pwin};
listStore.load();
}
},{
xtype: 'spacer'
}]
}]
}]
})
By the way, I admit that I don't know what I'm doing! I'm on the bleeding edge of technology...

filla
22 Dec 2010, 1:05 AM
You could try submitOnAction:false on the panel

frrogoy
22 Dec 2010, 4:55 AM
Thanks, filla. That worked. And it was right in the API too. Along with thousands of other things I miss!