Monday, October 25, 2010

Re: adding a DockLayoutPanel to a SimplePanel?

I faced the same problem with LayoutPanel inside SimplePanel.
For now, the only workaround a found is the same than the one proposed
by Jeff, except that I extends the LayoutPanel.

On 25 oct, 16:48, Jeff Larsen <larse...@gmail.com> wrote:
> One option would be to extend AbsolutePanel and have it implement
> AcceptsOneWidget.
>
> I'm using MVP4g, so I'm not that familiar with the new Activity based
> MVP architecture in 2.1.
>
> On Oct 25, 2:14 am, Tamer Sezgin <tamer.sez...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi Jeff, thank you for the quick response.
>
> > Just as you described, I want to remove SimplePanel, and
> > use DockLayoutPanel.
> > But *ActivityManager.setDisplay()* method only accepts *AcceptsOneWidget* as
> > the display parameter.
> > And it seems this interface is only implemented by SimplePanel and its
> > subclasses, though DockLayoutPanel extends ComplexPanel.
>
> > So, it is actually ActivityManager that enforces using SimplePanel, and I
> > couldn't understand the reason for this and how to avoid it to achieve my
> > goal of using DockLayoutPanel.
>
> > thanks,
>
> > On Mon, Oct 25, 2010 at 3:17 AM, Jeff Larsen <larse...@gmail.com> wrote:
> > > Layout panels prefer to be nested inside of layout panels, there are
> > > other ways around this ( you found one). This is one of the reasons
> > > why when using LayoutPanels you need to attach them to
> > > RootLayoutPanel.get() instead of RootPanel.get().
>
> > > So to answer your question, change the HelloMVP example to remove the
> > > SimplePanel and just use our DockLayoutPanel instead or you could swap
> > > the SimplePanel for a Layout panel. Then just attach it to a
> > > RootLayoutPanel
>
> > > seehttp://code.google.com/webtoolkit/doc/latest/DevGuideUiPanels.html
> > > for more info.
>
> > > On Oct 24, 5:37 pm, Tamer Sezgin <tamer.sez...@gmail.com> wrote:
> > > > Hello,
>
> > > > I'm currently working on the HelloMVP application that comes with RC1
> > > > release, to understand the new MVP framework.
> > > > There, ActivityManager.setDisplay(AcceptsOneWidget display) is called
> > > with a
> > > > SimplePanel parameter (called appWidget).
>
> > > > In my case, I want to use a main view that is implemented using
> > > >  DockLayoutPanel as the main widget.
> > > > So, at runtime, when my view is to be displayed, MVP framework adds my
> > > > DockLayoutPanel to the SimplePanel (appWidget) used by the
> > > ActivityManager.
>
> > > > But the problem is, somehow at runtime the DockLayoutPanel's
> > > > *style*attributes is set to "
> > > > *position: relative*" value and my view is not displayed at all.
>
> > > > When I change this attribute manually (using the inspect element window)
> > > to
> > > > "position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;" it is
> > > > displayed as expected.
>
> > > > What's the recommended way of handling this issue?
>
> > > > thanks,
> > > > Tamer.
>
> > > --
> > > 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<google-web-toolkit%2Bunsubs cribe@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-web-toolkit?hl=en.

--
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