a suggested fix for CPArrayController selection binding failure in retri... #1627

Merged
merged 1 commit into from Feb 26, 2013

Projects

None yet

5 participants

@ggsato
Contributor
ggsato commented Jul 21, 2012

...eving initial selection values

When CPArrayController is bound via selection key, initial selection values are not retrieved. Then it ends up with showing empty selection.

But after moving to another index, which calls setSelectionIndexes:(CPIndexSet)indexes, it becomes to work correctly.

setSelectionIndexes:(CPIndexSet)indexes calls _selectionDidChange(CPObjectController) that initiates selection proxy as follows:

- (void)_selectionDidChange
{
    if (_selection === undefined || _selection === nil)
        _selection = [[CPControllerSelectionProxy alloc] initWithController:self];

    [_selection controllerDidChange];
    [self didChangeValueForKey:@"selection"];
}

So I suspect the instantiation of the proxy is the key, and changed that the proxy is instantiated in the constructor.

But how does the instantiation is deferred at all?

@cappbot
cappbot commented Jul 21, 2012

Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

@aljungberg aljungberg was assigned Jul 27, 2012
@aparajita
Contributor

@aljungberg or cacaodev should look at this, they are the binding experts.

@cappbot
cappbot commented Jul 27, 2012

Assignee: aljungberg. Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

@ahankinson
Contributor

-#new
+bug
+AppKit
+#needs-info

@cappbot
cappbot commented Feb 18, 2013

Assignee: aljungberg. Milestone: Someday. Labels: #needs-info, AppKit, bug. What's next? Additional information should be added as a comment to this isuse.

@aparajita aparajita merged commit 6a8cba5 into cappuccino:master Feb 26, 2013
@aparajita
Contributor

Merged, thank you!

CPObjectController was expecting its setContent to be called, which would eventually call _selectionDidChange, which would initialize _selection. However, CPArrayController overrides setContent and does not initialize _selection.

#fixed

@cappbot
cappbot commented Feb 26, 2013

Assignee: aljungberg. Milestone: Someday. Labels: #fixed, AppKit, bug. What's next? This issue is considered successfully resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment