| GitHub Issue | n/a |
| Type | Bug |
| Priority | Trivial |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2013-07-01T07:18:43.000+0000 |
| Affected Version/s | Release 2.0.0 |
| Fix Version/s | 2013 Sprint 13 API, 2013 Sprint 13, Release 3.2.0 |
| Components | TiAPI |
| Labels | module_api, parity, qe-testadded |
| Reporter | Allen Yeung |
| Assignee | Hieu Pham |
| Created | 2012-01-13T17:13:37.000+0000 |
| Updated | 2014-03-12T09:17:57.000+0000 |
iOS has both the isValidRow method and validRow property
Android has the isValidRow method, but it doesn't currently have a validRow property.
Please verify this pull request: https://github.com/appcelerator/titanium_mobile/pull/3836 Thanks.
Test Code:
1. Run app. 2. Click on window. Observe log. Should see "ROW VALID property: true", "ROW VALID method: true"var win = Ti.UI.createWindow({ backgroundColor:'blue' }); win.addEventListener('open',function(e){ Ti.API.info('WIN OPENED'); var db = Ti.Database.open('testdb'); db.execute('DROP TABLE IF EXISTS welcome'); db.execute("CREATE TABLE IF NOT EXISTS welcome (title TEXT)"); db.execute("INSERT INTO welcome (title) VALUES (?)",'one'); db.execute("INSERT INTO welcome (title) VALUES (?)",'two'); db.close(); }); win.addEventListener('click',function(e){ var db = Ti.Database.open('testdb'); var rows = db.execute("SELECT title FROM welcome"); Ti.API.info("ROW VALID property: " + rows.validRow); Ti.API.info("ROW VALID method: " + rows.isValidRow()); rows.close(); db.close(); }); win.open();Verified the fix with: Appc-Studio: 3.2.0.201310181700 Sdk:3.2.0.v20131022171645 alloy:1.2.2 npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.0.3 Device:Google Nexus 7(v4.3), iPhone5(v7.0) Xcode: 5 OS: Mac OSX 10.8 validRow property working for android.
Code used was:
var win = Ti.UI.createWindow({ backgroundColor:'blue' }); win.addEventListener('open',function(e){ Ti.API.info('WIN OPENED'); var db = Ti.Database.open('testdb'); db.execute('DROP TABLE IF EXISTS welcome'); db.execute("CREATE TABLE IF NOT EXISTS welcome (title TEXT)"); db.execute("INSERT INTO welcome (title) VALUES (?)",'one'); db.execute("INSERT INTO welcome (title) VALUES (?)",'two'); db.close(); }); var tbtn=Ti.UI.createButton({title:'Returns True',top:'5dp',height:'40dp'}); var fbtn=Ti.UI.createButton({title:'Returns False', top:'55dp'}); tbtn.addEventListener('click',function(e){ var db = Ti.Database.open('testdb'); var rows = db.execute("SELECT title FROM welcome where title='one'"); Ti.API.info("ROW VALID property: " + rows.validRow); Ti.API.info("ROW VALID method: " + rows.isValidRow()); rows.close(); db.close(); }); fbtn.addEventListener('click',function(e){ var db = Ti.Database.open('testdb'); var rows = db.execute("SELECT title FROM welcome where title='three'"); Ti.API.info("ROW VALID property: " + rows.validRow); Ti.API.info("ROW VALID method: " + rows.isValidRow()); rows.close(); db.close(); }); win.add(tbtn); win.add(fbtn); win.open();