Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24795] Windows: Implement hintText for searchbar

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2017-06-09T21:57:56.000+0000
Affected Version/sRelease 6.1.1
Fix Version/sRelease 6.2.0
ComponentsWindows
Labelsn/a
ReporterEwan Harris
AssigneeEwan Harris
Created2017-06-08T15:17:17.000+0000
Updated2017-07-18T09:02:13.000+0000

Description

Description

Implement the hintText property for SearchBar. Demo code below
var win = Ti.UI.createWindow();
var searchWithHintText = Ti.UI.createSearchBar({
    hintText: 'Search...',
    color: "#333",
    top: 250,
    width: 300,
    backgroundColor: "#fff"
});
var searchWithoutHintText = Ti.UI.createSearchBar({
    color: "#333",
    top: 300,
    width: 300,
    backgroundColor: "#fff"
});
var setMethBtn = Ti.UI.createButton({
    title: 'Set the hintText via method',
    top: '15'
});
var setPropBtn = Ti.UI.createButton({
    title: 'Set the hintText via prop',
    top: 50
});
setMethBtn.addEventListener('click', function () {
    searchWithHintText.setHintText('Changed search text via method');
});
setPropBtn.addEventListener('click', function () {
    searchWithHintText.hintText = 'Changed search text via prop';
});
var getBtn = Ti.UI.createButton({
    title: 'Get the hintText',
    top:  150

});
getBtn.addEventListener('click', function () {
    console.log(searchWithHintText.hintText);
    console.log(searchWithHintText.getHintText());
});
win.add(setMethBtn);
win.add(setPropBtn);
win.add(getBtn);
win.add(searchWithHintText);
win.add(searchWithoutHintText);
win.open();

Expected

Two searchBars one without hintText one with

Clicking 'Set the hintText via method ' should update the hintText

Clicking 'Set the hintText via prop ' should update the hintText

Clicking 'Get the hintText' should print the hintText twice (access property and getHintText)

Comments

  1. Ewan Harris 2017-06-08

    Master PR: https://github.com/appcelerator/titanium_mobile_windows/pull/1010
  2. Samir Mohammed 2017-06-26

    Verified improvement in SDK Version: 6.2.0.v20170626084207. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile_windows/pull/1010

JSON Source