Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12157] MobileWeb : SearchBar does not appear in portrait but works in landscape mode

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2013-01-25T23:35:23.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterAnirudh Nagesh
AssigneeIngo Muschenetz
Created2012-12-27T03:16:14.000+0000
Updated2014-06-19T12:43:42.000+0000

Description

According to the docs, searchbar is not supported on MobileWeb. But search bar appears in landscape mode but not in portrait. In the customer app, we can see the above behavior. I have a simple test case below which throws a blank red screen giving undefined error. Any clarification would be helpful.
var win = Titanium.UI.createWindow({
    backgroundColor:'white',
});

// create table view data object
var data = [];

data[0] = Ti.UI.createTableViewRow({hasChild:true,title:'Row 1'});
data[1] = Ti.UI.createTableViewRow({hasDetail:true,title:'Row 2'});
data[2] = Ti.UI.createTableViewRow({hasCheck:true,title:'Row 3'});
data[3] = Ti.UI.createTableViewRow({title:'Row 4'});

 var search = Titanium.UI.createSearchBar({
    barColor:'#385292',
    showCancel:false,
    hintText:'search'
});

// create table view
var tableview = Titanium.UI.createTableView({
    data:data,
    search:search,
   // searchHidden:true
   hideSearchOnSelection : false,
        filterAttribute : 'title'
});


// create table view event listener
tableview.addEventListener('click', function(e)
{
    // event data
    var index = e.index;
    var section = e.section;
    var row = e.row;
    var rowdata = e.rowData;
    Titanium.UI.createAlertDialog({title:'Table View',message:'row ' + row + ' index ' + index + ' section ' + section  + ' row data ' + rowdata}).show();
});

// add table view to the window
win.add(tableview);


win.open();

Comments

  1. Bryan Hughes 2013-01-25

    Not sure what's going on here or where this ticket came from. Mobile Web doesn't even have a search bar implementation. Ti.UI.createSearchBar is undefined.
  2. Ingo Muschenetz 2013-01-25

    @Anirudh...can you please attach screenshots?
  3. Bryan Hughes 2013-01-25

    To clarify, that test app is supposed to crash on line 13. If it doesn't, that means you are using some unofficial 3rd party implementation, which we obviously don't support.
  4. Shyam Bhadauria 2013-03-04

    Closing as it is giving the mentioned error of no method 'createSearchBar' at line 13. Environment used for verification - Titanium SDK: 3.1.0.v20130228214607 Titanium  Studio:3.0.2.201302141201

JSON Source