Help please

Topics: CAB & Smart Client Software Factory
Jan 6, 2006 at 9:34 AM
originally posted by: ForeignerCR

Hi and thanks a lot in advance.
I've read through this board for a while but haven't found exactly what I need, and unfortunately I'm running against the time, so, I apologize if this has already been covered.

This is a very simplified version of my scenario:

Imagine an app with 1 listbox on the left and a space on the right to display a workitem. The listbox is actually a sort of "menu", so, the workitem to be displayed on the right depends on the selected item of the listbox. It may be a "Custom Info" view, or a "Product Info", etc.
The quickstarts shows well how to do it when the view on the right side is always a "Custom Info o Details", but I need to load heterogeneous views depending on the selected item on the left.

I'm pretty new to the CAB, so I'm seriously confused about the architectural concepts. I have my app already using the cab, derived from the BankTeller quickstart. But now I'm facing the problem that the Views on the right are not of the same type all the time. My team of developers will be working on different apps, comprised each by many Views. They must all be able to show integrate and show withing the main Shell. Every developer will have their own projects for their application.

Looking at the module loader and the ProfileCatalog mechanism I'm guessing it's what I should use, but I'm not sure. And I'm worried about loading all the modules at the start since this is gonna be a huge application.

I'd really appreciate any help and guidance. As I said, I running out of time to have a prototype running.

Thank you.
Jan 8, 2006 at 7:26 PM
originally posted by: jburtch

How are you loading the list on the left? Rather than wait for a response, I'll assume it is data driven (either by XML file or database) and you have some object in CAB (either a workitem, view, or controller/presenter) responsible for the population.

One possible solution:

When a user clicks an item clicks on a list item, raise a published event. Have the containing workitem subscribe to that event. Send a DataEventArgs<string> as the second parameter in the event and pass the items display string or key or id (whatever makes sense.) The workitem would then reference a Service you create and have injected into the WorkItem. The service could have a method called GetDynamicWorkItem that takes in the string and returns a WorkItem or the name of a WorkItem. The original workitem would then initialize that workitem and run it. Internally, the Service could look at that same data source or a config file to know which workitem to activate.

Hope this works for you.

Justin Burtch
Jan 10, 2006 at 6:41 AM
originally posted by: ForeignerCR

Wow Justin, thanks a lot.

Even though I'm pretty new to this CAB thing, and I'm still trying hard to understand the whole thing, your idea sounds pretty good, I think it could work fine, as long as I do exactly what you're saying :-)

I'll try to put some brain into it and get it clear.
Thanks a LOT really, and sorry if I bother you in the future asking for more guidance to implement your idea.

Jan 10, 2006 at 12:51 PM
originally posted by: aleung61

jburtch -- I'm working on a very similar sceanrio. The thing that I can't seem to grasp is when it's appropriate to create a new workitem. ForeignerCr's sceario sounds somewhat similar to the sceanrio you posted in another thread (Subject = Dynamic Views). In that thread, there was a response that said not to create separate WorkItems. I'm curious if you have a "rule of thumb" for when to create a workitem.