FROM : Joakim Danielson
DATE : Sun Nov 28 16:49:57 2004
Combo boxes contains values (NSString or NSNumber) not objects, so your
actually binding your SubCategories to the string you use to display
your Category and not the object itself.
You might find a solution to this in the archives,
http://www.cocoabuilder.com, otherwise I would recommend that you use
pop-up buttons instead.
Joakim
On 2004-11-28, at 15.55, Eric Morand wrote:
> I'm trying to do something that is very commonly used and should be
> very easy to do. I just can't figure how to do it.
>
> Here it is : I've two combo boxes.
>
> The first one uses a data array that is fixed.
> The second one must dynamically change its content when the first
> combo box selection is modified.
>
> I just can't figure how Cocoa Bindings can allow me to do this ! I've
> been obviously able to have the first combo box works perfectly. But
> the second one remains empty, whatever binding I try.
>
>
> The array (named categoriesArray) that is bound to the first combo box
> contains objects (instances of class Category) that have a method that
> returns an array ( - (NSArray *)subCategories; ) of arranged objects.
>
> For instance, for the category "car", [car subCategories] returns the
> array : "fuel, repair, parking".
>
> I've defined two NSArrayController in PB :
>
> - Categories Controller :
>
> Bind to : MyController
> Controller Key : selection
> Model Key Path : categoriesArray
>
> - SubCategories Controller :
>
> Bind to : Categories Controller
> Controller key : selection
> Model Key Path : subCategories
>
> If i understand well, the second controller call subCategories for
> the object selected on the first controller. Right ? Or am I plain
> wrong ?
>
>
>
> It seems I'm wrong since the subCategories method is never called,
> whatever I select in the first combo box.
>
>
>
> Can someone help on this ?
>
>
>
> Thanks !
>
>
> Eric.
>
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>
DATE : Sun Nov 28 16:49:57 2004
Combo boxes contains values (NSString or NSNumber) not objects, so your
actually binding your SubCategories to the string you use to display
your Category and not the object itself.
You might find a solution to this in the archives,
http://www.cocoabuilder.com, otherwise I would recommend that you use
pop-up buttons instead.
Joakim
On 2004-11-28, at 15.55, Eric Morand wrote:
> I'm trying to do something that is very commonly used and should be
> very easy to do. I just can't figure how to do it.
>
> Here it is : I've two combo boxes.
>
> The first one uses a data array that is fixed.
> The second one must dynamically change its content when the first
> combo box selection is modified.
>
> I just can't figure how Cocoa Bindings can allow me to do this ! I've
> been obviously able to have the first combo box works perfectly. But
> the second one remains empty, whatever binding I try.
>
>
> The array (named categoriesArray) that is bound to the first combo box
> contains objects (instances of class Category) that have a method that
> returns an array ( - (NSArray *)subCategories; ) of arranged objects.
>
> For instance, for the category "car", [car subCategories] returns the
> array : "fuel, repair, parking".
>
> I've defined two NSArrayController in PB :
>
> - Categories Controller :
>
> Bind to : MyController
> Controller Key : selection
> Model Key Path : categoriesArray
>
> - SubCategories Controller :
>
> Bind to : Categories Controller
> Controller key : selection
> Model Key Path : subCategories
>
> If i understand well, the second controller call subCategories for
> the object selected on the first controller. Right ? Or am I plain
> wrong ?
>
>
>
> It seems I'm wrong since the subCategories method is never called,
> whatever I select in the first combo box.
>
>
>
> Can someone help on this ?
>
>
>
> Thanks !
>
>
> Eric.
>
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>
| Related mails | Author | Date |
|---|---|---|
| Eric Morand | Nov 28, 15:55 | |
| Joakim Danielson | Nov 28, 16:49 | |
| Bruce Toback | Nov 29, 02:45 | |
| mmalcolm crawford | Nov 29, 04:10 |






Cocoa mail archive

