Re: Need help setting up accessibility link from source-view to (subview of) detail-view programmatically
Re: Need help setting up accessibility link from source-view to (subview of) detail-view programmatically
- Subject: Re: Need help setting up accessibility link from source-view to (subview of) detail-view programmatically
- From: Patti Hoa <email@hidden>
- Date: Fri, 25 May 2012 09:43:47 -0700
Hi Motti,
First, you should verify what exactly is the detailInitialResponder object. A generic NSView is ignored in the accessibility hierarchy and has AXUnknown as the role. Does your detailInitialResponder object return Yes or NO for accessibilityIsIgnored method? What NSAccessibilityRoleAttribute does it return? You should make sure that your "detail views" implement all the correct accessibility protocols.
Second, instead of hooking up NSAccessibilityLinkedUIElements from a cell to a view, hook it from your outline view to the details view instead. An example can be found in the Mail.app. There's a link from the message table to the message content area. The important thing is that the two uiElements involved in the link should not dynamically disappear, so it's always better to link static container elements rather than objects that comes and goes.
Patti
On May 25, 2012, at 3:22 AM, Motti Shneor wrote:
> Hello again.
>
> I have a source-detail window, where the source is an NSOutlineView (handled the "classic" way, i.e. NSOutlineView/NSTableView data-source and delegate methods).
>
> As usual, selecting an object on the source-view brings up a matching view on the detail view. My "detail views" are loaded from standalone .xib files at runtime.
>
> I wish to set up an accessibility link from the currently-selected item in the source-view, to a specialized, pre-defined UI element on the detail view (which is different for different detail view types). So that a voiceover user will VO-J to directly jump from the selected item to the "initial responder" of the detail view.
>
> I cannot, of course, set this up in my .xib files, because I can't link elements in one xib to elements in another .xib. Above this, my accessibility links change as user clicks on different items.
>
> Here's the code I wrote for this. I didn't see any flaw in it - yet it doesn't work. Using accessibility inspector I can see there is an accessibility-link on the selected item, but its value is "0" and its type is "AXUnknown". I have debugged the code thoroughly, so I know the objects I'm using are alive and well.
>
> Maybe I got something wrong here?
>
> - (void)outlineViewSelectionDidChange:(NSNotification *)notification {
> id newSelectedItem = [self selectedSourceViewItem];
> [self updateDetailViewForItem:newSelectedItem];
>
> // Set up Accessibility link from selected item to its detail-view's initial responder.
> NSView *detailInitialResponder = [self.detailViewController initialFirstResponder];
> if (detailInitialResponder != nil) {
> NSMutableArray *accessibilityLinks = [NSArray arrayWithObjects:detailInitialResponder, nil];
> id accessibilityItem = [[_sourceView tableColumnWithIdentifier:@"Label"] dataCellForRow:[_sourceView rowForItem:item]];
> BOOL linkIsSet = [accessibilityItem accessibilitySetOverrideValue:accessibilityLinks forAttribute:NSAccessibilityLinkedUIElementsAttribute];
> }
>
> * detailViewController is a subclass of NSViewController, that returns a predefined view (usually user-focusable control) for its view.
> ** linkIsSet is YES at the end of the method, and my initialFirstResponder is usually just a button, or text-field.
>
> I'd be very thankful for any hint...
>
> Motti Shneor,
> Spectrum Reflections Ltd.
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Accessibility-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden