Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Adding "Sticky Headers" to the Vaadin component library?

Max Hellstrand
10 years ago Mar 02, 2012 9:08am

Hi!

I've come across a navigation strategy used by YouTube (in your "Subscriptions" view) and on Bootstrap among others.

Apparently it's called "Sticky Headers" and what it is is a navigation bar that anchors to the main navigation bar as you scroll. Please try it for yourself on Bootstrap.

My question is if anyone could have an idea of if it would be possible implement it using Vaadin in its current form or if it could be a good idea to add it to the Vaadin component library?

What do you think of that?

Best regards
/Max

Last updated on Mar, 2nd 2012
Henrik Paul
10 years ago Mar 05, 2012 1:30pm

Vaadin doesn't have built in. But it's technically possible to do one yourself as a widget. This will require GWT programming, and admittedly, it probably will not be all too trivial to accomplish. But it's definitely possible.

Just to give some implementation ideas: you might benefit from the source code of MenuBar (since it's already a header bar, albeit with a slightly different function). Then you'd need a functionality to listen for the scroll position - this gets a bit trickier since there's slight differences between how scrolling works in servlets and portlets (would you want to support both). And the last thing that you need are some anchor points that can be placed, which indicate which part of the page the browser currently is in.

Max Hellstrand
9 years ago Jun 07, 2012 10:05am