PDA

View Full Version : Header and footers in BorderLayout.



hilbert24
3 Apr 2007, 6:28 AM
Hi,

I am starting with yui-ext libraries, so don't have much experience with it. I am using BorderLayout to design a 2 and 3 column layout with headers and footers. Most of it is taken from given examples. Everything is fine except that the header and footer always remain where they are. I'd like them to move with the page, so that if the user scrolls down, the header goes out of view. Similarly if the page is long, the footer should be shown only after the user has scrolled to bring it into view.

How can I do this?

Thanks,
Hilbert

dfenwick
3 Apr 2007, 6:48 AM
Hi,

I am starting with yui-ext libraries, so don't have much experience with it. I am using BorderLayout to design a 2 and 3 column layout with headers and footers. Most of it is taken from given examples. Everything is fine except that the header and footer always remain where they are. I'd like them to move with the page, so that if the user scrolls down, the header goes out of view. Similarly if the page is long, the footer should be shown only after the user has scrolled to bring it into view.

How can I do this?

Thanks,
Hilbert

Not sure if I'm interpreting what you're asking properly, but I think you have 3 panes, north, center, south, and you want the north and south panes to not be in view when the content is scrolled. If this is what you're asking, it's not how it works. BorderLayout is just that: It lays out the user interface to the borders. Your panes are just a viewport into whatever markup you choose to put into them, but they are set to the sizes you specify and they are anchored to the locations. While they may be expandable and collapsible (at your discretion) they are still there. Think of BorderLayout as HTML frames done right.

There's nothing preventing you from providing headers and footers in your content panels if you so choose to do so. It sounds like you're trying to turn the BorderLayout into a single page. That's not what it's really intended to do.

hilbert24
3 Apr 2007, 11:10 AM
Not sure if I'm interpreting what you're asking properly, but I think you have 3 panes, north, center, south, and you want the north and south panes to not be in view when the content is scrolled. If this is what you're asking, it's not how it works. BorderLayout is just that: It lays out the user interface to the borders. Your panes are just a viewport into whatever markup you choose to put into them, but they are set to the sizes you specify and they are anchored to the locations. While they may be expandable and collapsible (at your discretion) they are still there. Think of BorderLayout as HTML frames done right.

There's nothing preventing you from providing headers and footers in your content panels if you so choose to do so. It sounds like you're trying to turn the BorderLayout into a single page. That's not what it's really intended to do.

Thank you for your reply. You are interpreting it correctly. Putting just headers and footers in a content panel wouldn't be hard, but I don't know how to put them along with a left and right division. I have earlier tried YUI Grids, but wasn't happy because I didn't find it easy to set different background colors in different parts. My thinking was BorderLayout is designed to do that. If it isn't then I'd need to look at something else. I'd appreciate if you can point me to any link you know.:)

Regards,
Hilbert

dfenwick
3 Apr 2007, 12:00 PM
Thank you for your reply. You are interpreting it correctly. Putting just headers and footers in a content panel wouldn't be hard, but I don't know how to put them along with a left and right division. I have earlier tried YUI Grids, but wasn't happy because I didn't find it easy to set different background colors in different parts. My thinking was BorderLayout is designed to do that. If it isn't then I'd need to look at something else. I'd appreciate if you can point me to any link you know.:)

Regards,
Hilbert

Believe it or not, it sounds like you actually DO want the YUI grid (I hate calling it that - Jack's is a grid - the YUI grid is a multi-pane layout). It's not perfect, but it sounds like you're trying to do real document layout of some variety or another. Multiple columns with a header and a footer, etc. Like a docbook layout or something similar.