Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7187] TI API: validRow property exists in iOS, but not Android

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2013-07-01T07:18:43.000+0000
Affected Version/sRelease 2.0.0
Fix Version/s2013 Sprint 13 API, 2013 Sprint 13, Release 3.2.0
ComponentsTiAPI
Labelsmodule_api, parity, qe-testadded
ReporterAllen Yeung
AssigneeHieu Pham
Created2012-01-13T17:13:37.000+0000
Updated2014-03-12T09:17:57.000+0000

Description

iOS has both the isValidRow method and validRow property Android has the isValidRow method, but it doesn't currently have a validRow property.

Attachments

FileDateSize
testdb.db2013-07-01T07:10:53.000+00004096

Comments

  1. Varun Joshi 2013-02-01

    Please verify this pull request: https://github.com/appcelerator/titanium_mobile/pull/3836 Thanks.
  2. Hieu Pham 2013-07-01

    Test Code:
       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();
       
    1. Run app. 2. Click on window. Observe log. Should see "ROW VALID property: true", "ROW VALID method: true"
  3. Priya Agarwal 2013-10-23

    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.
  4. Priya Agarwal 2013-10-23

    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();
       

JSON Source