Pages

Friday, June 26, 2009

How to get multiple root panel in Google Web Toolkit

RootPanel.get().add(Widget w);

this is the initial code for a GWT application. Till now I was using only this. But just few days ago I learned a very nice trick. In short, You can get multiple root panel in your one GWT application. If your welcome.html is like follows

<html...........
<head.........
</head

<body.........

<table>
        <tr>
                 <td id ='mytabledata1'></td>
                 <td id='mytabledata2'></td>
         </tr>


              then you can get two root panels like RootPanel.get("mytabledata1") and RootPanel.get("mytabledata1")

this thing would be very much helpful when you are using a webpage template. Just define in which area you want AJAX to play and pick them with GWT

No comments:

Post a Comment