开发者

GWT Activity - Places => DialogBox?

I'm trying to use the GWT Activity & Place model, but I'm having some troubles with it about how to use my activities.

I've got a LoginActivity which drives th开发者_高级运维e user to another activity : DemandsActivity.

My DemandsActivity manages a view ("DemandsView") which displays a simple list of demands (with a CellTable). The whole works fine.

I would like to be able to show the details of a demand, from a selected line of my cellTable, by displaying a DialogBox with the informations. I thought I could use one more activity to do that : DemandDetailsActivity. But I don't know how to do that.

Or I've been wrong from the beginning. Maybe should I put several presenters (displays) into my activity ? One presenter to display my CellTable, and another one to display a selected element of my CellTable in a DialogBox, without changing Place ?

What do you think of that ?

Thanks


What you are trying to do is called master-detail view. People have been implementing it with GWT, just google around.

On a side note: in MVP parlance Activities are presenters and Views are displays, so when you say put several presenters (displays) into my activity it really makes no sense.

Presenters should correspond to a place and handle business logic. They should not be concerned with the display part. And they should be testable, which means they should run on desktop/server JRE without GWT client dependencies.

So, all the GUI building part should be inside Views. And, yes, you could have multiple Views per Activity if this makes sense. BUt, personally, I'd go with one View that shows details (possibly dialog) when Activity instructs it to.


You should normally have a one to one relationship between Places and Activities but you may have many Views per a given Activity. In the project I'm currently working on we create an interface per Presenter and its associated View and then have our Activities implement any Presenters for the Views it needs to display.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜