Re: uiBinder with RootLayoutPanel problem

2010-04-28 Thread kerrr
If you want to inset what your building with the uiBinder model into a
specific bit of html then you will have to use
RootPanel.get(module1).  You don't explain what you are doing to
instantiate and add the uiBinder widget to the RootPanel.  If you had
a widget that was working before trying to port it to the uiBinder
model then how you add it to you page shouldn't change.

--
Kerr

On Apr 27, 4:01 pm, suresh udayasur...@gmail.com wrote:
 I'm porting my gwt module to GWT2.0 UiBinder model. Current GWT
 application is embedded in jsp. Jsp has header which has links to
 other modules and footer and some graphics that can change.

 When I try to use RootPanel, nothing gets displayed except the header
 and footer.
 RootPanel root = RootPanel.get(module1);

 Below is working but I cannot insert headers and footers which are
 shared across the other modules.
 RootLayoutPanel root = RootLayoutPanel.get();

 Here is the jsp file
     table width=100% height=100%
         trtd height=50
          %@ include file=/WEB-INF/jsp/header.jsp %
       /td/tr

         trtd id=module1
         /td/tr

     trtd height=100
         %@ include file=/WEB-INF/jsp/footer.jsp %
     /td/tr
     /table

 Please help me.

 Thanks in advance! Suresh

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



[gwt-contrib] Re: RootLayoutPanel

2010-04-26 Thread kerrr
Hi Joel,

This should demonstrate the the problem.  I have an html page with a
span with id buttonspan.  I add a button to it that, when clicked
will add a LayoutPanel with a couple of widgets to the
RootLayoutPanel.  When I click on the ping widget the
RootLayoutPanel is removed and the button can be clicked again, but
this time the RootLayoutPanel that is retrieved is no longer attached
to the RootPanel and we get an error.

public void onModuleLoad(){

final LayoutPanel lp1=new LayoutPanel();

ClickPanel ping=new ClickPanel(Ping);
ping.getElement().getStyle().setBackgroundColor( #fdd );
ping.addClickHandler( new ClickHandler(){
@Override
public void onClick( ClickEvent event ){
Window.alert( Ping!!! );
RootPanel.remove(RootLayoutPanel.get());
}
} );

ClickPanel bong=new ClickPanel(Bong);
bong.getElement().getStyle().setBackgroundColor( #ddf );
bong.addClickHandler( new ClickHandler(){
@Override
public void onClick( ClickEvent event ){
Window.alert( Bong!!! );
}
} );

lp1.add( ping );
lp1.setWidgetLeftWidth( ping, 100, Style.Unit.PX, 500,
Style.Unit.PX );
lp1.setWidgetTopHeight( ping, 100, Style.Unit.PX, 500,
Style.Unit.PX );

lp1.add( bong );
lp1.setWidgetLeftWidth( bong, 50, Style.Unit.PCT, 600,
Style.Unit.PX );
lp1.setWidgetTopHeight( bong, 50, Style.Unit.PCT, 200,
Style.Unit.PX );

Button b=new Button(Click Me);
b.addClickHandler( new ClickHandler(){
@Override
public void onClick( ClickEvent event ){
RootLayoutPanel.get().add( lp1 );
}
} );
RootPanel.get(buttonspan).add( b );
}

ClickPanel simply overrides HTMLPanel implementing HasClickHandelers.

This is probably never a problem if you build your whole UI from
LayoutPanels, but it creates a problem if you have a layout based on
injecting widgets into elements on the page using
RootPanle.get(foo)... and then want to add some LayoutPanel goodness
for soem part of it.

On Apr 26, 1:09 pm, Joel Webber j...@google.com wrote:
 Kerr,

 Can you show me roughly the code needed to get into this state? It sounds
 like it could be a problem, but I'm having a slightly hard time imagining
 the precise code that got you here.

 Cheers,
 joel.

 Le 15 avril 2010 12:34, kerrr kerr.rai...@gmail.com a écrit :



  Hi,

  I've been playing around with RootLayoutPanel and have some questions
  about how it works.

  I had a UI layed out by placing widgets in lements on a page using
  RootLayout.get(foo).add(widget).  This was fine.  I wanted to try
  adding a LayoutPanel on top to achieve a LightBox style effect.  This
  was all goign well untill I wanted to gt rid of the LayoutPanel.  I
  couldn't work out how to do it.  I removed the LayoutPanel from the
  RootLayoutPanel but none of the underlying ui could be clicked.
  Eventually I discovered that I needed to remove the RootLayoutPanel
  from the RootPanel.  This works but leaves the singleton
  RootLayoutPanel detached and calling RootLayoutPanel.get() again
  simply returns the detached RootLayoutPanel.  Trying to add anything
  to it throws an exception.  You can work around this my reattaching
  the RootLayoutPanel yourself, but this seems a bit ugly.

  So here are my thoughts on an improvement.  Please let me know if
  there is any reason why this would cause a problem.

  1. Have RootLayoutPanel detach itself automatically from its parent if
  all it's children are removed.
  2. Defer attaching the RootLayoutPanel to RootPanel untill a child is
  added to it.

  I'm planning on implementing my own replacement RootLayoutPanel to see
  how it works, but please let me know if there is anything I should
  consider when doing this.

  Cheers
  Kerr

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


[gwt-contrib] RootLayoutPanel

2010-04-24 Thread kerrr
Hi,

I've been playing around with RootLayoutPanel and have some questions
about how it works.

I had a UI layed out by placing widgets in lements on a page using
RootLayout.get(foo).add(widget).  This was fine.  I wanted to try
adding a LayoutPanel on top to achieve a LightBox style effect.  This
was all goign well untill I wanted to gt rid of the LayoutPanel.  I
couldn't work out how to do it.  I removed the LayoutPanel from the
RootLayoutPanel but none of the underlying ui could be clicked.
Eventually I discovered that I needed to remove the RootLayoutPanel
from the RootPanel.  This works but leaves the singleton
RootLayoutPanel detached and calling RootLayoutPanel.get() again
simply returns the detached RootLayoutPanel.  Trying to add anything
to it throws an exception.  You can work around this my reattaching
the RootLayoutPanel yourself, but this seems a bit ugly.

So here are my thoughts on an improvement.  Please let me know if
there is any reason why this would cause a problem.

1. Have RootLayoutPanel detach itself automatically from its parent if
all it's children are removed.
2. Defer attaching the RootLayoutPanel to RootPanel untill a child is
added to it.

I'm planning on implementing my own replacement RootLayoutPanel to see
how it works, but please let me know if there is anything I should
consider when doing this.

Cheers
Kerr

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


Re: Switch RootPanel with RootLayoutPanel

2010-04-15 Thread kerrr
I'm having a similar issue.  I have widgets added to elements using
RootLayout.get(foo).add(widget) but then want to add a Panel on top
using RootLayoutPanel.get().add(layout).  that's all fine, but
removign the LayoutPanel leaves somethign behind that means the
widgets on the page cannot be clicked.  Looking at the generated there
is an extra div left behind.  Is this a bug or am I missing
something?  I'm not keen on raiseing a bug if this is simply a case of
me missunderstanding something.

Cheers
Kerr

On Apr 14, 12:09 pm, gadaleta.marco gadaleta.ma...@gmail.com
wrote:
 Hi,
 I'm trying to switch diinamically RootPanel with RootLayoutPanel and
 viceversa.
 But after the switch, the interface seems to be locked.
 Can you give me an help?

 Thx,
 Marco

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



Re: Switch RootPanel with RootLayoutPanel

2010-04-15 Thread kerrr
Hi,

I've figured out that you need to remove the RootLayoutPanel from the
RootPanel.  You can do this with
RootPanel.get().remove(RootLayoutPanel.get()), or
RootLayoutPanel.get().removeFromParent().

Note that this means that the singlton RootLayoutPanel returned from
RootLayoutPanel.get() will no longer function as it does not get
reattached.  You can work around this by reattaching it to RootPanel
with RootPanel.add(RootLayoutPanel.get());

It would be better if RootLayoutPanel.get() always ensured that it was
attached to RootPanel.get() before returning.  It is also nto very
obvious to a newbie (like me) that simply having RootLayoutPanel
attached will block clicking on anything attached to the RootPanel.
While it is perhaps uncommon for this to occur simply by calling
RootLayoutPanel.get(), a moer common scenario would be adding a
LayoutPanel to the RootLayoutPanel and then removing it.  This leaves
the RootLayoutPanel still attached, bu the underlying RootPanel
inactive.  Wouldn't it be a good idea to automatically detach the
RootLayoutPanel if all of it's children are detached?

Cheers
Kerr

On Apr 15, 2:48 pm, kerrr kerr.rai...@gmail.com wrote:
 I'm having a similar issue.  I have widgets added to elements using
 RootLayout.get(foo).add(widget) but then want to add a Panel on top
 usingRootLayoutPanel.get().add(layout).  that's all fine, but
 removign the LayoutPanel leaves somethign behind that means the
 widgets on the page cannot be clicked.  Looking at the generated there
 is an extra div left behind.  Is this a bug or am I missing
 something?  I'm not keen on raiseing a bug if this is simply a case of
 me missunderstanding something.

 Cheers
 Kerr

 On Apr 14, 12:09 pm, gadaleta.marco gadaleta.ma...@gmail.com
 wrote:

  Hi,
  I'm trying to switch diinamically RootPanel withRootLayoutPaneland
  viceversa.
  But after the switch, the interface seems to be locked.
  Can you give me an help?

  Thx,
  Marco

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