PDA

View Full Version : DataView example



mikelindsey
4 Oct 2010, 12:38 PM
Hello,

I have two tab pages open. One tabpage has a dataview in the center region of a panel with border layout.
I've set the panel that contains the dataview set to autoscroll and layout fit

It all works perfect when the store loads - the dataview scrolls vertically if there is overflow.

The problem is that if I close the second tab (that doesn't have a dataview) the tab that is still open and that has the dataview gets refreshed and the scrollbar disappears. The height on the containing panel as well
as the dataview expands (to a size that accommodates all images) and I can't see the image records that are at the bottom.

This is not specific to the dataview. It's an issue with the center region expanding when another tabpage is closed.

I proved this by swaping the two regions - it's the center panel that always expands when the second tab page is closed.

Any advice is appreciated.

Mike

darthwes
4 Oct 2010, 12:44 PM
start by getting rid of fit layout ...

mikelindsey
4 Oct 2010, 1:23 PM
I tried that - didn't work.

I little higher view is this:
TabPanel
TabPage
TabPanel
tabpage with border layout
west panel
center panel with border layout
north panel
center panel with layout 'auto' that contains a dataview

When I close an unrelated second tabpage (not the one outlined above) I noticed that the size of the top center panel expands vertically to be larger than the tabpage vertical height and and along with it the inner center panel gets expanded vertically outside of the viewable area.

So closing a tab page seems to be perfoming a layout on the new active tab page and scrapping any height config on the active tab when it does so.

mikelindsey
4 Oct 2010, 1:34 PM
Figured it out -

I need to specify a height here:

TabPanel
TabPage
TabPanel <---HERE
tabpage with border layout
west panel
center panel with border layout
north panel
center panel with layout 'auto' that contains a dataview

Thanks

Animal
4 Oct 2010, 10:46 PM
You don't need to specify height if you are using layouts correctly.

What's this TabPage thing?

mikelindsey
5 Oct 2010, 8:59 AM
Hey Animal,

Yeah - no surprise there.
I plan to revisit layouts when I have some time.


"Tabpage" is really just an item on my TabPanel.

Animal
5 Oct 2010, 10:06 AM
So you need a TabPanel as an item of a TabPanel?

steffenk
5 Oct 2010, 10:13 AM
as Animal says: if you have to set dimensions by yourself you know that you did something wrong. Either you have overnesting or parent has wrong layout (or no layout).
The best try first is to get rid of unneeded wrapper panels.

mikelindsey
5 Oct 2010, 11:03 AM
So you need a TabPanel as an item of a TabPanel?

Yep

Animal
5 Oct 2010, 12:38 PM
So it looks like an overnest.

Do NOT think of putting a Component IN a tab.

USE a Component AS A tab.

Just add the TabPanel.

mikelindsey
5 Oct 2010, 12:51 PM
So it looks like an overnest.

Do NOT think of putting a Component IN a tab.

USE a Component AS A tab.

Just add the TabPanel.

Thanks Animal - yes - I'm pretty careful about not nesting unless it's necessary.