PDA

View Full Version : modal window



lejla
22 Nov 2007, 4:51 AM
i have a html page with simple button. on buton click modal window with form is open. this works right in ff, but in ie (when click on button) there is error 'event' is null or not an object. does anyone know what cause this and how to solve it? thanks in advance.

code:
[PHP]KreirajSjednicuFormWindow= function(){

var store=new Ext.data.SimpleStore(
{fields:[{name:'value',mapping:'value'},{name:'text',mapping:'text'}],
data:[{value:'id1',text:'prvi'},{value:'id2',text:'drugi'}, {value:'id3',text:'treci'}]})

var combobox = new Ext.form.ComboBox({
fieldLabel:'<b>Predsjednik Ustavnog Suda BiH</b>',
store:store,
mode:'local',
displayField:'text',
valueField:'value',
selectOnFocus:true,
typeAhead:true,
listWidth: '200',
emptyText:'Izaberite vrstu sjednice'
});

var rbtnMaloVijece = new Ext.form.Radio({
name:'vrstaSjednice',
// fieldLabel:'<b>Vrsta sjednice</b>',
boxLabel:'Malo vijeće',
hideLabel:'true'
//cls: 'myradio',
//ctCls: 'myradioContainer'
});


var rbtnLabel = new Ext.form.Radio({
name:'vrstaSjednice',
fieldLabel:'<b>Vrsta sjednice</b>',
hidden: 'true'
//cls: 'myradio',
//ctCls: 'myradioContainer'
});

var rbtnPlenarna = new Ext.form.Radio({
name:'vrstaSjednice',
fieldLabel:'<b>Vrsta sjednice</b>',
boxLabel:'Plenarna',
hideLabel:'true'
//cls: 'myradio',
//ctCls: 'myradioContainer'
});

var rbtnVijece5Sudija = new Ext.form.Radio({
name:'vrstaSjednice',
//fieldLabel:'<b>Vrsta sjednice</b>',
boxLabel:'Vijeće od 5 sudija',
fieldLabel:'<b>Vrsta sjednice</b>',
hideLabel:'true'
//cls: 'myradio',
//ctCls: 'myradioContainer'
});

this.complainForm= new Ext.form.FormPanel({
labelWidth: 200,
url:'sjednicaAdd.php',
frame:true,
bodyStyle:'padding:5px 5px 0',
width: 500,
items: [{
layout:'column',
columnWidth:.150,
layout: 'form',
xtype:'fieldset',
title: 'Opće informacije',
autoHeight:true,
items: [
rbtnLabel,
rbtnPlenarna,
rbtnMaloVijece,
rbtnVijece5Sudija,
combobox,
{
xtype:'textfield',
fieldLabel: '<b>Broj sjednice</b>',
name: 'brojSjednice',
anchor:'99%'
},
{
xtype:'textfield',
fieldLabel: '<b>Datum i vrijeme sjednice</b>',
allowBlank:false,
name: 'datumVrijemeSjednice',
anchor:'99%'
},
{
xtype:'combo',
fieldLabel: '<b>Predsjednik Ustavnog Suda BiH</b>',
name: 'predsjednikUSBiH',
anchor:'99%'
},
]},
{
layout: 'form',
xtype:'fieldset',
title: '<b>Komentar</b>',
autoHeight:true,
collapsible:'true',
items:[{
xtype:'textarea',
name:'komentar',
allowBlank:false,
hideLabel:true,
height:120,
anchor:'99%'
}]

},
{title: 'Column Layout - Percentage Only',
autoHeight:'true',
layout:'column',
xtype: 'fieldset',
border:false,
items: [rbtnPlenarna,
rbtnMaloVijece,
rbtnVijece5Sudija]}],
/*
xtype:'textfield',
name:'comment',
labelAlign: 'top',
// id:'bio',
fieldLabel:'Comment',
autoHeight:true,
anchor:'98%'*/

buttons: [{
text: 'Sačuvaj',
/* onClick:function(){
if(that.complainForm.form.isValid())
{
that.complainForm.form.submit({params:{
requestData: 'adddept'},
failure: function() {
// Ext.MessageBox.alert('Error Message',"fail");
alert('h');
},
success: function() {
//win.close();
}
/* reID: this.refID,
maiID: this.mainID,
comSubject:this.subject,
depID:this.deptID */
/* });
}
else{
alert('hi');
}
}*/
handler:this.formSubmit,
scope:this
},{
text: 'Odustani',
handler: function(){
this.close();
},
scope:this

}]


});
KreirajSjednicuFormWindow.superclass.constructor.call(this, {
closable:true,
title:'Kreiraj sjednicu',
width:500,
height:875,
closeAction:'hide',
layout: 'fit',
modal: 'true',
items:this.complainForm
});
}
Ext.extend(KreirajSjednicuFormWindow,Ext.Window,{
formSubmit: function(){

if(this.complainForm.form.isValid())
{
this.complainForm.form.submit({params:{
requestData: 'addnewcomplain'},
failure: function() {
// Ext.MessageBox.alert('Error Message',"fail");
alert('Neuspje

hendricd
22 Nov 2007, 5:19 AM
Can you post the html of your start page ?

lejla
22 Nov 2007, 5:41 AM
here is html



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head></head>
<title>Kreiraj sjednicu</title>
<link rel="stylesheet" type="text/css" href="../common/ext/resources/css/ext-all.css" />
<script type="text/javascript" src="../common/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../common/ext/ext-all.js"></script>
<script language="javascript" src="../common/dialogs/frmSjednica.js"></script>
<link rel="stylesheet" type="text/css" href="../common/ext/examples.css" />



<style type="text/css">
.x-panel-body p {
margin:10px;
font-size:12px;
}
</style>
</head>
<body>
<script type="text/javascript" src="../common/ext/examples.js"></script>
<p><input type="button" id="btnSjednicaAdd" value="Kreiraj sjednicu" /></p>
</body>
</html>

hendricd
22 Nov 2007, 6:02 AM
Difficult to say from here.

You should load ext-all-debug.js instead. When an error occurs it will (should popup an Ext debug window at the bottom and display the line number where its occuring. Then dig into the source and trace it down.

lejla
22 Nov 2007, 6:36 AM
i think problem is with my "custom" window:


Ext.onReady(function(){
var win;
var button = Ext.get('btnSjednicaAdd');

button.on('click', function(){
//if(!win){

win = new KreirajSjednicuFormWindow();
//}
win.show(this);
});
});

internet explorer doesn't support this for some reason, but probably there is a way to solve the problem.. unfortunately, my app have to work with ie..

hendricd
22 Nov 2007, 6:51 AM
this.complainForm= new Ext.form.FormPanel({
labelWidth: 200,
url:'sjednicaAdd.php',
frame:true,
bodyStyle:'padding:5px 5px 0',
width: 500,
items: [{
layout:'column', ??
columnWidth:.150,
layout: 'form', ??
xtype:'fieldset',
title: 'Opće informacije',
autoHeight:true,


While in development, remove the doctype (especially strict).

Did ext-all-debug help with finding event problem ?

lejla
22 Nov 2007, 8:01 AM
thanks, i correct it.. there's no ext debug popup in ie, but with ie's popup with error messages i found that problem is in line 13974 - it counts all lines including those form included ext's .js files.. i don't thing i should change ext's files..

hendricd
22 Nov 2007, 8:04 AM
Have you installed the Windows Script debugger (for IE) you'll need it.