Tuesday, November 6, 2012

Re: Toggle Visibility of a Sidebar Element

Hi,
actually this should work

class MyDockLayoutPanel extends DockLayoutPanel {

        public MyDockLayoutPanel(Unit unit) {
            super(unit);
        }
  
        public void resizeWidget(Widget w, double newSize) {
           
            //XXX ensure it is a widget added to this this layoutpanel
 
            LayoutData ld = (LayoutData) w.getLayoutData();
            ld.size = newSize;
            forceLayout();
        }
               
    }


use newSize=0 to hide.

I remember I used somewhere a similar code but i never really found why LayoutData has been left protected in DockLayoutPanel
and if this approach has to be avoided.

Ciao.




On Tue, Nov 6, 2012 at 10:01 PM, Manuel <develop.mash@gmail.com> wrote:
Hey,

I try to toggle the visibility of a Element. But I dont get a resizing done :(

I use a DockLayoutPanel:
In the WEST I got a "Sidebar". In the CENTER I got a Frame...

I made the Sidebar invisible via: DOM.setStyleAttribute(SideBar.getElement(), "display", "none");

But the CENTER dont take the free space. (DOM.setStyleAttribute(CenterFrame.getElement(), "position", "relativ"); didnt worked)



Via Firebug i found out, that the center is wrapped in a div-tag that I cannot manipulate.

So anyone know whats the propper way, to make the Sidebar visible/invisible ?

Help is much appreciated.

Thanks in advanced.

Regards


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/JKvAUUjMYO4J.
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.

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