New Posts New Posts RSS Feed: [SOLVED] Using ListConverters Within an Injected Presenter
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

[SOLVED] Using ListConverters Within an Injected Presenter

 Post Reply Post Reply
Author
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Using ListConverters Within an Injected Presenter
    Posted: 01-Oct-2007 at 5:39pm

Hey CAB Afficionados!

Got another research item. 
 
How do I utilize the ListConverters in a view control that has the presenter injected (syntax) and does not inherit from ControlViewPresenter (inheritance)?
 
The presenter of my new control view with a toolbar is not inheriting from ControlViewPresenter (perhaps, it should, somehow), so it is not getting the SetBindingListConverter method.  It inherits from AppViewPresenter.  To see what I mean, try adding a ListConverter to a GridViewControl.  It has the same basic inheritance as my new view.
 
Bill


Edited by Linguinut - 02-Oct-2007 at 4:06pm
Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 02-Oct-2007 at 10:37am
The presenter for any view showing loose controls bound using a DevForce ControlBindingManager should inherit from ControlViewPresenter.
 
Bill J.
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Posted: 02-Oct-2007 at 11:10am

Ok.  How do I get the control view (based on the exact same inheritance schema of the grid view) to inherit from the ControlViewPresenter?

Obviously, I will go to work on this myself.  If I discover the proper path, I will relate it here.
 
 
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Posted: 02-Oct-2007 at 11:58am
Instead of my ControlViewWithToolbarPresenterBase inheriting from AppViewPresenter, I changed it to inherit from ControlViewPresenter (which has AppViewPresenter in its own linkage).  That created an avalanche of changes to my classes in order to re-accomodate the inheritance.  It would not be prudent to list them all here...let's just say, there were a lot of things changed.
 
Now, to test these changes against my app...then to add ListConverters. 
 
Stand by.


Edited by Linguinut - 02-Oct-2007 at 1:18pm
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Posted: 02-Oct-2007 at 12:18pm
The changes flowed through nicely.  The views in my app worked exactly the same as before I made the switch to the ControlViewPresenter inheritance.
 
Ok.  Now, back to my first question.
 
How do I utilize the ListConverters in a view control that has the presenter injected?  Where do I place the code?
 
Example:
 
EntityPropertyDescriptors.AddressMasterPropertyDescriptor descriptors = EntityPropertyDescriptors.AddressMaster;
SetBindingListConverter(descriptors.CarrierMaster, ListConverterNames.CarrierList);
SetBindingListConverter(descriptors.Carrier, ListConverterNames.CarrierIDList);
 
Thanks for any insight here,
Bill


Edited by Linguinut - 02-Oct-2007 at 12:29pm
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Posted: 02-Oct-2007 at 12:45pm
Is this just a workaround?
 
I created a new presenter for my AddressView rather than allowing straight injection.  Within that presenter I placed the code I needed for the ListConverters.  That actually works.  However, is it the best, CAB way of doing this? 
Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 02-Oct-2007 at 4:03pm
Yes, I think that's the right way to do it.  See also my post on the topic "Binding Combo Boxes".
 
Bill J.
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Posted: 02-Oct-2007 at 4:05pm
Thanks, Bill!  Adding the presenter seemed to make the most sense.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down