Problem with Multiple Level Bindings

  • I have an NSTableView displaying a list of info, and I need to allow a user
    to double click on an item to open a detailed editing window in a modal
    session (must be modal). The detail will include other NSTableViews whose
    data can be retrieved from the "source" object--i.e. the object of the
    selected row in NSTableView.

    My approach:

        € bind the NSTableView columns to an NSArrayController
        € bind the content of an NSObjectController to the selection key of the
        € the NSTextFields in the detail window are bound to the
        € the NSTableViews in the detail are bound to other NSArrayControllers
    whose contentArray is bound to the NSObjectController

    The problem with this is that when an item is double clicked, the detail
    window shows "no selection" in all the fields. I don't know if this has to
    do with the modal session, but I imagine that the NSObjectController should
    always have a selection.

    If I add code to the NSArrayController to manually set the content of the
    NSObjectController, everything works fine, but it poses some logistical
    problems in other areas so I would rather use a more flexible approach.

    I considered removing the NSObjectController completely out of the picture,
    but that also poses some logistical issues.

    I imagine that this is a common application model (double click list
    view->open window detail view), so there should be a reasonable bindings
    solution, or am I encountering the boundaries of bindings usefulness?


    Keary Suska
    Esoteritech, Inc.
    "Demystifying technology for your home or business"
previous month october 2006 next month
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today