Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16545] MobileWeb: AlertDialog message property, accepted value varies by platform

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2017-06-28T23:39:15.000+0000
Affected Version/sRelease 3.2.1
Fix Version/sn/a
ComponentsMobileWeb
Labelsparity
ReporterBenjamin Hatfield
AssigneeChris Barber
Created2014-03-04T00:00:42.000+0000
Updated2018-04-04T23:20:41.000+0000

Description

ENVIRONMENT: Studio and SDK 3.2.1.GA Android API Level 10, Genymotion Emulator Android API Level 16, Genymotion Emulator iOS 7.0.3 / Xcode 5.0.2 Chrome Version 32.0.1700.107 REPRODUCTION: Run the test code below on the Android emulator, iOS simulator and in a browser, then click on each button. EXPECTED RESULTS: Each message should be similar. ACTUAL RESULTS: Android cannot stringify the array values, Mobile Web cannot stringify the object value, but iOS can stringify both. MORE INFO: Note that the current documentation says that only a string value is accepted: http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.AlertDialog-property-message Perhaps the type should be enforced rather than allow other types to be passed in. TEST CODE:
var json = { alert: "test json value" };
var arr = ["test", "array", "value"];

var win = Titanium.UI.createWindow({ 
	layout: 'vertical', navBarHidden: true
});

var button1 = Ti.UI.createButton({title:'JSON Alert Dialog'});
var button2 = Ti.UI.createButton({title:'JSON Alert'});
var button3 = Ti.UI.createButton({title:'Array Alert Dialog'});
var button4 = Ti.UI.createButton({title:'Array Alert'});

button1.addEventListener('click', function(){
	Ti.UI.createAlertDialog({message: json}).show();
});
button2.addEventListener('click', function(){
	alert({message: json});
});
button3.addEventListener('click', function(){
	Ti.UI.createAlertDialog({message: arr}).show();
});
button4.addEventListener('click', function(){
	alert(arr);
});

win.add(button1);
win.add(button2);
win.add(button3);
win.add(button4);

win.open();

Comments

  1. Lee Morris 2017-06-28

    Resolving ticket as "Won't Fix" as MobileWeb has been deprecated.
  2. Eric Merriman 2018-04-04

    Closing as will not fix.

JSON Source