Hai......
I tried to make an Rpc Grid on a button click through Rpc Method But I cannot return values from on success Method. method is calling before values are loaded from server please help me to resolve this problem

Here is ma code please check this



package com.mycompany.project.client;
import java.util.*;


import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.Style.SelectionMode;




import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.Info;


import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.MarginData;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;


import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;






import com.mycompany.project.client.model.AddData;
import com.mycompany.project.client.model.BeanModelType;


import com.mycompany.project.client.services.FeedService;
import com.mycompany.project.client.services.FeedServiceAsync;
//import com.mycompany.project.client.windows.FeedWindow;
import com.mycompany.project.shared.model.Feed;
import com.mycompany.project.shared.model.State;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.Style.IconAlign;


import com.extjs.gxt.ui.client.widget.layout.CenterLayout;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.FileUploadField;
import com.extjs.gxt.ui.client.widget.form.FormPanel.Encoding;
import com.extjs.gxt.ui.client.widget.form.FormPanel.Method;


import com.extjs.gxt.ui.client.widget.grid.CheckBoxSelectionModel;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;




import com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar;


import com.extjs.gxt.ui.client.data.BasePagingLoader;


import com.extjs.gxt.ui.client.data.BaseListLoadResult;
import com.extjs.gxt.ui.client.data.MemoryProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
import com.extjs.gxt.ui.client.data.PagingLoader;
import com.extjs.gxt.ui.client.data.PagingModelMemoryProxy;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;


import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.fx.FxConfig;
import com.extjs.gxt.ui.client.widget.layout.FillLayout;
import com.extjs.gxt.ui.client.Style.Orientation;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;






import com.extjs.gxt.ui.client.Style.Direction;
import com.extjs.gxt.ui.client.widget.layout.FormData;


public class HomePage implements EntryPoint
{
final List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
ColumnModel cm = new ColumnModel(configs);
ListStore<BeanModelType> clientList1=new ListStore<BeanModelType>();

final Grid<BeanModelType> grid = new Grid<BeanModelType>(clientList1, cm);
protected ArrayList valls=new ArrayList();
public ContentPanel mainPanel1 = new ContentPanel();
public PagingToolBar toolBar = new PagingToolBar(10);
public ContentPanel cpc=new ContentPanel();

public ContentPanel mainPanel = new ContentPanel();
public ContentPanel cp = new ContentPanel();

protected ArrayList val=new ArrayList();
public ListStore<BeanModelType> clientList=new ListStore<BeanModelType>();
/*-------------Method for add contents to grid through RPC starts --------------*/
public void createGrid()
{

System.out.print("METHOD DDDDDDDDD");
final FeedServiceAsync feedService =Registry.get(RSSReaderConstants.FEED_SERVICE);

feedService.createNewFeed(new AsyncCallback<Feed>() {

@Override
public void onFailure(Throwable caught)
{


// TODO Auto-generated method stub
Info.display("RSSReader", "Unable to create a new feed");
System.out.print("ERRORRRRRR");

}
@Override
public void onSuccess(Feed result)
{


System.out.println("VAlue FROM SERVERRRRRRRRR"+result.getVal().size());
//ArrayList valls=result.getVal();
PagingModelMemoryProxy proxy = new PagingModelMemoryProxy(TestData.getClients(result.getVal()));
PagingLoader loader = new BasePagingLoader(proxy);
loader.setRemoteSort(true);
clientList = new ListStore<BeanModelType>(loader);
toolBar.bind(loader);
loader.setRemoteSort(true);

grid.reconfigure(clientList, grid.getColumnModel());

}
});



}
/*-------------Method for add contents to grid through RPC Ends --------------*/
/*----------testing RPC---------*/
ListStore<AddData> states = new ListStore<AddData>();
public ListStore<AddData> comboVal(){

final FeedServiceAsync feedService1 =Registry.get(RSSReaderConstants.FEED_SERVICE1);

feedService1.createNewcombo(new AsyncCallback<State> (){


@Override
public void onFailure(Throwable caught) {
System.out.println("Server is not Responding");

}


@Override
public void onSuccess(State result) {


states.add(ComboData.getStates(result.getVal()));
}

});
return states;

}

/*-------RPC Testing Ends------*/

public void grid_Home() throws Exception
{
/**/
}
public void onModuleLoad()
{
Registry.register(RSSReaderConstants.FEED_SERVICE,GWT.create(FeedService.class));
Registry.register(RSSReaderConstants.FEED_SERVICE1,GWT.create(FeedService.class));
/*--------View port data --------*/
Viewport viewport = new Viewport();
viewport.setLayout(new CenterLayout());


final BorderLayout borderLayout = new BorderLayout();
viewport.setLayout(borderLayout);

BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH,80);
northData.setMinSize(100);
northData.setCollapsible(false);
northData.setSplit(false);

HTML headerHtml = new HTML();
headerHtml.setHTML("<h1>Traffic</h1>");
//viewport.add(headerHtml, northData);
BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
centerData.setCollapsible(false);

/*--------Viewport design part ends-------*/

/*---------Panels starting ---------------*/

mainPanel.setHeaderVisible(false);
/*-----------Form panel starts from here-------*/
final FormPanel frmpnlNewFormpanel = new FormPanel();
frmpnlNewFormpanel.setBorders(false);
frmpnlNewFormpanel.setBodyBorder(false);
frmpnlNewFormpanel.setHeight(25);

frmpnlNewFormpanel.setFieldWidth(50);
frmpnlNewFormpanel.setHeaderVisible(false);
frmpnlNewFormpanel.setHeading("New FormPanel");
frmpnlNewFormpanel.setCollapsible(true);
frmpnlNewFormpanel.setEncoding(Encoding.MULTIPART);
frmpnlNewFormpanel.setMethod(Method.POST);




ContentPanel drop = new ContentPanel();
drop.setHeaderVisible(false);
ButtonBar buttonBar_2 = new ButtonBar();

FormPanel formPanel = new FormPanel();
formPanel.setHeading("Error Message");
formPanel.setCollapsible(false);
formPanel.setHeaderVisible(false);
// drop.setHeaderVisible(false);
//Hello obj=new Hello();
//drop.setHeaderVisible(false);
/*combo box*/
ComboBox<AddData> combo = new ComboBox<AddData>();
combo.setEmptyText("Traffic");
combo.setDisplayField("name");
combo.setWidth(565);
// System.out.println("In Rpc:"+comboVal().getCount());
combo.setStore(comboVal());
System.out.println("values are set");
combo.setTypeAhead(true);
System.out.println("values are set 1");
combo.setTriggerAction(TriggerAction.ALL);
final HorizontalPanel form_combobox=new HorizontalPanel();

form_combobox.setSpacing(10);
form_combobox.setHorizontalAlign(HorizontalAlignment.RIGHT);

ContentPanel comboPa = new ContentPanel();
ContentPanel browsePa = new ContentPanel();
browsePa.setButtonAlign(HorizontalAlignment.LEFT);
comboPa.setHeaderVisible(false);

browsePa.setHeaderVisible(false);
frmpnlNewFormpanel.setLayout(new RowLayout(Orientation.VERTICAL));
frmpnlNewFormpanel.add(comboPa);
frmpnlNewFormpanel.add(browsePa);
comboPa.setLayout(new RowLayout(Orientation.VERTICAL));

comboPa.add(combo);
/*----------combo box ends---------*/
//form_combobox.setHeaderVisible(false);
//ContentPanel drop1= comboData();

browsePa.setLayout(new RowLayout(Orientation.VERTICAL));
final FileUploadField flpldfldNewFileuploadfield = new FileUploadField();
flpldfldNewFileuploadfield.addStyleName("audemat-browse");

//form_combobox.add();
//flpldfldNewFileuploadfield.setSize("850", "32");
//Hello obj=new com.mycompany.project.client.combo.Hello();

browsePa.add(flpldfldNewFileuploadfield);

buttonBar_2.setAlignment(HorizontalAlignment.RIGHT) ;
flpldfldNewFileuploadfield.setAllowBlank(false);
flpldfldNewFileuploadfield.setName("file");
flpldfldNewFileuploadfield.setFieldLabel("File");
flpldfldNewFileuploadfield.setFieldLabel("Upload File");
frmpnlNewFormpanel.setAction("/File");
// frmpnlNewFormpanel.add(form_combobox);







ButtonBar buttonBar_1 = new ButtonBar();
buttonBar_1.setSpacing(20);
buttonBar_1.setAlignment(HorizontalAlignment.RIGHT);

Button btnNewButton_4 = new Button("");
btnNewButton_4.addStyleName("audemat-reset");
btnNewButton_4.setWidth(100);
btnNewButton_4.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
flpldfldNewFileuploadfield.reset();
}
});
buttonBar_1.add(btnNewButton_4);
btnNewButton_4.setSize("89px", "30");

Button btnNewButton_5 = new Button("");
btnNewButton_5.addStyleName("audemat-submit");
btnNewButton_5.setWidth(100);
browsePa.add(buttonBar_1);

buttonBar_1.add(btnNewButton_5);
btnNewButton_5.setSize("91px", "30");
//frmpnlNewFormpanel.add(buttonBar_1);
//lblNewLabel.setDirection(Direction.RIGHT);



ButtonBar buttonBar_3 = new ButtonBar();
buttonBar_3.setAlignment(HorizontalAlignment.RIGHT);

Button com = new Button("");
com.addStyleName("audemat-submit");
ButtonBar combo_3 = new ButtonBar();
combo_3.setAlignment(HorizontalAlignment.RIGHT);
//combo_3.add(com);

comboPa.add(combo_3);
com.setSize("92px", "30px");
frmpnlNewFormpanel.add(buttonBar_3);
buttonBar_3.setSize("", "");

mainPanel.add(frmpnlNewFormpanel);
frmpnlNewFormpanel.setHeight("200");



ContentPanel contentPanel = new ContentPanel();
contentPanel.setCollapsible(true);
ContentPanel mainPanel4 = new ContentPanel();
mainPanel4.setHeaderVisible(false);
mainPanel4.setLayout(new CenterLayout());
ButtonBar buttonBar = new ButtonBar();
buttonBar.setAlignment(HorizontalAlignment.CENTER);
buttonBar.setSpacing(25);
Button btnNewButton = new Button("");
btnNewButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {

}
});
btnNewButton.addStyleName("audemat-prepare_light");

btnNewButton.setWidth(100);
btnNewButton.setMenuAlign("c-c?");
btnNewButton.setIconAlign(IconAlign.BOTTOM);
//btnNewButton.mask();
btnNewButton.repaint();
buttonBar.add(btnNewButton);
btnNewButton.setHeight("30");
//buttonBar.disable();
Button btnNewButton_1 = new Button("");
btnNewButton_1.addStyleName("audemat-clean");
btnNewButton_1.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {

}
});


btnNewButton_1.setWidth(100);
buttonBar.add(btnNewButton_1);
btnNewButton_1.setHeight("30");

Button btnNewButton_2 = new Button("");
btnNewButton_2.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {

Prepare obj=new Prepare();
obj.onModuleLoad();
}
});
btnNewButton_2.addStyleName("audemat-prepare");
btnNewButton_2.setWidth(100);
buttonBar.add(btnNewButton_2);
btnNewButton_2.setHeight("30");
/*
Button btnNewButton_3 = new Button("UPLOAD");
btnNewButton_3.setStyleName("arrow-double-left");
btnNewButton_3.setWidth(100);
buttonBar.add(btnNewButton_3);
btnNewButton_3.setHeight("30");
*/
Button btnNewButton_3 = new Button("");
btnNewButton_3.addStyleName("audemat-upload");
btnNewButton_3.setWidth(100);
buttonBar.add(btnNewButton_3);
btnNewButton_3.setHeight("30");

cpc = new ContentPanel();
cpc.setFrame(false);
cpc.setHeight(25);
cpc.setHeaderVisible(false);

cpc.setButtonAlign(HorizontalAlignment.LEFT);
cpc.setHeading("FX Demo");
//cp.setIcon(Resources.ICONS.text());
cpc.setBodyStyleName("pad-text");
cpc.setWidth(200);
cpc.setHeaderVisible(false);
cpc.setBodyBorder(false);
cpc.setBorders(false);
cpc.setBorders(false);
cpc.setBodyBorder(false);
cpc.setStyleAttribute("position", "relative");
cpc.setPosition(10, 10);
cpc.setCollapsible(true);




ContentPanel contentPanels= new ContentPanel ();
mainPanel4.add(buttonBar, new MarginData(10));

/*
*
* SLIDE ENDS
*
*/

/*
*
*
*
*
*/


final Window w = new Window();
w.setPagePosition(1024,0);
w.setPlain(true);
w.setAutoHeight(true);
w.setPlain(true);
w.setFrame(false);
w.setClosable(false);
w.setHeaderVisible(false);
w.setFooter(false);
w.addListener(Events.Render,new Listener<BaseEvent>()
{
public void handleEvent(BaseEvent be)
{
w.setDraggable(false);
}
});

w.setHeading("Slide Window");
w.setLayout(new FitLayout());
RowLayout rl_cpc = new RowLayout(Orientation.VERTICAL);
rl_cpc.setExtraStyle("arrowBtn");
w.setLayout(rl_cpc);



ButtonBar buttonBar_21 = new ButtonBar();
buttonBar_21.setEnableOverflow(false);
buttonBar_21.setAlignment(HorizontalAlignment.CENTER);

Button btnNewButton_51 = new Button("NEW BOOKINGS");
btnNewButton_51.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
HomePage obj=new HomePage ();
obj.onModuleLoad();
}
});
buttonBar_21.add(btnNewButton_51);
btnNewButton_51.setSize("103px", "30");
w.add(buttonBar_21);

ButtonBar buttonBar_11 = new ButtonBar();
buttonBar_11.setAlignment(HorizontalAlignment.CENTER);

Button btnNewButton_41 = new Button("LIVE REPORTS");
btnNewButton_41.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {

HomePageLive obj=new HomePageLive ();
obj.onModuleLoad();
}
});
buttonBar_11.add(btnNewButton_41);
btnNewButton_41.setSize("92", "30");
w.add(buttonBar_11);

ButtonBar buttonBar_31 = new ButtonBar();
buttonBar_31.setEnableOverflow(false);
buttonBar_31.setAlignment(HorizontalAlignment.CENTER);

Button btnNewButton_61 = new Button("HISTORY");
btnNewButton_61.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
HomePageHISTORY obj=new HomePageHISTORY ();
obj.onModuleLoad();
}
});
buttonBar_31.add(btnNewButton_61);
btnNewButton_61.setSize("92", "30");
w.add(buttonBar_31);

ButtonBar buttonBar_41 = new ButtonBar();
buttonBar_41.setAlignment(HorizontalAlignment.CENTER);

Button btnNewButton_71 = new Button("AD RULES");
btnNewButton_71.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
}
});
buttonBar_41.add(btnNewButton_71);
btnNewButton_71.setSize("92", "30");
w.add(buttonBar_41);

ButtonBar buttonBar_51 = new ButtonBar();
buttonBar_51.setAlignment(HorizontalAlignment.CENTER);

Button btnNewButton_81 = new Button("LOG OUT");
buttonBar_51.add(btnNewButton_81);
btnNewButton_81.setSize("92", "30");
w.add(buttonBar_51);
w.setSize(150,200);

w.show();



/*
FormPanel panel = new FormPanel();
panel.setBorders(false);
panel.setBodyBorder(false);
panel.setLabelWidth(55);
panel.setPadding(5);
panel.setHeaderVisible(false);

*/
/*
Button b = new Button("Open", new SelectionListener<ButtonEvent>() {

@Override
public void componentSelected(ButtonEvent ce) {


if (w.isVisible()) {

w.el().slideOut(Direction.RIGHT, FxConfig.NONE);
} else {
w.el().slideIn(Direction.RIGHT, FxConfig.NONE);

}
}


});
buttonBar.add(b);
*/
Button slide = new Button("Slide In / Out", new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
if (w.isVisible()) {

w.el().slideOut(Direction.RIGHT, FxConfig.NONE);
} else {
w.el().slideIn(Direction.RIGHT, FxConfig.NONE);

}
}


});
slide.addStyleName("audemat-round");
slide.setSize(45,45);
buttonBar.add(slide);


ContentPanel for_from=new ContentPanel();
final ContentPanel for_grid=new ContentPanel();

FormPanel formPanel_1 = new FormPanel();
formPanel_1.setAutoWidth(true);
formPanel_1.setHeading("Error Panel");
for_from.setHeaderVisible(false);
formPanel_1.setCollapsible(true);
for_from.add(formPanel_1);
cp.add(for_from);

formPanel_1.setSize("850", "75");

/*--------------------upto here---------------------*/

/*-------------Grid starts Here-------------------*/



ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("CLIENT");
column.setWidth(200);
configs.add(column);
column = new ColumnConfig("name1", "CAMPAIGN", 150);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);

column = new ColumnConfig("name2", "SITE", 100);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);

column = new ColumnConfig("name3", "ADUNIT", 100);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);

column = new ColumnConfig("name4", "START", 100);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);



ColumnModel cm = new ColumnModel(configs);








final Grid<BeanModelType> grid1 = new Grid<BeanModelType>(clientList1, cm);

//Grid grid = new Grid();

grid1.setStyleAttribute("borderTop", "none");
grid1.setAutoExpandColumn("name");
grid1.setAutoExpandColumn("name1");
grid1.setAutoExpandColumn("name2");
grid1.setAutoExpandColumn("name3");
grid1.setAutoExpandColumn("name4");
grid1.setBorders(true);
grid1.setStripeRows(true);
//grid.getView().setAutoFill(true);
//grid.setAutoWidth(true);

cp.setBodyBorder(false);
cp.setHeaderVisible(false);
//cp.setButtonAlign(HorizontalAlignment.CENTER);
cp.setSize(1440,609);
cp.setFrame(true);
cp.setAnimCollapse(false);
cp.setBottomComponent(toolBar);


for_grid.add(grid1);
cp.add(for_grid);
cp.setSize("", "490");


mainPanel.add(cp);


/*
*
* End Of Grid
*
*
*
*
*
*
*/
/*-------------Button Event Starts Here-------------------*/


btnNewButton_5.addListener(Events.Select, new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent be) {

frmpnlNewFormpanel.submit();

List<ColumnConfig> configs = new ArrayList<ColumnConfig>();


ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("CLIENT");
column.setWidth(200);
configs.add(column);
column = new ColumnConfig("name1", "CAMPAIGN", 150);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);


column = new ColumnConfig("name2", "SITE", 100);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);


column = new ColumnConfig("name3", "ADUNIT", 100);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);


column = new ColumnConfig("name4", "START", 100);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);






ColumnModel cm = new ColumnModel(configs);
createGrid();
grid.setStyleAttribute("borderTop", "none");
grid.setAutoExpandColumn("name");
grid.setAutoExpandColumn("name1");
grid.setAutoExpandColumn("name2");
grid.setAutoExpandColumn("name3");
grid.setAutoExpandColumn("name4");
grid.setBorders(true);
grid.setStripeRows(true);
//grid.getView().setAutoFill(true);
//grid.setAutoWidth(true);


cp.setBodyBorder(false);
cp.setHeading("Employee List");
cp.setButtonAlign(HorizontalAlignment.CENTER);
cp.setSize(1440,609);
cp.setFrame(true);
cp.setAnimCollapse(false);
cp.setLayout(new FillLayout(Orientation.VERTICAL));
cp.setBottomComponent(toolBar);
cp.add(grid);
cp.setSize("", "370");


mainPanel.add(cp);




}
});

/*-------------*/




mainPanel1.setHeaderVisible(false);
mainPanel1.setBodyBorder(false);
mainPanel1.setBorders(false);
ContentPanel mainPanel2 = new ContentPanel();
mainPanel2.setHeaderVisible(false);
mainPanel2.setBodyBorder(false);
mainPanel2.setBorders(false);
ContentPanel mainPanel3 = new ContentPanel();
mainPanel3.setHeaderVisible(false);
mainPanel3.setBodyBorder(false);
mainPanel3.setBorders(false);
mainPanel4.setBodyBorder(false);
mainPanel4.setBorders(false);

mainPanel2.setFrame(false);
mainPanel3.setFrame(false);
mainPanel4.setFrame(false);

mainPanel4.setFooter(false);
mainPanel3.setFooter(false);
mainPanel1.setFooter(false);
mainPanel2.setFooter(false);

northData.isHidden();

BorderLayoutData bld_cpc = new BorderLayoutData(LayoutRegion.WEST, 190.0f);
bld_cpc.setMaxSize(100);

viewport.add(mainPanel4, northData);
//viewport.add(mainPanel1, new BorderLayoutData(LayoutRegion.EAST, 40));
viewport.add(cpc, new BorderLayoutData(LayoutRegion.EAST, 40));
viewport.add(mainPanel2, new BorderLayoutData(LayoutRegion.WEST, 40));
mainPanel3.setLayout(new CenterLayout());
viewport.add(mainPanel3, new BorderLayoutData(LayoutRegion.SOUTH, 40));
viewport.add(mainPanel,new BorderLayoutData(LayoutRegion.CENTER));
mainPanel.setHeight("415");

RootPanel.get().add(viewport);

}






}