{ "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.

{html}", "updateAuthor": { "name": "zipcar(goss)", "key": "zipcar(goss)", "displayName": "Zipcar (Goss)", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:39:51.000+0000", "updated": "2011-04-15T03:39:51.000+0000" }, { "id": "130329", "author": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

As a low priority item, this will not be looked at until after\nSprint 16.

{html}", "updateAuthor": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:39:52.000+0000", "updated": "2011-04-15T03:39:52.000+0000" }, { "id": "183630", "author": { "name": "hdogan", "key": "hdogan", "displayName": "Hidayet Dogan", "active": true, "timeZone": "Europe/Istanbul" }, "body": "I've pulled request on github for Pedro Enrique's solution with adding documentation.\r\n\r\nSee here: https://github.com/appcelerator/titanium_mobile/pull/1458\r\n\r\nTicket is already tagged for 1.8.0 release but I hope it'll be included in next release.", "updateAuthor": { "name": "hdogan", "key": "hdogan", "displayName": "Hidayet Dogan", "active": true, "timeZone": "Europe/Istanbul" }, "created": "2012-02-17T09:52:07.000+0000", "updated": "2012-02-17T09:52:07.000+0000" }, { "id": "190055", "author": { "name": "hdogan", "key": "hdogan", "displayName": "Hidayet Dogan", "active": true, "timeZone": "Europe/Istanbul" }, "body": "Tested with:\r\n\r\nTitanium SDK: 2.0.0 (04/06/12 00:35 8e4d621)\r\niPhone SDK: 5.0\r\niPhone Simulator\r\n\r\nScreenshots:\r\n\r\n[http://oi41.tinypic.com/34skkcy.jpg]\r\n[http://oi42.tinypic.com/xeg3ee.jpg]\r\n[http://oi41.tinypic.com/2ibnf9s.jpg]\r\n[http://oi42.tinypic.com/30nayxs.jpg]\r\n\r\nHere are the functional test application source code:\r\n\r\n{code:title=app.js|borderStyle=solid}\r\nvar window = Titanium.UI.createWindow({\r\n\tbackgroundColor: \"white\"\r\n});\r\n\r\nvar searchBar = Titanium.UI.createSearchBar({\r\n\ttop: 0,\r\n\theight: 44\r\n});\r\n\r\nsearchBar.addEventListener('bookmark', function(e) {\r\n\talert('Bookmark button clicked. Value: ' + e.value);\r\n});\r\n\r\nvar buttonFocus = Titanium.UI.createButton({\r\n\ttitle: 'Focus',\r\n\ttop: 75,\r\n\tleft: 20,\r\n\theight: 30\r\n});\r\n\r\nbuttonFocus.addEventListener('click', function(e) {\r\n\tsearchBar.focus();\r\n});\r\n\r\nvar buttonBlur = Titanium.UI.createButton({\r\n\ttitle: 'Blur',\r\n\ttop: 75,\r\n\tright: 20,\r\n\theight: 30\r\n});\r\n\r\nbuttonBlur.addEventListener('click', function(e) {\r\n\tsearchBar.blur();\r\n});\r\n\r\nvar buttonBookmark = Titanium.UI.createButton({\r\n\ttitle: 'Toggle Bookmark',\r\n\ttop: 125,\r\n\theight: 30\r\n});\r\n\r\nbuttonBookmark.addEventListener('click', function(e) {\r\n\tsearchBar.showBookmark = !searchBar.showBookmark;\r\n});\r\n\r\nwindow.add(searchBar);\r\nwindow.add(buttonFocus);\r\nwindow.add(buttonBlur);\r\nwindow.add(buttonBookmark);\r\nwindow.open();\r\n{code}", "updateAuthor": { "name": "hdogan", "key": "hdogan", "displayName": "Hidayet Dogan", "active": true, "timeZone": "Europe/Istanbul" }, "created": "2012-04-05T14:20:25.000+0000", "updated": "2012-04-05T14:20:25.000+0000" }, { "id": "191606", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Here is an additional test which should be run:\r\n\r\nh4. Searchbar w/bookmark in tableview\r\n{code}\r\nvar window = Titanium.UI.createWindow({\r\n    backgroundColor: \"white\"\r\n});\r\n \r\nvar searchBar = Titanium.UI.createSearchBar({\r\n\tshowBookmark: true\r\n});\r\n \r\nsearchBar.addEventListener('bookmark', function(e) {\r\n    alert('Bookmark button clicked. Value: ' + e.value);\r\n});\r\n \r\nvar table = Ti.UI.createTableView({\r\n\tdata:[{title:\"Row 1\"}, {title:\"Row 2\"}, {title:\"Row 3\"}],\r\n\tsearch:searchBar\r\n});\r\n\r\nwindow.add(table);\r\nwindow.open();\r\n{code}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-18T10:55:42.000+0000", "updated": "2012-04-18T10:55:42.000+0000" }, { "id": "197600", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 2.1.0.v20120606112649 iPad 3 5.1.1 and iPhone 3gs 4.3", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-06T17:09:27.000+0000", "updated": "2012-06-06T17:09:27.000+0000" }, { "id": "278483", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Anvil testcase PR\n\nhttps://github.com/appcelerator/titanium_mobile/pull/4758\n", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-06T19:24:12.000+0000", "updated": "2013-11-06T19:24:12.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }