Re: NSArrayController with Combo Boxes, etc.
Re: NSArrayController with Combo Boxes, etc.
- Subject: Re: NSArrayController with Combo Boxes, etc.
- From: "Kent A. Signorini" <email@hidden>
- Date: Sun, 11 Jan 2004 12:50:18 -0700
Got it! I forgot to bind the selectedIndex of the NSPopupButton to the
selectionIndex of the NSArrayController.
Thanks,
Kent!
p.s. Sorry everyone for the confusing double-post (two of my posts
were related but one specific and one general). Won't happen again.
On Jan 11, 2004, at 11:11 AM, Kent A. Signorini wrote:
mmalc,
Thanks for your help but I just can't get something to work and I
think you might be able to help me. I read your great help page but I
still can't figure one thing out.
OK, I now have two array controllers bound to the same content array.
The main one is controlled by a table--call this combatantController.
The other one is called targetController (I have not added filtering
yet, but I will do so later--for now it just lists the same names as
the original controller does).
First off, I've decided to use an NSPopupButton instead of Combo Box
(makes more sense). What I need to happen is when I choose a name
from the Popup I need the shield rating to be displayed in a text
field for the Combatant (which now happens to be a target) chosen in
the Popup.
The problem is that I cannot seem to get this to work. I just don't
know what I should bind to what in the Popup's bindings. The shield
rating text field has been bound to selection.shieldRating as you
suggested (of the targetController). But I can't get the popup to set
the selection index of the array controller and so the shield rating
text field always shows "No Selection".
How do I setup the bindings to get this work properly--so that
choosing a target name in the Popup changes the selected object in the
targetController?
Thanks so much,
Kent!
On Jan 10, 2004, at 10:06 PM, mmalcolm crawford wrote:
On Jan 10, 2004, at 8:38 PM, Kent A. Signorini wrote:
In another NSComboBox in my document, I want the data to be the names
of all the combatants controlled by the NSArrayController EXCEPT the
one that's currently selected.
I *think* you should be able to do this using a custom array
controller that uses the same content array as the first, but which
filters out its (the first's) selection (make an appropriate binding)
-- for an example of filtering see:
<http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>
Now, based on the name chosen in that combo box, another NSTextField
will display this second combatant's shield rating variable value.
That will simply be selection.shieldRating (FilteredArrayController)
mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.