Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20016] iOS: Ti.UI.Slider.setValue(val, {animated:true}) fails with error

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2017-07-12T23:24:51.000+0000
Affected Version/sRelease 5.1.0
Fix Version/sRelease 6.2.0
ComponentsiOS
Labelsreprod
ReporterFokke Zandbergen
AssigneeHans Knöchel
Created2015-11-19T08:41:18.000+0000
Updated2017-07-19T21:21:35.000+0000

Description

Hoping to have found an elegant solution for TIMOB-2908 we found out that the optional second [options-argument](https://appcelerator.github.io/appc-docs/latest/#!/api/Titanium.UI.Slider-method-setValue) for Ti.UI.Slider.setValue() does not work either. *Sample*
var win = Ti.UI.createWindow({
	backgroundColor: 'white'
});

var btn = Ti.UI.createButton({
	top: 100,
	title: 'Click me'
});

btn.addEventListener('click', function(e) {
	slider.setValue(75, {
		animated: false
	});
});

var slider = Ti.UI.createSlider({
	top: 200,
	min: 0,
	max: 100,
	width: Ti.UI.FILL,
	value: 25
});

win.add(btn);
win.add(slider);

win.open();
*Console*
[ERROR] Script Error {
[ERROR]     column = 17;
[ERROR]     line = 11;
[ERROR]     message = "invalid method '(null)'";
[ERROR]     sourceURL = "file:///Users/fokkezb/Library/Developer/CoreSimulator/Devices/F67B333A-F4FE-4E2E-A67F-C862F77FF882/data/Containers/Bundle/Application/69B03816-179B-4781-9E3E-66F009E6A529/slider.app/app.js";
[ERROR]     stack = "[native code]\nfile:///Users/fokkezb/Library/Developer/CoreSimulator/Devices/F67B333A-F4FE-4E2E-A67F-C862F77FF882/data/Containers/Bundle/Application/69B03816-179B-4781-9E3E-66F009E6A529/slider.app/app.js:11:17";
[ERROR] }

Comments

  1. Lee Morris 2017-06-19

    I am able to reproduce this issue with the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170609091155 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131
  2. Jason David Miller 2017-07-07

    I'm also receiving the same error:
       message = "invalid method '(null)'" 
       
    *Example:*
       slider.setValue(50, {
           animated: true
       });
       
    *Environment:* · iPhone 7 (10.3) · Studio 4.9.0.201705302345 · Ti SDK 6.1.1.GA · Alloy 1.9.11 · Xcode 8.3
  3. Hans Knöchel 2017-07-09

    PR: https://github.com/appcelerator/titanium_mobile/pull/9209
  4. Lee Morris 2017-07-19

    Verifying that has been fixed as I am unable to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.2.0.v20170719120805 Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source