Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Returning values from a popup button



Hello!

I'm having trouble with the NSPopUpButton.

I am giving one value to the representedObject and another to the title, and I seem to be able to populate it just fine. When I try to get the value of the selected item, for some reason the only thing I get is the actual index of the selection. The third choice in my button, for example, returns a 2 (0,1,2...) instead of the actual value I gave that selection (10).

The button is named category, and I am populating it like so:

<trigger path="Internet.category.action.setPopups" language="XQuery">
let $httpRequest := http-request("http://localhost/sherlock_cats.html";) /* List of Categories/Values */
let $html := http-request-value($httpRequest, "DATA")


let $menuItems := $html/cat
let $categoryList := for $item in $menuItems
let $value := $item/@id
let $title := string-combine($item/text()/convert-html(.), "")
return dictionary(("representedObject", $value), ("title", $title))


return dictionary(("Internet.category.items", $categoryList), ("Internet.category.selectedItem", "All")) /* All is a default value */
</trigger>


In the <trigger ...> declaration where I need that value, I set inputs="cat_id=Internet.category.selectedItem" but, like I said, all I get back is the index of the title.

Any ideas?

Thanks!

-- August
_______________________________________________
sherlock-channel-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/sherlock-channel-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.