First application using Dolphin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

First application using Dolphin

Elliot Finley-2
I have a model that basically consists of a socket interface to a slightly
modified LookupTable.

The LookupTable gets updated from clients connected via sockets, but I also
want to update it visually through the View/Presenter.

writing the model - accommodating multiple simultaneous clients using
threads/processes - was amazingly simple.  But for some reason the
View/Presenter combination just hasn't clicked for me yet.

I'm at a loss as to which presenter/view to use to present the LookupTable.
Basically I just need a two column list that allows items to be
added/deleted/changed.  And to somehow wire that up to the LookupTable.

Any pointers would be appreciated.

TIA

Elliot


Reply | Threaded
Open this post in threaded view
|

Re: First application using Dolphin

Christopher J. Demers
"Elliot Finley" <[hidden email]> wrote in message
news:[hidden email]...
> I have a model that basically consists of a socket interface to a slightly
> modified LookupTable.
...
> I'm at a loss as to which presenter/view to use to present the
LookupTable.
> Basically I just need a two column list that allows items to be
> added/deleted/changed.  And to somehow wire that up to the LookupTable.
...

Check out the DictionaryPresenter.  Maybe you can use it behind a multi-
However for some reason I have a feeling that it may not always be a
replacement for a ListPresenter.  I forget the details, but I recall that
the DictionaryPresenter did not always work where I needed it to.  Perhaps
someone else can clarify this.  There were times I ended up using a
collection of associations in lists.  That may not work for you if the lists
can be updated behind the scenes as well.  See a brief programmatic example
of the DictionaryPresenter bellow:
=======
dict := LookupTable new.
dict at: 1 put: 'one'; at: 2 put: 'two'; at: 3 put: 'three'.
dp := DictionaryPresenter showOn: dict.
lv := dp view viewNamed: 'list'.
nc := lv addColumn.
nc text: 'Key'.
nc getTextBlock: [:each | each key displayString].
nc := lv addColumn.
nc text: 'Value'.
nc getTextBlock: [:each | each value displayString].
lv removeColumnAtIndex: 1.
lv hasColumnHeaders: true.
=======

Chris


Reply | Threaded
Open this post in threaded view
|

Re: First application using Dolphin

Ian Bartholomew-18
In reply to this post by Elliot Finley-2
Elliot,

> Any pointers would be appreciated.

Have you sorted this out yet or are you still looking for pointers?.

The problem is that you are probably trying to use a standard MVP
component, a ListPresenter/View/Model, that expects the model to contain
a sequential collection.  Because you want the data to be contained in a
non sequential collection you will need to add a bit more code to get
the two to work together .

It's not that difficult but the exact procedure depends on what you need
to do.

--
Ian

Use the Reply-To address to contact me.
Mail sent to the From address is ignored.