Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1304] Alloy: Support Node text for TextField and TextArea

GitHub Issuen/a
TypeImprovement
PriorityNone
StatusResolved
ResolutionFixed
Resolution Date2018-08-10T08:58:38.000+0000
Affected Version/sAlloy 1.7.1
Fix Version/sCLI Release 7.0.4
ComponentsXML
Labelsn/a
ReporterFokke Zandbergen
AssigneeFeon Sua Xin Miao
Created2015-09-16T09:58:18.000+0000
Updated2018-08-14T16:04:51.000+0000

Description

The following sample and attached screenshot shows that TextArea and TextField do not support using node text to set the value property.
<Alloy>
    <Window backgroundColor="white" layout="vertical">
        <Label top="20" width="100" backgroundColor="#ccc">Hello</Label>
        <TextField top="20" width="100" backgroundColor="#ccc">Hello</TextField>
        <TextArea top="20" width="100" backgroundColor="#ccc">Hello</TextArea>
    </Window>
</Alloy>
This is in line with [documentation](http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_XML_Markup-section-35621528_AlloyXMLMarkup-PropertyMapping) so not a bug, but a feature request.

Attachments

FileDateSize
iOS Simulator Screen Shot 16 Sep 2015 11.55.05.png2015-09-16T09:58:16.000+000017626

Comments

  1. Feon Sua Xin Miao 2015-10-21

    Why not:
       <TextArea top="20" width="100" backgroundColor="#ccc" value="Hello" />
       
  2. Fokke Zandbergen 2015-10-22

    Because you can also do <Label>Hello</Label> and <Button>Hello</Button> and it makes sense to support the same for TextField and TextArea to make Alloy more predictable and the XML more readable.
  3. Feon Sua Xin Miao 2018-03-28

    PR: https://github.com/appcelerator/alloy/pull/891

JSON Source