How to expose table widget to presenter in MVP pattern with gwt -


in mvp pattern widget (the view) exposes widgets in form this:

@override     public hasclickhandlers getaddissueclickhandlers() {             return addissuebutton;         } 

and like:

@override public hastext gettaskname() {     return taskname; // taskname label } 

to allow presenter modify view or values widget. however, uncertain how table widget, flextable or celltable in order presenter modify table. ideas appreciated. thanks.

not gwt widgets designed these interfaces (i.e. hasclickhandlers, hastext, iswidget, etc) in mind.
in recent gwt versions basic widgets changed implement these interfaces in order make views use them testable in unit tests. not sure if flextable implements these interfaces in case of celltable can use hasdata interface.

here can find interfaces implemented celltable: javadoc

i expose celltable via hasdata interface, can used set , retrieve selectionmodel (for selecting rows in celltable).
modifying or updating data displayed in celltable, use listdataprovider , store in presenter.

@override     public hasdata getcelltabledisplay() {             return celltable; } 

and in constructor of presenter can create listdataprovider , use adddatadisplay function add celltable:

final listdataprovider<string> dataprovider = new listdataprovider<string>(); dataprovider.adddatadisplay(getview().getcelltabledisplay); 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -