[TIMOB-23216] Windows: Data binding: returning false displays false
| GitHub Issue | n/a |
| Type | Bug |
| Priority | Low |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Android, iOS, Windows |
| Labels | parity |
| Reporter | Rene Pot |
| Assignee | Kota Iguchi |
| Created | 2016-04-14T16:09:40.000+0000 |
| Updated | 2016-06-02T18:53:13.000+0000 |
Description
I have data binding set up on a ListSection with a transform function. When my transform function return false (not a string, but a boolean) as a variable the databinding actually displays a string "false" instead of nothing like it does on iOS and Android
Attachments
[~topener] I don't quite get the issue but you mean you did transform the ListView? Could you give us a sample code so we can reproduce the issue on our side?
When using this in the view:function transform(model){ return { description: false } }it will display the string "false" instead of nothing<ListItem description:text="{description}" />Hmm, interesting. And the other platforms just display nothing rather than coercing the boolean to a string value? That seems like our behavior is "more correct" here. I mean if you didn't want the description shown, wouldn't you use an empty string?
iOS and Android display nothing indeed. "false" shouldn't be displayed imho as it does on both other platforms
I don't think we have parity across platforms. I have created a sample code to test how
trueandfalserendered inListView,LabelandButtonSo here's how it's rendered. !iPhone_6s_Plus_OS_9_2.png|thumbnail! !Nexus_One_API_23.png|thumbnail! !Windows_8_1.png|thumbnail! As you can see in the screenshot, * iOS rendersvar win = Ti.UI.createWindow({ backgroundColor: 'green', layout:'vertical' }); var listView = Ti.UI.createListView({ width: Ti.UI.FILL, height: '50%' }); var label_t = Ti.UI.createLabel({ width: Ti.UI.FILL, height: '10%', text: true }); var label_f = Ti.UI.createLabel({ width: Ti.UI.FILL, height: '10%', text: false }); var button_t = Ti.UI.createButton({ width: Ti.UI.FILL, height: '10%', title: true }); var button_f = Ti.UI.createButton({ width: Ti.UI.FILL, height: '10%', title: false }); var sections = []; var vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables' }); var vegDataSet = [ { properties: { title: true } }, { properties: { title: false } }, ]; vegSection.setItems(vegDataSet); sections.push(vegSection); listView.sections = sections; win.add(listView); win.add(label_t); win.add(label_f); win.add(button_t); win.add(button_f); win.open();1fortrue, and0forfalsein every cases. * Android rendersempty stringon ListView for eithertrueandfalse* Android renders"true"fortrue,"false"forfalseon Label and Button * Windows renders"true"fortrue,"false"forfalsein every cases. So it's obviously a parity issue here but I'm not sure what is the "right" way for this.Be aware of how ALOY-1355 and ALOY-1480 influence these findings.
Given the freeze date for 5.4.0 and the fact that this needs more attention from the iOS/Android guys to get parity right, I need to bump it out.