@jgw,

Now that my TabLayoutPanel is working (thanks, btw), I want to go back
to using LayoutPanel and <g:layer>. The problem is, my UI requires a
few layers that nest nicely together like the old VerticalPanel (one
above the other as you go down the page). Using a LayoutPanel with
layers, my UI components now sit "one above the other" as in "right on
top of each other".

Now that VerticalPanel and HorizontalPanel are on the way out, do I
now I have to worry coding my own CSS to replicate the functionality
that VerticalPanel had built in? It is not apparent how I should make
layers gang up either vertically or horizontally without sitting right
on top of each other.

Stuart


On Tue, Dec 1, 2009 at 7:51 AM, Stuart Moffatt <stuartmoff...@gmail.com> wrote:
> Thanks Joel.
> My current workaround is to use the "old" Horizontal/VerticalPanel widgets,
> so "no harm, no foul". Looking forward to more examples!
> Stuart
>
> On Mon, Nov 30, 2009 at 12:20 PM, Joel Webber <j...@google.com> wrote:
>>
>> Stuart,
>> Hiding/showing layers is slightly tricky (or at least non-obvious). I'm
>> still working on examples in the documentation that should make it a lot
>> clearer.
>> In a nutshell, you need to actually show/hide the layer elements
>> themselves. You can get the layer's element (referred to as a widget's
>> "container" element) using *LayoutPanel.getWidgetContainerElement(Widget).
>> Showing/hiding this element rather than the widget itself should get rid of
>> any event problems. I'll make a point to add an example of this to the
>> documentation.
>> I didn't want to require the existence of the elements, but it proved
>> impossible to support arbitrary CSS any other way (the existence of these
>> elements makes it possible to efficiently account for margins, borders, and
>> padding on the child widgets' elements).
>> Cheers,
>> joel.
>> On Thu, Nov 26, 2009 at 2:33 AM, Stuart Moffatt <stuartmoff...@gmail.com>
>> wrote:
>>>
>>> Env: GWTRC2 Safari Mac OS X.
>>>
>>> UI binding:
>>> {{{
>>> <g:LayoutPanel ui:field="layoutPanel">
>>> <g:layer>
>>>        <myclient:MyEditor ui:field='myEditor'/>
>>> </g:layer>
>>>  <g:layer>
>>>        <myclient:MyLister ui:field='myLister'/>
>>> </g:layer>
>>> </g:LayoutPanel>
>>> }}}
>>>
>>> These two custom widgets sit right on top of each other visually. The
>>> reason is I want them to "replace" each other. Since MyLister is added
>>> last, I can trigger events from it. When I fire a certain event from
>>> MyLister, MyLister hides via setVisible(false) and MyEditor displays
>>> via setVisible(true) However, because MyEditor is a layer "below"
>>> MyLister, all events are hidden. E.g. onClick in widget in MyEditor
>>> does not fire.
>>>
>>> Is there any way (declaratively or programmatically) to swap the
>>> positions of the layers so that the visible layer is "on top" and can
>>> respond to events?
>>>
>>> sfm
>>>
>>> --
>>> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>>
>> --
>> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to