MenuBar in a Flextable cell

12 views
Skip to first unread message

Sudeep S

unread,
Nov 22, 2009, 10:56:21 AM11/22/09
to google-we...@googlegroups.com
Hi,
 
I have a req wherein I have to add a menubar widget to every row in a flextable. When the menubar is clicked it opens but it also expands the cell in which it is placed distorting the layout.
 
Any ideas on this one.
 
Thanks
Sudeep
 

Brian

unread,
Nov 23, 2009, 9:06:28 AM11/23/09
to Google Web Toolkit
Sounds like a tricky problem. I haven't worked with menu bars so I'm
not sure this will work. What I'm thinking is that you could use a
placeholder menu bar in the table cell that doesn't have any menu
items. Then, when that is clicked on, display a PopupPanel with the
real menu bar and position it relative to the placeholder menu bar.
You may have to play with styling on the PopupPanel to remove any
decoration and/or margins to get the effect right. You'll also have to
capture which menu item (assuming there's more than one) was clicked
on the placeholder and simulate a click on the corresponding item in
the real menu bar.

Or maybe you can do away with the menu bar in the table cell
altogether and make your own drop-down menu using PopupPanels. It
depends on what you're looking for in terms of user interface feel.

-Brian 

Sudeep S

unread,
Nov 23, 2009, 1:12:50 PM11/23/09
to google-we...@googlegroups.com
Thank you for your suggestion.
 
i am trying a similar approach for this one.
 
instead of having a menu bar in the cell i have placed a simple link in the cell and when it is clicked, i capture the cell and the absolute position of link that is clicked.
 
With the absolute position of the link inhand i delete the link and place my menubar at that position.
 
having little trouble with positioning though.
 
thanks
Sudeep

--

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=.



Brian

unread,
Nov 24, 2009, 11:56:00 AM11/24/09
to Google Web Toolkit
I haven't had a need to be too picky about positioning, so I'm not
sure what the tricky conditions are (though I'm sure they're there).
You didn't mention how you're doing your positioning, but I can
imagine you're using either AbsolutePanel or PopupPanel. I had
suggested PopupPanel because it has a showRelativeTo(UIObject) method
that might be helpful. According to the docs, though:

from
http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/user/client/ui/PopupPanel.html#showRelativeTo(com.google.gwt.user.client.ui.UIObject)

"Normally, the popup is positioned directly below the relative target,
with its left edge aligned with the left edge of the target. Depending
on the width and height of the popup and the distance from the target
to the bottom and right edges of the window, the popup may be
displayed directly above the target, and/or its right edge may be
aligned with the right edge of the target."

So it looks like the algorithm that it uses for positioning may be too
variable for your needs.

One final note is that, assuming you manage to cover up the link in
the table cell, you probably don't have to remove it, which might
cause the table to shift around.

-Brian
> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsubs cr...@googlegroups.com>
> > .

Sudeep S

unread,
Nov 24, 2009, 1:58:16 PM11/24/09
to google-we...@googlegroups.com
Thanks a lot for your inputs Brian.
 
Yes I am using an absolute panel for positioning.
 
There seems to be a simple way to deal with this.
 
A menubar inside a menubar did the trick.
 
A menu bar with the list of items is added to a parent menubar and that parent menubar is placed inside the cell. 
 
It works like a charm.
 
thanks for ur suggestions once again
 
Thanks
Sudeep
 
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



Brian

unread,
Nov 25, 2009, 8:41:30 AM11/25/09
to Google Web Toolkit
Ahh, that makes perfect sense. I'm glad there was a nice clean
solution. Thanks for following up with that.

-Brian

On Nov 24, 1:58 pm, Sudeep S <sudee...@gmail.com> wrote:
> Thanks a lot for your inputs Brian.
>
> Yes I am using an absolute panel for positioning.
>
> There seems to be a simple way to deal with this.
>
> A menubar inside a menubar did the trick.
>
> A menu bar with the list of items is added to a parent menubar and that
> parent menubar is placed inside the cell.
>
> It works like a charm.
>
> thanks for ur suggestions once again
>
> Thanks
> Sudeep
>
>
>
> On Tue, Nov 24, 2009 at 10:26 PM, Brian <brian.irei...@gmail.com> wrote:
> > I haven't had a need to be too picky about positioning, so I'm not
> > sure what the tricky conditions are (though I'm sure they're there).
> > You didn't mention how you're doing your positioning, but I can
> > imagine you're using either AbsolutePanel or PopupPanel. I had
> > suggested PopupPanel because it has a showRelativeTo(UIObject) method
> > that might be helpful. According to the docs, though:
>
> > from
>
> >http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/g...)
> > > > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsubs cr...@googlegroups.com><google-web-toolkit%2Bunsubs
> > cr...@googlegroups.com>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-web-toolkit?hl=.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-we...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsubs cr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.
Reply all
Reply to author
Forward
0 new messages