Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14410] TiAPI: Add hintTextid to all views

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2017-07-20T02:58:57.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.2.0
ComponentsCore
Labelshinttext, i18n, internationalization
ReporterFokke Zandbergen
AssigneeHans Knöchel
Created2013-06-27T09:12:56.000+0000
Updated2017-08-21T22:04:50.000+0000

Description

Currently, only Ti.UI.SearchBar has an hintTextid property. All other views that have hintText properties (e.g. Ti.UI.TextField) should have this property as well.

Comments

  1. Hans Knöchel 2016-08-14

    Just ran into this issue and would like to fix it. I will expose (all lowercase to match current style): - Ti.UI.TextField.hinttextid - Ti.UI.AlertDialog.hinttextid - Ti.UI.AlertDialog.loginhinttextid - Ti.UI.AlertDialog.passwordhinttextid
  2. Hans Knöchel 2016-08-14

    PR: https://github.com/appcelerator/titanium_mobile/pull/8224 Demo:

    Create a new project (appc new)

    Create the file app/i18n/en/strings.xml and copy the following into it:

       <?xml version="1.0" encoding="UTF-8"?>
       <resources>
       	<string name="enter_email">Enter E-Mail ...</string>
       	<string name="enter_password">Enter Password ...</string>	
       </resources>
       
    After that, copy the following into the app/controllers/index.js
       var win = Ti.UI.createWindow({
       	backgroundColor : "#ccc",
       }); 
        
       win.add(Ti.UI.createTextField({
       	hinttextid: "enter_email",
       	width: 300,
       	height: 40,
       	color: "#333",
       	hintTextColor: "#f00",
       	backgroundColor: "#fff",
       	top: 50
       }));
        
       if (Ti.Platform.osname !== 'android') {	
       	var btn = Ti.UI.createButton({
       		title : "Open Dialog",
       		top: 140
       	});
       	 
       	btn.addEventListener("click", function() {		
       		var alert = Ti.UI.createAlertDialog({
       			style: Ti.UI.iOS.AlertDialogStyle.LOGIN_AND_PASSWORD_INPUT,
       			loginhinttextid: "enter_email",
       			passwordhinttextid: "enter_password",
       			title: "Enter your credentials",
       			buttonNames: ["Cancel", "Send"]
       		});
       		alert.show();
       	});
       	 
       	win.add(btn);
       }
       
       win.open();
       
  3. Hans Knöchel 2017-01-09

    [~mchen] What exactly did not work? Did you ensure to include the localized file in your project before? And make sure your device is running the same locale as you specify in the i18n folders.
  4. Ewan Harris 2017-06-09

    For Windows: First, implement hintText for SearchBar (TIMOB-24795) Then add hinttexid to TextField and SearchBar. We should do this for the 6.2.0 timeframe also
  5. Ewan Harris 2017-06-12

    Windows PR: https://github.com/appcelerator/titanium_mobile_windows/pull/1013
  6. Samir Mohammed 2017-08-21

    *(Windows)* Fix verified in SDK Version: 7.0.0.v20170816113226 and SDK Version 6.2.0.v20170816173122 Test and other information can be found at: https://github.com/appcelerator/titanium_mobile_windows/pull/1013 *(Android and iOS)* Fix verified in SDK Version 6.2.0.v20170821080324 and SDK Version 7.0.0.v20170818115004 Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/8224

JSON Source