Hi everyone,
I'm getting started with SmartGWT EE and I'm stuck now for quite a time on an app-design-widget-communication-problem and looking for a best practice advice.
System:
- SmartGWT EE 2.4 evaluation version
- Eclipse Indigo
- GWT 2.3
- SQL Server 2005, Windows 2008 Server
- sqljdbc_3.0.1301.101 from http://www.microsoft.com/downloads/de-de/details.aspx?familyid=a737000d-68d0-4531-b65d-da0f2a735707&displaylang=de
- Tomcat 7.0 (nothing deployed there yet, only hosted mode so far)
- FF 5.01
I build a nice app mockup so far with a navigation pane left and a main window with tabs right.
They are created from the onModuleLoad like this
The NavigationArea class looks like this:
Now from onModuleLoad() I can't access the public members of navigationArea. Eclipse does not offer them as auto-complete. I can't neither access the "StammdatenTreeGrid" member nor the "nothing" method.
My question is:
What is the best practice for communicating between widgets?
Is there a document on this? What am I doing wrong in my example?
Thanks a lot,
Blama
I'm getting started with SmartGWT EE and I'm stuck now for quite a time on an app-design-widget-communication-problem and looking for a best practice advice.
System:
- SmartGWT EE 2.4 evaluation version
- Eclipse Indigo
- GWT 2.3
- SQL Server 2005, Windows 2008 Server
- sqljdbc_3.0.1301.101 from http://www.microsoft.com/downloads/de-de/details.aspx?familyid=a737000d-68d0-4531-b65d-da0f2a735707&displaylang=de
- Tomcat 7.0 (nothing deployed there yet, only hosted mode so far)
- FF 5.01
I build a nice app mockup so far with a navigation pane left and a main window with tabs right.
They are created from the onModuleLoad like this
Code:
public void onModuleLoad() {
Window.setMargin("0px");
// main layout occupies the whole area
mainLayout = new VLayout();
mainLayout.setWidth100();
mainLayout.setHeight100();
navigationArea = new NavigationArea();
navigationArea.setWidth("15%");
mainArea = new MainArea();
mainArea.setWidth("85%");
navigationPlusMain = new HLayout();
navigationPlusMain.setMembers(navigationArea, mainArea);
mainLayout.addMember(navigationPlusMain);
mainLayout.draw();
// add the main layout container to GWT's root panel
RootLayoutPanel.get().add(mainLayout);
Code:
public class NavigationArea extends HLayout {
public StammdatenTreeGrid stammdatenTreeGrid;
public void nothing() {
};
public NavigationArea() {
super();
this.setMembersMargin(20);
this.setOverflow(Overflow.HIDDEN);
this.setShowResizeBar(true);
SectionStack sectionStack = new SectionStack();
sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
sectionStack.setShowExpandControls(true);
sectionStack.setAnimateSections(true);
sectionStack.setVisibilityMode(VisibilityMode.MUTEX);
sectionStack.setOverflow(Overflow.HIDDEN);
SectionStackSection sectionStammdaten = new SectionStackSection(
"Stammdaten");
sectionStammdaten.setExpanded(true);
stammdatenTreeGrid = new StammdatenTreeGrid();
stammdatenTreeGrid.setHeight100();
sectionStammdaten.addItem(stammdatenTreeGrid);
SectionStackSection sectionAdmin = new SectionStackSection(
"SmartGWT Admin");
sectionAdmin.setExpanded(false);
IButton adminButton = new IButton("Admin Console");
adminButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
com.smartgwtee.tools.client.SCEE.openDataSourceConsole();
}
});
IButton generatorButton = new IButton("DS Generator");
generatorButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
com.smartgwtee.tools.client.SCEE.openDataSourceGenerator();
}
});
sectionAdmin.addItem(adminButton);
sectionAdmin.addItem(generatorButton);
sectionStack.addSection(sectionStammdaten);
sectionStack.addSection(sectionAdmin);
this.addMember(sectionStack);
}
}
My question is:
What is the best practice for communicating between widgets?
Is there a document on this? What am I doing wrong in my example?
Thanks a lot,
Blama
Comment