Tuesday, August 6, 2013

Resize SimpleLayoutPanel issues.

I have a scenario. Wherein I am adding custom widgets to a Vertical Panel. I use Activites and Places btw. 

The way I am doing that is I have a VerticalPanel VP1 wherein I create a new SimpleLayoutPanel as a container and pass that SimpleLayoutPanel as a widget to the subsequent child activity so that the child activitiy's View can be rendered inside that SimpleLayoutPanel using AcceptsOneWidget.set() in the start method of child activity class. I basically add each instance of SimpleLayoutPanel container to my VerticalPanel VP1. 

The only way I can see all of my widgets is I need to ensure I provide the height to my SimpleLayoutPanel. So it works fine. 

Currently the child widget has a header and a footer panel. I have a View button in my header wherein I show my footer visible. I have a Close button in my Footer panel view which on click hides the footer. 

But the problem I have is since my parent view's SimpleLayoutPanel container I have already given size (header panel height + footer panel height), It creates a blank space when the child view's footer panel is close. 

Is there a way I can resize my parent view SimpleLayoutPanel container?

This is what it looks like:


##########################################
  ------------------------------------------------------------------     #
  |  Header 1                         View                  |    #
  ------------------------------------------------------------------    #
  | Footer 1                           Close                 |   #       
  ------------------------------------------------------------------   #
                                                                       #
  ------------------------------------------------------------------   #
  | Header 2      View                                      |   #
  ------------------------------------------------------------------   #
  | Footer 2                               Close             |   #
  ------------------------------------------------------------------   #
##########################################


When Close is clicked I still see the big space. 
##########################################
  ------------------------------------------------------------------     #
  |  Header 1                         View                  |    #
  ------------------------------------------------------------------    #
                                                                       #       
                                                                       #       
                                                                       #
  ------------------------------------------------------------------   #
  | Header 2      View                                      |   #
  ------------------------------------------------------------------   #
                                                                       #       
                                                                       #       
                                                                       #
 ##########################################


What I want is when Close button is clicked it should collapsed and remove that big space of footer in between:

##########################################
  ------------------------------------------------------------------     #
  |  Header 1                         View                  |    #
  ------------------------------------------------------------------    #
                                                                       #
  ------------------------------------------------------------------   #
  | Header 2      View                                      |   #
  ------------------------------------------------------------------   #
##########################################


Any suggestions? 

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment