Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1532] Windows: SearchBar (inside ListView) is not working well for alloy project

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionNot Our Bug
Resolution Date2017-02-14T04:54:36.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sn/a
ComponentsTitanium SDK
Labelseng-priority
ReporterShuo Liang
AssigneeFeon Sua Xin Miao
Created2016-12-07T04:48:23.000+0000
Updated2017-02-14T04:54:36.000+0000

Description

Reproduce

1. Create a simple alloy project with following code.
<Alloy>
<Window fullscreen="true">
<ListView>
<SearchBar barColor="#000" />

<ListSection>
<ListItem title="Papaya" searchableText="Papaya"/>
<ListItem title="Peach" searchableText="Peach"/>
<ListItem title="Pear" searchableText="Pear"/>
<ListItem title="Persimmon" searchableText="Persimmon"/>
<ListItem title="Pineapple" searchableText="Pineapple"/>
<ListItem title="Pluot" searchableText="Pluto"/>
<ListItem title="Pomegranate" searchableText="Pomegranate"/>
</ListSection>

</ListView>
</Window>
</Alloy>
2. Run it on Windows10 device.

Actual

There is no searchBar on screen like the screenshot attached.

Note

1. If create a simple classic project, with following codes, then run it on same device. It is working well.
var win = Ti.UI.createWindow({
    backgroundColor: 'green',
    layout: 'vertical'
});
var searchBar = Ti.UI.createSearchBar({
    width: Ti.UI.FILL,
    height: '10%'
});
var listView = Ti.UI.createListView({
    searchView: searchBar,
    width: Ti.UI.FILL, height: '80%'
});
var sections = [];

var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits' });
var fruitDataSet = [
    { properties: { title: 'Apple' } },
    { properties: { title: 'Banana' } },
];
fruitSection.setItems(fruitDataSet);
sections.push(fruitSection);

var vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables' });
var vegDataSet = [
    { properties: { title: 'Carrots' } },
    { properties: { title: 'Potatoes' } },
];
vegSection.setItems(vegDataSet);
sections.push(vegSection);

listView.sections = sections;
win.add(searchBar);
win.add(listView);
win.open();
2. Tested on SDK 5.5.1.GA, 6.0.0.GA and 6.0.1. 3. Same code is working well on iOS and Android.

Attachments

FileDateSize
6.1.0.v20170202120400.png2017-02-03T15:25:52.000+0000104177
Screen Shot 2016-12-06 at 10.01.06 PM____tisdk6_0_0.png2016-12-07T04:49:50.000+0000139529

Comments

  1. Ewan Harris 2016-12-07

    [~sliang] This might be an underlying issue with the Windows SDK itself. I suspect that this might be due to TIMOB-24126, on iOS and Android you don't actually need to explicitly add a searchBar to the window when you specify it as searchView for a listview, which would explain why the alloy code works on iOS and Android
  2. Shuo Liang 2016-12-07

    Ye. I thinks so. Good one.
  3. Feon Sua Xin Miao 2017-02-03

    [~sliang] Please try with SDK 6.1.0.v20170202120400.

JSON Source