|
|||||||
![]() |
|
|
Thread Tools |
|
#1
|
|||
|
|||
|
Are there any plans to implement the HasHandlers interfaces to GXT Button (HasClickHandler) and other GXT components like the native GWT widgets?
Example: TestView.java Button button = new Button("Test button");
public HasClickHandlers getTestClickHandlers() {
return button;
}
public TestPresenter(View view, final EventBus eventBus) {
view.getTestClickHandlers().addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
eventBus.fireEvent(new TestAlert());
}
}
}
|
|
#2
|
|||
|
|||
|
I'm interested in this as well. Are there plans to make GXT more MVP-friendly?
|
|
#3
|
|||
|
|||
|
The hasHandlers interface are not making GXT anymore MVPfriendly. You can do the same with GXT since the beginning. There are no plans to add them
|
|
#4
|
|||
|
|||
|
Pardon my ignorance, but how would you suggest the above code be written when using GXT's Button class?
|
|
#5
|
|||
|
|||
public TestPresenter(View view, final EventBus eventBus) {
view.getComponent().addListener(Events.Select, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEventce) {
eventBus.fireEvent(new TestAlert());
}
}
}
|
|
#6
|
|||
|
|||
|
Instead of the eventbus from GWT you can even use the Dispatcher that is shipped with GXT, also since very long
![]() |
|
#7
|
|||
|
|||
|
GXT should use interfaces like GWT does. Not implicitly HasClickHandlers, but there are much other which were easy to implement: e.g.
(At the moment, this is impossible. see http://www.extjs.com/forum/showthread.php?t=76756 and http://www.extjs.com/forum/showthread.php?t=63053) |
|
#8
|
|||
|
|||
|
Quote:
Thoughts? |
|
#9
|
|||
|
|||
|
This would go a long way towards integrating GXT with other 3rd party GWT libraries.
|
|
#10
|
||||
|
||||
|
I also vote for implementing those GWT interfaces in GXT.
As long as MVP pattern becoming more popular in let say "GWT world", different aproach to handling events and obtaining values from GXT widgets seems to be not very practical and confusing, especially when using other widget libraries. GXT should help us to apply good programing patterns.
__________________
Marcin Misiewicz |
![]() |
| Thread Tools | |
|
|