Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8303] iOS: Text Field/Area needs hasText method

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-06-19T16:56:51.000+0000
Affected Version/sn/a
Fix Version/sRelease 2.1.0, Sprint 2012-07
ComponentsiOS
Labelsapi, module_textarea, parity, qe-testadded
ReporterChase Culpepper
AssigneeVishal Duggal
Created2012-03-26T08:28:50.000+0000
Updated2013-11-07T05:34:47.000+0000

Description

Problem

TextField and TextArea hasText() method not functioning.

Test Case

var win = Ti.UI.createWindow({
	backgroundColor : 'white',
	exitOnClose : true,
	fullscreen : false,
	layout : 'vertical',
	title : 'hasText Demo'
});
 
var textField = Ti.UI.createTextField({
    color: '#336699',
    backgroundColor:'#eee',
    top: 10, left: 10,
    width: 250, height: 60,
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED
});
win.add(textField);
 
var textArea = Ti.UI.createTextArea({
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
    backgroundColor:'#eee',
    color: '#336699',
    top: 10, left: 10,
    width: 250, height: 200
});
win.add(textArea);
 
 
win.open();
 
textField.addEventListener('change', function(e){
    Ti.API.info('hasText? ' + e.source.hasText());
});
 
textArea.addEventListener('change', function(e){
    Ti.API.info('hasText? ' + e.source.hasText());
});

Comments

  1. Vishal Duggal 2012-03-26

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/1841
  2. Blain Hamon 2012-04-02

    Pull merged, not sure on the release number.
  3. Paul Dowsett 2012-05-06

    hasText does still not work. I've added a test case to prove this.
  4. Arthur Evans 2012-06-19

    Paul's test code was incorrect--was attempting to call hasText() on the event object, rather than the text field/text area itself. Updated test code works on iOS and Android. MW has an issue I'll file separately.
  5. Michael Pettiford 2012-06-23

    Closing issue Tested with Ti Studio build 2.1.0.201206211609 Ti Mobile SDK 2.1.0.v20120622174154 hash rdc9dfbe5 OSX Lion 10.7.3 iPhone 4S OS 5.1 Verified expected behavior is shown
  6. Shameer Jan 2013-11-07

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4876

JSON Source