Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23365] Windows: Alloy, Unable to Bind to Visible Tag on Windows 8.1 & Windows 10

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-06-03T21:05:18.000+0000
Affected Version/sRelease 5.4.0
Fix Version/sRelease 5.4.0
ComponentsWindows
Labelsn/a
ReporterDee Clawson
AssigneeGary Mathews
Created2016-05-09T20:56:54.000+0000
Updated2016-07-04T18:17:07.000+0000

Description

Problem

In iOS & Android applications we bind to the visible tag on tables, table view rows, labels, buttons, textfields, textareas, views etc. This does not work on Windows 8.1 or Windows 10. When attempting to bind to the visible tag the items always show.

Test case

Example code is attached. Will output a table as displayed below: !http://i.imgur.com/dtKSrK6.png!

Discussions

I would expect the same functionality as iOS & Android on Windows.

Attachments

FileDateSize
exampleCollection.js2016-05-10T14:06:34.000+0000864
index.js2016-05-10T14:06:25.000+00002441
index.xml2016-05-10T14:06:41.000+0000934

Comments

  1. Nazmus Salahin 2016-05-10

    Hello [~kdclaw3@gmail.com], Thanks for reporting. It will be appreciated if you provide full test code for reproducing this issue. We will recognize this as bug when we are able to reproduce this. Thanks in advance
  2. Dee Clawson 2016-05-10

    @nsalahin Full code to reproduce the bug is attached.
  3. Nazmus Salahin 2016-05-11

    Thanks [~kdclaw3@gmail.com]. We really appreciate your contribution.
  4. Nazmus Salahin 2016-05-11

    Hello, I am able to reproduce this issue with given code and given step. *Steps:* 1. Create a default alloy project for windows phone. 2. Replace index.xml and index.js file with given one. 3. Paste exmapleCollection.js file in models folder. 4. Build and run the app. For an empty index.tss file following screen is produced. [Screenshot](https://i.imgsafe.org/758b5fe.png) Thanks *Environment*: *OS :* Microsoft Windows 8.1 Enterprise N *Device info:* Microsoft Lumia 640 (Windows Phone 8.1) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.4.0.v20160429102159 *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.5.0
  5. Dee Clawson 2016-06-02

    Can we get a status on this issue. This is holding us up from going live with windows.
  6. Christopher Williams 2016-06-02

    Gary can you take a quick look to get an idea of the scope of this fix? I can't tell quickly if this is a Windows SDK issue, or an Alloy issue, or what.
  7. Christopher Williams 2016-06-02

    [~kdclaw3@gmail.com] What version of Alloy are you using? [~fokkezb] I see that alloy's data binding was refactored for 1.9.0. Any ideas on where to start looking for who to fix this? Not sure why it'd be specific to Windows...
  8. Gary Mathews 2016-06-03

    I've taken a look, there seems to be a problem with the way the boolean value is being interpreted. The JSValue interprets it as a string, this means casting the JSValue to a boolean always returns true. This is also why the assert returns a warning.
       [WARN] TitaniumKit\src\UI\View.cpp:825: argument.IsBoolean()
       
    I'll take a look into why this is happening.
  9. Christopher Williams 2016-06-03

    Sounds like the same root issue as TIMOB-23216, which Fokke linked to ALOY-1355 and ALOY-1480
  10. Gary Mathews 2016-06-03

    PR: https://github.com/appcelerator/HAL/pull/62
  11. Christopher Williams 2016-06-03

    I think that is the wrong solution. Javascript has some surprising behavior around coercing a String to a Boolean, where "false" actually becomes true. I think the root cause may have been bugs in Alloy itself where they were turning booleans into strings. What version of Alloy are you guys using? This should be fixed in Alloy 1.9.0 according to the linked tickets.
  12. Gary Mathews 2016-06-03

    I'm using Alloy 1.8.5, I will try Alloy 1.9.0.
  13. Gary Mathews 2016-06-03

    *UPDATE* [~cwilliams] Re-tried using Alloy 1.9.0, the issue has been fixed! However, Android re-interprets boolean strings "true" and "false" as their boolean value. I have yet to test this on iOS.
        var win = Ti.UI.createWindow({ backgroundColor: 'white' }),
            btn = Ti.UI.createButton({
                backgroundColor: 'red',
                title: 'this should be visible',
                visible: "false"
            });
        win.add(btn);
        win.open();
        
  14. Gary Mathews 2016-06-03

    Fixed by Alloy 1.9.0 - https://github.com/appcelerator/alloy/pull/780 I will mark this ticket as resolved.
  15. Ewan Harris 2016-07-04

    Verified using: Windows 10 Pro Ti SDK: 5.4.0.v20160704082523 Appc NPM: 4.2.7-2 Appc CLI: 5.4.0-25 Appc Studio: 4.7.0.201606220541 Using the code example provided the output is as expected and matches iOS and Android. Closing ticket

JSON Source