Sunday, September 26, 2010

Re: DockLayoutPanel inside custom DecoratorPanel

Hi Thomas,

My apologize for replying so late. Life brought me off my computer and
gwt for a while.

First, This post should follow this thread:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/b87f2f018605f7ed/7900e9bfe4a96061?lnk=gst&q=docklayoutpanel+inside+custom#7900e9bfe4a96061
That was a mistake from me and new one was created.

Secondly,
your comment sounds interesting, so, without re-reading the previous
post, a gave a try (see code bellow).

But, unfortunately, it doesn't solve the problem.
However:

1) I could now better understand the previous thread and the use of
RequiresResize and ProvideResize.

2) Thanks to another thread "How to handle properly the height in %?":
(http://groups.google.com/group/google-web-toolkit/browse_thread/
thread/8254e30836bd58fa/7f9c279abbf2b034#7f9c279abbf2b034
)
I could better understand a comment made by Will which say:
"Every document I read says that height=100% is not reliable with a
table in standards mode which is required for flow layout. I tried
all of the flow layout classes and each one had rendering trouble
inside a table with height=100%."

3) So, I've also tried to set only the height in pixel
(indexPanel.setSize( "100%", "300px" )), and, of course, it works.


As a "sort-of-conclusion":
a) thanks, I could improve my understanding of gwt

b) it seems that a lots of panels (ones using a html table) have
problems to deal properly with height=100%.

c) but problems arises also with panels which shouldn't (like
DockLayoutPanel which is supposed to use <div>)...
as soon as it has to render a Panel which use table/cell (like
DecoratorPanel)?


Best regards,
Be happy!

jeanluc

On Jul 21, 3:05 pm, Thomas Broyer <t.bro...@gmail.com> wrote:
> On 20 juil, 14:00, Jean-luc Chasseriau <jean...@kernub.net> wrote:
>
>
>
>
>
>
>
>
>
> > Hi all,
>
> > I'm getting the same behavior, only the north part of the DockLayoutPanel is
> > displayed.
> > Need to set DockLayoutPanel's height in pixel to make it work.
>
> > Running gwt 2.1.0 M2, here is the structure:
>
> > Menu extends Composite
> >   Menu() {
> >     panel = new FlowPanel();
> >     panel.add( new HTML( "menu" ) );
> >     initWidget( panel );
> >   }
>
> > Application extends Composite
> >   Application() {
> >     indexPanel = new DockLayoutPanel( PX );
> >     indexPanel.addNorth( new HTML("north blah"), 50 );
> >     indexPanel.addWest( new HTML("west blah"), 50 );
> >     indexPanel.addEast( new HTML("east blah"), 50 );
> >     indexPanel.add( new Menu() );
>
> >     appDecorator = new DecoratorPanel();
> >     appDecorator.setWidget( indexPanel );
> >     appDecorator.setStylePrimaryName( "custom_decorator" );
>
> >     initWidget( appDecorator );
> >   }
>
> > RootLayoutPanel.get().add( new Application() );
>
> > Few tests:
> > 1) this code, not more: the custom_decorator is displayed, without "center",
> > with "north" overwriting in the borders.
>
> > 2) adding: appDecorator.setSize( "100%", "100%" );
> >     the decorator is properly rendered, and the center is 100%,100%, but,
> > only "north" is displayed from the DockLayoutPanel
>
> > 3) adding: indexPanel.setSize( "100%", "100%" ); AND appDecorator.setSize(
> > "100%", "100%" ); => same as (2)
>
> > 4) adding: indexPanel.setHeight( "100%"); AND appDecorator.setSize( "100%",
> > "100%" ); => same as (2)
>
> > 5) adding: indexPanel.setSize( "300px", "300px" ); AND appDecorator.setSize(
> > "100%", "100%" );
> >     finally! DockLayoutPanel is rendered!
>
> > Conclusion:
> > Need to fix the height in PIXEL to get it work properly.
>
> > GWT team?
>
> http://code.google.com/intl/fr-FR/webtoolkit/doc/latest/DevGuideUiPan...
> Search for "Using a LayoutPanel without RootLayoutPanel", then look
> for "RequiresResize and ProvidesResize", which says:
> """The purpose of these two interfaces is to form an unbroken
> hierarchy between all widgets that implement RequiresResize and the
> RootLayoutPanel, which listens for any changes (such as the browser
> window resizing) that could affect the size of widgets in the
> hierarchy."""
> => keywords: "unbroken hierarchy"
>
> In your case, maybe you could just implement RequiresResize on your
> Application composite to delegate to indexPanel.onResize(), and give
> both your widgets a size of 100%.

--
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-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment