Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [DataBinding] Cascading comboviewers
[DataBinding] Cascading comboviewers [message #313420] Wed, 14 March 2007 16:38 Go to next message
Eclipse UserFriend
Originally posted by: smithbb+eclipse-news.gmail.com

Hi All,

I have a scenario where I have:

class Organisation
{
String name;
List<OrgUnit> orgUnits; //parent -> child
}
class OrgUnit
{
String name;
Organisation org; //child -> parent
}

class FactoryWorker
{
String name;
OrgUnit orgUnit;
}


For the UI I have:

FactoryWorker Form
-------------
Organisation: [______________|v] //A
OrgUnit: [______________|v] //B
Worker Name: [________________] //C


A: (ComboViewer)
Bound to List<Organisation>
Not bound to FactoryWorker

B: (ComboViewer)
Bound to selectedOrganisation.orgUnits
Selected element bound to FactoryWorker.orgUnit

C: (Text)
Bound to FactoryWorker.name

FactoryWorker doesn't need a reference to Organisation as OrgUnit can
only have one Organisation as parent.

Most of the examples I have found don't deal with this sort of scenario.
They mostly have scenarios where the select of both A and B are bound to
the Model object.

How would I go about binding this scenario?

Cheers!

Ashley Cambrell
Re: [DataBinding] Cascading comboviewers [message #313499 is a reply to message #313420] Thu, 15 March 2007 11:14 Go to previous messageGo to next message
Eclipse UserFriend
This is what we refer to as master detail. There's a snippet in the
examples project for doing this with a table and other widgets and the
concept should be the same. I've also written about this on my blog[1].

-brad

[1] http://fire-change-event.blogspot.com/search/label/master%20 detail
Re: [DataBinding] Cascading comboviewers [message #313504 is a reply to message #313499] Thu, 15 March 2007 16:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smithbb+eclipse-news.gmail.com

Doesn't that assume that the Organisation is the master and worker is
the detail? In this case it would be perfectly valid to have two sets
of cascading combos.

FactoryWorker Form
-------------
Worker Name: [________________] //A
Organisation: [______________|v] //B
OrgUnit: [______________|v] //C
Type of Health[______________|v] //D InsuranceType.insuranceCos
Insurance:
Insurance Co.:[______________|v] //E FactoryWork.insuranceCo


D: Public or Private
E: List of health insurance companies that are public (if selected) or
private.

Using master detail, does it boil down to this?
// 1. Observe changes in Organisation selection.
// 2. Observe the orgUnits property of the current selection.
// 3. Observe changes in orgUnits selection.
// 4. Bind the selectio of orgUnis to the orgUnit factoryWork object.

... repeat for insuranceType and insuranceCo.

Thanks Brad,

Ashley Cambrell

Brad Reynolds wrote:
> This is what we refer to as master detail. There's a snippet in the
> examples project for doing this with a table and other widgets and the
> concept should be the same. I've also written about this on my blog[1].
>
> -brad
>
> [1] http://fire-change-event.blogspot.com/search/label/master%20 detail
>
Re: [DataBinding] Cascading comboviewers [message #313506 is a reply to message #313504] Thu, 15 March 2007 17:20 Go to previous messageGo to next message
Eclipse UserFriend
> Doesn't that assume that the Organisation is the master and worker is
> the detail?

I don't believe so.

> Using master detail, does it boil down to this?
> // 1. Observe changes in Organisation selection.
> // 2. Observe the orgUnits property of the current selection.
> // 3. Observe changes in orgUnits selection.
> // 4. Bind the selectio of orgUnis to the orgUnit factoryWork object.

Correct.

-brad

p.s. I have so much cold medicine in me I could get arrested so I might
not be thinking too clearly. If you still have issues work up a
standalone snippet and I'll take a look.
Re: [DataBinding] Cascading comboviewers [message #313518 is a reply to message #313506] Fri, 16 March 2007 08:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smithbb+eclipse-news.gmail.com

Hi Brad,

I'm stuck at step three.

I've created a test rcp app that has a structure similar to an
enterprise application (objects, a couple of services etc). I've added
the basic data binding to it. It's a contrived example, but it sets the
context nicely. It might be useful to others once it's completed.

Would you mind helping me fill in the gaps in
DatabindingViewer#initializeDataBinding?

http://users.tpg.com.au/cambrell/com.freakynamuh.databinding .test-20070316.zip

Hope you're feeling better.

Cheers,

Ashley

Brad Reynolds wrote:
>> Doesn't that assume that the Organisation is the master and worker is
>> the detail?
>
> I don't believe so.
>
>> Using master detail, does it boil down to this?
>> // 1. Observe changes in Organisation selection.
>> // 2. Observe the orgUnits property of the current selection.
>> // 3. Observe changes in orgUnits selection.
>> // 4. Bind the selectio of orgUnis to the orgUnit factoryWork object.
>
> Correct.
>
> -brad
>
> p.s. I have so much cold medicine in me I could get arrested so I might
> not be thinking too clearly. If you still have issues work up a
> standalone snippet and I'll take a look.
>
Re: [DataBinding] Cascading comboviewers [message #313573 is a reply to message #313518] Mon, 19 March 2007 15:35 Go to previous message
Eclipse UserFriend
Originally posted by: bokowski.ca.ibm.com

For legal reasons, we cannot easily download content that is not hosted at
eclipse.org. Would you be able to file a bug for this and attach your
example zip to the bug? (This would mean licensing your example code under
the EPL.)

Boris

"Ashley" <smithbb+eclipse-news@gmail.com> wrote in message
news:ete36o$e7u$1@utils.eclipse.org...
> Hi Brad,
>
> I'm stuck at step three.
>
> I've created a test rcp app that has a structure similar to an enterprise
> application (objects, a couple of services etc). I've added the basic data
> binding to it. It's a contrived example, but it sets the context nicely.
> It might be useful to others once it's completed.
>
> Would you mind helping me fill in the gaps in
> DatabindingViewer#initializeDataBinding?
>
> http://users.tpg.com.au/cambrell/com.freakynamuh.databinding .test-20070316.zip
>
> Hope you're feeling better.
>
> Cheers,
>
> Ashley
>
> Brad Reynolds wrote:
>>> Doesn't that assume that the Organisation is the master and worker is
>>> the detail?
>>
>> I don't believe so.
>>
>>> Using master detail, does it boil down to this?
>>> // 1. Observe changes in Organisation selection.
>>> // 2. Observe the orgUnits property of the current selection.
>>> // 3. Observe changes in orgUnits selection.
>>> // 4. Bind the selectio of orgUnis to the orgUnit factoryWork object.
>>
>> Correct.
>>
>> -brad
>>
>> p.s. I have so much cold medicine in me I could get arrested so I might
>> not be thinking too clearly. If you still have issues work up a
>> standalone snippet and I'll take a look.
>>
Previous Topic:VM constantly crashes with Eclipse 3.2.2 on Linux
Next Topic:Internal Web Browser
Goto Forum:
  


Current Time: Sat Jun 07 22:31:19 EDT 2025

Powered by FUDForum. Page generated in 0.03128 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top