View Full Version : Namespace collision in LayoutDialog?

5 Dec 2006, 8:22 AM
Hi Jack,

Great work with this library - I am so impressed!

Anyway, I believe I detected a namespace collision that affects the LayoutDialog when using a center layout region.

Basically, adding such a region overwrites the center() function of the BasicDialog, which in turn breaks things like resizeTo() when fixedcenter:true.

The problem seems to result from merging the layout configuration with the dialog configuration. Perhaps it would be best to keep the two as separate objects.


5 Dec 2006, 8:34 AM
Can you post a sample? Are you using the latest code (RC3)?

I'm using a pretty complex 5 panel layout with both contentpanels and gridpanels inside and a resizable Dialog without problems.

5 Dec 2006, 9:03 AM
No, that sounds feasible. The BasicDialog constructor does a

YAHOO.ext.util.Config.apply(this, config);

Which, if there is a "center" property in the config will create a "center" property in that instance of BasicDialog.

Perhaps the method should be changed to centerDialog.

5 Dec 2006, 9:11 AM
Yeah, but that could be said of any 'property' that somebody dumps into config. What if I say addButton:'myBtn'. That's going to hammer the addButton method.

Am I missing something here??

6 Dec 2006, 12:23 AM
Yes and no. The thing is, "center" is a valid config property and an existing method.

6 Dec 2006, 8:19 AM
Isn't the property name 'fixedcenter'?

7 Dec 2006, 12:16 AM
A LayoutDialog inherits the setup config of a BorderLayout as well as the config of a BasicDialog. ie regions. One of which is "center". It also has a center() method.

7 Dec 2006, 7:11 AM
Ahh...gotcha - adding to my list for Jack.