Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20281] Windows: Implement enabled property for View

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-02-10T19:26:11.000+0000
Affected Version/sRelease 5.1.0
Fix Version/sRelease 5.3.0
ComponentsWindows
Labelsparity, qe-5.3.0
ReporterKota Iguchi
AssigneeGary Mathews
Created2016-01-28T05:02:26.000+0000
Updated2016-04-26T20:37:33.000+0000

Description

Implement View.enabled property. It's undocumented property but Android has it, and it makes sens to make backgroundDisabledColor/Image property work.
var win = Ti.UI.createWindow();
var view = Ti.UI.createView({
    enabled: false,
    backgroundDisabledColor:'gray'
});

win.add(view);
win.open();

Comments

  1. Gary Mathews 2016-02-10

    PR: https://github.com/appcelerator/titanium_mobile_windows/pull/555
  2. Harry Bryant 2016-04-25

    [~gmathews] Tested on both Windows 8.1 / 10.0 devices. It seems that enabled output is inverted, setting it to false will show the view, and setting it to true will hide it. Tested on: Windows 10 Pro Windows Phone 10.0 & 8.1 (Microsoft Lumia 640 LTE) Appc Studio: 4.6.0.201604081249 Ti SDK: 5.3.0.v20160421080259 Appc NPM: 4.2.5-3 Appc Core: 5.3.0-34 Node: v4.4.2
  3. Kota Iguchi 2016-04-25

    [~htbryant] Could you provide a test code for it? I think enabled property should be nothing to do with component visibility (hide/show) but component availability, for example disabling TextField should stop accepting user's input for the TextField. Here's my test code (tested on 5.3.0.v20160415121959).
       var win = Ti.UI.createWindow({ backgroundColor: 'green', layout: 'vertical' });
       var searchText = Ti.UI.createTextField({width:Ti.UI.FILL, height: '10%', enabled: false});
       
       win.addEventListener('open', function () {
           setTimeout(function () {
               searchText.enabled = true;
           }, 5000);
       });
       
       win.add(searchText);
       win.open();
       
  4. Harry Bryant 2016-04-26

JSON Source