PDA

View Full Version : [CLOSED][3.0.0] Child controls of a FormPanel not displaying for second show() call.



BrianDeacon
5 Oct 2009, 12:15 PM
Ext version tested:


Ext 3.0 rev 0



Adapter used:


ext




css used:


only default ext-all.css





Browser versions tested against:



FF3 (firebug 1.4.3 installed)



Operating System:


OS X 10.5



Description:


When a FormPanel is part of an Ext.Window dialog, child controls on the
FormPanel are not rendered the second time a new instance of the Ext.Window
has show() called on it.



Test Case:




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="http://www.extjs.com/deploy/dev/resources/css/ext-all.css (http://www.extjs.com/forum/view-source:http://www.extjs.com/deploy/dev/resources/css/ext-all.css)" />
<script type="text/javascript" src="http://www.extjs.com/deploy/dev/adapter/ext/ext-base.js (http://www.extjs.com/forum/view-source:http://www.extjs.com/deploy/dev/adapter/ext/ext-base.js)"></script>
<script type="text/javascript" src="http://www.extjs.com/deploy/dev/ext-all.js (http://www.extjs.com/forum/view-source:http://www.extjs.com/deploy/dev/ext-all.js)"></script>


<script type="text/javascript">
Ext.onReady(function(){

Ext.namespace("Brian.repro");


Brian.repro.Repro = function(cfg) {

var combo = new Ext.form.ComboBox();
var checkBoxes = this.checkBoxes = [
new Ext.form.Checkbox({boxLabel: 'Eeny', id: 'Eeny'}),
new Ext.form.Checkbox({boxLabel: 'Meeny', id: 'Meeny'}),
new Ext.form.Checkbox({boxLabel: 'Miney', id: 'Miney'}),
new Ext.form.Checkbox({boxLabel: 'Moe', id: 'Moe'})];
var formPanel = this.formPanel = new Ext.form.FormPanel({
items: [
{xtype: 'checkboxgroup',
id: 'someCheckBoxes',
fieldLabel: 'Some Checkboxes',
items: checkBoxes
}


]
});

Brian.repro.Repro.superclass.constructor.call(this, {
height: 200,
width: 400,
modal: true,
title: "Does Stuff render a second time?",
layout: 'fit',
closeAction: 'hide',
items: this.formPanel,

keys: {
key: 27,
fn: this.hide,
scope: this
},
buttons: [{
text: 'Close',
handler: function(){this.hide()},
scope: this
}]
});



};


Ext.extend(Brian.repro.Repro, Ext.Window, {});

}); //end onReady



function showDialog() {
new Brian.repro.Repro().show();
}
</script>
</head>
<body>
<a href="# (http://www.extjs.com/forum/view-source:file:///Users/bdeacon/Documents/Repro.html#)" onclick = "showDialog();">The second time you click this, the contained controls won't render.</a>
</body>
</html>


Steps to reproduce the problem:


Click the hyperlink, dismiss the dialog. Click the hyperlink again.



The result that was expected:


Checkboxes should be displayed every time.




The result that occurs instead:


Checkboxes only show up the first time.

evant
5 Oct 2009, 1:22 PM
This isn't a bug. Id's need to be unique across the page.

Since you're using closeAction hide, when you recreate the window, controls already exist with those ids.

Either:
a) Destroy the window
b) Don't use an id on the controls

Marking as closed.