PDA

View Full Version : LayoutContainer vs FormPanel



cpopp
19 Aug 2009, 5:10 AM
Just getting started with GXT. I'm laying out the various components within a TabItem. I want to use a couple of radio buttons to control some behavior.

I found I can create a LayoutContainer and add the buttons directly into the LayoutContainer. However, I can also create a small FormPanel, add the buttons to the Panel and then add the Panel to the LayoutContainer.

What are the advantages/disadvantages of each approach? I don't want to go down the wrong path and have to fix a bunch of bad decisions later.

I guess I'm really trying to figure out when to use a Container object vs a Panel object as they appear to do very similar things to me.

Thanks

sven
19 Aug 2009, 5:13 AM
If you dont need a formpanel, than oyu can just use a layoutcontainer with a formlayout. However, if you need functionalty of the formpanel, than you have to use it.

But you should not nest a formpanel inside a layoutcontainer inside a tabitem. You can directly add the formpanel to the tabitem

cpopp
19 Aug 2009, 5:34 AM
Thanks sven, I think that pointed me in the right direction.

I'm trying to use a couple radio buttons in this Container to change the sort order within a TreePanel. Would I need the functionality of the FormPanel for this, or can a Listener on the buttons in the LayoutContainer work just as well?

sven
19 Aug 2009, 5:36 AM
I guess you dont need a formpanel for that. But you are the only one that could know that because you only know exactly what requirements you have.

cpopp
19 Aug 2009, 5:40 AM
Excellent thanks for the feedback