Unanswered: Reason Behind overriding asWidget() in any view
Unanswered: Reason Behind overriding asWidget() in any view
What is the reason behind overridding asWidget() method of Composite in each and every view..??
If I am not implementing it , Then I am not getting the results according to our requirements..
My Scenario is like,
public Widget asWidget() {
Widget widget = uiBinder.createAndBindUi(this);
---- do something....
activityManager.setDisplay(rightCPanel);
return widget;
}
public GXTMyClaimViewImpl(ClientFactory clientFactory) {
initWidget(uiBinder.createAndBindUi(this));
this.clientFactory = clientFactory;
claimEntriesMapper = new ClaimEntryMapper(clientFactory);
activityManager = new ActivityManager(claimEntriesMapper, clientFactory.getEventBus());
activityManager.setDisplay(rightCPanel);
initializeAll();
}
if I remove the asWidget() den My Code Dosent work...
and I hav to do uiBinder.createAndBindUi(this) fr 2 times.....
If you extend Composite, you *should not* override asWidget() - unpredictable things may happen.
The IsWidget interface and its asWidget method are mostly useful in cases where you choose not to extend Composite or any other Widget class, but still want to be able to draw the contents on the screen.