Re: filtering a tableView from a pulldown
Re: filtering a tableView from a pulldown
- Subject: Re: filtering a tableView from a pulldown
- From: Amy Heavey <email@hidden>
- Date: Wed, 29 Oct 2008 08:49:32 +0000
On 28 Oct 2008, at 16:15, I. Savant wrote:
The pulldown is bound as follows:
content: arrangedObjects[PurchaseOrder Array Controller(NSArray
Controller)]
content values: Purchase ORder Array Controller
arrangedObjects.orderReference
These bindings seem fine. How about selection? One of the popup's
selection bindings should be bound to the PurchaseOrder Array
Controller's selection.
The pop up has selectedObject bound to Purchase Order Array
Controller 2 selection.orderReference
All of this is on a panel that appears when I select a Purchase Order
and click a Details button. The popup correctly shows the selected
Purchase Order Order Reference, and lists all of the other Purchase
orders within it.
The Table view has 6 columns, one of which is the Purchase Order
number (as
displayed in the pulldown)
This seems wrong. If your table is intended to display the "line
items" belonging to the order, why have the order number on each line
item?
I don't really need it, I created most of the interface by alt-
dragging from the data model, and it put it there, at the moment it's
handy for me to quickly see that it's not working properly, as when
it is working, all the lines should have the same value there. It's
not vital for it to be there though,
In any case, you need a *separate* controller to reflect the
line items of the selected order. Create an array controller and set
it up so that it holds your "line item" objects. We'll call it your
"Line Item Array Controller".
OK, I have an Array Controller for that, called Purchase Order Items
Array Controller.
Its contents should be bound to
PurchaseOrder Array Controller's selection.lineItems (or whatever the
key path is to your order's line items).
At the moment the content Object is bound to selection.orderReference
of the Purchase Order Array Controller.
I tried to bind the contentArray to that but it threw an error,
Your table view's columns should each be bound to the Line Item
Array Controller's arrangedObjects.property (where "property" refers
to individual properties such as "item number", "description",
"quantity", etc.).
My Qty table column is bound to Purchase Order Items Array Controller
arrangedObjects.qty
Then I have other columns:
Vendor SKU -> Purchase Order Items Array Controller
arrangedObjects.vendorSKU
Product ->
content-> Products Array Controller arrangedObjects
contentValues->Products Array Controller arrangedObjects.sku
selectedObject->Purchase Order Items Array Controller
arrangedObjects.product
Purchase Order (not vital) ->
content-> Purchase Order Array Controller arrangedObjects
contentValues-> Purchase Order Array Controller
arrangedObjects.orderReference
selectedObject-> Purchase Order Items Array Controller
arrangedObjects.purchaseOrder
Shipment
content-> Shipment Array Controller arrangedObjects
contentValues-> Shipment Array Controller
arrangedObjects.shipperReference
selectedObject-> Purchase Order Items Array Controller
arrangedObjects.shipment
but the panel won't load and displays the following error:
[Session started at 2008-10-29 08:42:05 +0000.]
2008-10-29 08:42:07.826 powizard[6592] *** NSRunLoop ignoring
exception '[<NSCFString 0x164c740> valueForUndefinedKey:]: this class
is not key value coding-compliant for the key qty.' that raised
during posting of delayed perform with target 16699b0 and selector
'invokeWithTarget:'
2008-10-29 08:42:07.829 powizard[6592] *** NSRunLoop ignoring
exception '[<NSCFString 0x164c740> valueForUndefinedKey:]: this class
is not key value coding-compliant for the key shipment.' that raised
during posting of delayed perform with target 1669b50 and selector
'invokeWithTarget:'
Spend as much time as you can manage reading over the documentation
I sent you previously. If there are things you don't understand, post
your questions back to the list for clarification.
I have read through it, and it's not as much that it doesn't make
sense, I can see what it's saying, it's applying it that I'm
struggling with, and I've got both the 2nd and 3rd editions of cocoa
programming, but the second edition doesnt cover core data as much,
and the third edition uses leopard, where I am on 10.4, and wanting
to release for 10.4 too and the IB interface/panels etc are quite
different,
--
I.S.
Thank you for all your help,
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden