{ "id": "63855", "key": "TIMOB-3223", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-04-18T10:56:41.000+0000", "created": "2011-04-15T03:39:50.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "core", "qe-testadded" ], "versions": [], "issuelinks": [], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-11-06T19:24:12.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "According to Apple's [Documentation|http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UISearchBar_Class/Reference/Reference.html%23//apple_ref/doc/uid/TP40007529] there is a property for the searchbar that adds a Bookmark icon to the right side of it.\r\n\r\nI modified a little bit the Obj-C code. Specifically, I added the following code to TiUISearchBar.m and now it is working as expected:\r\n{code}\r\n-(void)setShowBookmark_:(id)value\r\n{\r\n UISearchBar *search = [self searchBar];\r\n [search setShowsBookmarkButton:[TiUtils boolValue:value]];\r\n [search sizeToFit];\r\n}\r\n{code}\r\nTo make this work on Titanium's code just added it to the searchbar with showBookmark true:\r\n{code}\r\nvar search = Ti.UI.createSearchBar({\r\n hintText: \"Type Something\",\r\n top:0,\r\n height:44,\r\n showBookmark: true\r\n});\r\n{code}\r\nThen for it's listener, I modified the Obj-C code a little more:\r\n{code}\r\n// called when bookmark button pressed\r\n- (void)searchBarBookmarkButtonClicked:(UISearchBar *)searchBar \r\n{ \r\n //TODO: update to the new event model\r\n\r\n NSString * text = [searchBar text];\r\n [self.proxy replaceValue:text forKey:@\"value\" notification:NO];\r\n\r\n if ([self.proxy _hasListeners:@\"bookmark\"])\r\n {\r\n [self.proxy fireEvent:@\"bookmark\" withObject:[NSDictionary dictionaryWithObject:text forKey:@\"value\"]];\r\n }\r\n\r\n\r\n if (delegate!=nil && [delegate respondsToSelector:@selector(searchBarBookmarkButtonClicked:)])\r\n {\r\n [delegate searchBarBookmarkButtonClicked:searchBar];\r\n }\r\n\r\n}\r\n{code}\r\nAnd the JS is like this:\r\n{code}\r\nsearch.addEventListener('bookmark', function(e){\r\n alert(e);\r\n});\r\n{code}\r\n\r\nTested in Ti SDK 1.6 Release\r\niPhone Simulator 4.2", "attachment": [], "flagged": false, "summary": "iOS - showBookmark missing from searchBar", "creator": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "130328", "author": { "name": "zipcar(goss)", "key": "zipcar(goss)", "displayName": "Zipcar (Goss)", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}
This feature is necessary for our project, if it can be\nprioritized.
As a low priority item, this will not be looked at until after\nSprint 16.