Community Questions & Answers
tableViewRow->View
Hello I can access the objects that are within a tableViewRow this?? tableViewRow.view? In short access a obejto this added to another, the question is simple ... I hope your answers please. thanks
Using variables across all project files
Hi all. I'm just wondering which is the best approach to have variables available on all project files without polluting the global scope. **FIRST:** Declare a global object on the App.js? `App.js` ~~~ var GLOBAL = {} GLOBAL.variable1 =...
Send JSON and parse in PHP
Hi ! I'm searching for days now and i can't find the mistake, i send my json : ~~~ var xhr = Ti.Network.createHTTPClient(); xhr.open("POST", "http://****.php"); xhr.setRequestHeader('Content-Type', 'application/json;...
Object property issue cyrillic
Hi, i have a strange issue... I have an object with properties stored in cyrillic. I i look in debugger inside object property, the value is good, but if i look like object.property - value is cutted... I really confused why here is the screenshot...
Global object
My intern developed an Titanium Android App and created an global object within the Ti.App namespace like this: Ti.App.ObjectName.function This seemed to work in Android but on iOS it doesn't work when called from a different Window, the...
Accessing Parent Object in Alloy Applications
Hi there- I have a question on the use of the Require statement. I know that if I have any inter-controller/view communication required, I can (and do) simply fire events and listen to those events. In the case where I have a view that has a Require...
Problem to sort a JSON with a specific value
Hi everyone, I am having a big trouble with some data to sort a JSON object with all the nodes whose got the value that I want. I am retrieving my complete JSON , no problem for that. But when I am trying to sort it to get a smaller one with a function. I...
Crazy behaviour of objects
Hello, this code in commonJS module I cannot understand: ~~~ var answer = { state : true, }; var self = Ti.UI.createView({ backgroundColor : 'white', answer : answer }); console.log(self.answer.state); self.answer.state =...
For loop e.REPLACETHIS.length
I have a for loop and I want to be able to change the return data by replacing the string between e. and .length. Anyone having an idea how I can do this? ~~~ for (var i = 0; i < e.REPLACETHIS.length; i++) { var return =...
ACS - Bug in retrieving Objects on While on Web (works locally)
There is an error while getting an "Object" of a User while running in a Web App hosted on a server, though it works if the App is running from my computer. sdk.sendRequest('objects/status/query.json', URLRequestMethod.GET, data,...
Fill tableview with custom data ACS
Hi, I can't fill my tableview with data. Code: ~~~ var win = Ti.UI.currentWindow; var Cloud = require('ti.cloud'); function getData() { var data = []; Cloud.Objects.query({ classname : 'Kristianstad' }, function(e) { if (e.success)...
How to create a Object or Module to check user login?
Hello, guys I want to create a Object or Module to check user login and has its own property I want a code like this, In app.js ~~~ var User = require('main_windows/user'); var user = new User(); ~~~ and a.js or b.js I want user can return some value or...
Titanium.UI.iPhone unknown
I have the following piece of code: ~~~ tabGroup.open({ transition:Titanium.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT } ); ~~~ But for some reason, it doesn't know Titanium.UI.iPhone :S : Result of expression 'Titanium.UI.iPhone' [undefined] is nog an...
ACS
I've tried the Following and it works as expected: ~~~ Cloud.Objects.query({ classname: ' ... ', page: 1, where: { user_id: .... }, per_page: 10 }, function (e) { } ); ~~~ Though in reality,...
[object Object] is not a constructor
Hi, new to the titanium platform and just getting started but ran into a issue implementing a picture gallery module from here: https://github.com/novelys/titanium-picture-gallery So this was working originally: ~~~ function ApplicationTabGroup()...
object Array's contain a "unique" object Function
A "unique" object Function is now appearing in the majority of my object Arrays. Trying to work out why all of sudden this is occurring but can't find a thing. I'm using Titanium SDK 3.0.0.GA, I've tried rolling back to 2.1.4.GA but the problem...
Any way to clone an object?
I have an array of Titanium.UI.WebView objects. I want to add them to a view and show that in the current window - this is working fine. The problem is if I remove the container view and try to recreate it later using the original WebView array I get...
App structure, childWindow inherit "objects"?
Hello, Im developing a iPhone App with the latest Titanium Studio. My base structure is pretty basic, and I want to create some sort of OOP structure, but with a smaller width. In my app.js, I include my core-"class", "app" which I...
Printing a javascript object to the log
Hello, I'd like to print a javascript object to the log. I'm using the mobile development kit. The only thing I could think of (that didn't work) was: ~~~ Ti.API.info(Ti.API.print(someObject)); ~~~ Thanks
Titanium Community app fiddling
Hi. Im looking into the Titanium Community App, to learn about good codestructure. Im trying to implement my own dynamic data that is going to build views and tabs. I have my data in an Array that i have written in commonjs module. So what i would like...
Setting values utilizing CommonJS and Prototypes design
I'm trying to get used to this design using CommonJS and Prototypes... Two questions I have - regarding the design below. **EnrollmentWin.js:** ~~~ function EnrollmentWin() { this.win = Ti.UI.createWindow({ // blah...
passing an object from one window to another
hi is it possible to pass an object say a button from one window to another
Documentation error
As I've tried to delete a custom object from my HTML project, I had to find out that the documentation at [http://cloud.appcelerator.com/docs/api/v1/custom_objects/delete](http://cloud.appcelerator.com/docs/api/v1/custom_objects/delete) is wrong. As stated...
diff two arrays of objects
I'm googeling and working for days on that problem, and I don't have any solution yet. I want to diff two arrays of 1-level objects. I want to compare each field of every object. On difference push it to a result array. Maybe the community has an answer...
Variable declared with the same name in two separated object spaces replaced the other's value..
I detected a wierd behaviour...I was using a variable declared in one js (using common Js) ObjOne.js ~~~ function ObjOne(win,id) { var x; PatientHospitalButton.addEventListener('click', function(e) { var w =...
Javascript object programmation and Singleton
Hi ! In my Titanium App i use a singleton in order to get the same instance in all the application. My singleton : ~~~ function Singleton() { this.list = null; if ( Singleton.caller != Singleton.getInstance ) { throw new Error("This...
Wait my method to be done
Hi ! I repost because i fix some problems (from my last post) and i got a new prob. In my view.js : ~~~ Ti.include("class/Singleton.js"); var instance = Singleton.getInstance(); var test = instance.getList(); alert(test); ~~~ In my class...
Multidimensional array in Titanium, how to get large xml file into an array?
Problem with arrays in Titanium here. I have this in my xml...
How to close an object/function from within an object/function?
titanium mobile sdk 2.0.1 iphone sdk: 5.1 Hi, Having problem closing an object from within the object. I included the object like this: `new newOjb();` inside this object/file there is a button to end/close the window but this doesn't seem to...
Question about calling an instance/object
titanium sdk 1.8.2 iphone sdk 4.3 Hi, If I call the function this way, via a click of a button: ~~~ addBtn.addEventListener('click', function(){ var addview = new AddView(); self.add(addview); }); ~~~ if I click the button again and again, does it...
How to change object's property
titanium mobile sdk 1.8.2 iphone sdk: 4.3 Hi, I added an object from FirstView.js like this: ~~~ var ListView = require('ui/ListPage'); var listview = new ListView(); self.add(listview); ~~~ this is what's inside the ListPage.js ~~~ function...
parsing date time string?
I'm attempting to parse a mysql datetime field output. So far my method below works, I think, in getting it into the JS date object, however when I attempt to use some of the Data data object methods it does not always return what is expected. ~~~ dates =...
Applying an object to a namespace at creation from a method?
Sorry if that's not the right thing to call it, this is a newbie question. In my code below you can see I create the method pp.ui.loadingBox, then apply it to pp.app.actInd. I do not want to have to deal with writing more code to assign the method object...
[ERROR] Script Error = Result of expression 'Titanium.Media' [undefined] is not an object. at app.js (line 27).
This is driving me nuts. I keep getting this error when I run my IOS application on the simulator: [ERROR] Script Error = Result of expression 'Titanium.Media' [undefined] is not an object. at app.js (line 27). Now, the Titanium.Media object is not even...
Another [undefined] is not an object error
So it was working literally 30 minutes ago for several days and boom its down. ~~~ function cartBadge(){ if ( cartItems.length >= 1){ Ti.App.tabCart.setBadge(cartItems.length); } } ~~~ The error I receive is on `Ti.App.tabCart`. The full error is,...
Object´s global in Android
I´ve got this code in app.'s: ~~~ var CurrentPosicion = require('lib/CurrentPosicion'); var Data = require('lib/Data'); var myPosition = new CurrentPosicion(); var myData = new Data(); myData.getData(); ~~~ In CurrentPosicion.js i´ve got: ~~~ function...
Android doensn´t get values from object (iPhone does)
Well in iPhone i have this code and when i make SettingsIni as a SettingsTab object, i can instance inside SettingsIni for example datos.myvardata (that´s a int variable), i mean i can get values from another object but in android i try with debugger and...
create a button object
For some reason I'm struggling with kicking things into oop. I really want to work in a more object format than what I have used so far in the last week with Ti. So I created a very basic method to construct a rating view. Very basic, but every time I try...
After compiling to a device, doesn't recognize objects
I have this very weird problem that has been happening for a while. I have been testing my application on the iOS simulator all week. It seems to work just fine and dandy with no issues. Over the past couple of days I have been trying to get it onto my...
Object reference between windows, in different files
Ok guys i'll try to make this clear, i have tried a lot before asking. What i want to do: get a object ( createActivityIndicator ) refence between files, so i can access it's properties in the other file. Here's a example: (in default.js) ~~~ var act...
'Result of expression 'element' [undefined] is not an object'
Hello community, I am completely new to Appcelerator but I am already in love with it. I come from a strong frontend background so I was able to get started fairly easy. Currently, I'm attempting to get the value of a textarea and assign it to a...
Update object after its creation
I created object, I have datepicker when i set the value of picker it should update object value to new value from picker. Data = [ {name:"Availability", status:"Busy", hasChild:true, link:'app.js'}, {name:"Alert",...
Update data from object
CustomData = [ {name:"Ends", status:"8:00 PM", hasChild:true}, {name:"Starts",status:"", hasChild:true} ]; how can i update or insert new data?
isValidRow is NULL ?
~~~ // Setup Superglobal var HS = { dbCurrentVersion: Titanium.App.Properties.getInt('DBVER'), db: {} }; /* .... .... */ // Setup Database Shortcut: HS.db = Titanium.Database.open('main'); ~~~ Now I know that HS.db.execute works for me. If it...
Getting the event object for generic animations?
Hi, I want to define some generic animation and need to find a way how to access the object the event was assigned to inside the callback. ~~~ var winAnimation = Titanium.UI.createAnimation(); winAnimation.transform =...
Object creation and pass object as reference to a function
Dear all, I'm quite new to development in this framework and I'm trying to create my first application, so I count on your comprehension. I have 3 modules: app.js, ui.js and db.js (followed the TiBountyHunter tuto) I have problems to pass the object...
Getting the content of the photo taken
Hi guys, I am sending a photo to a server and turns out that I am sending the whole image object to the server which the server doesn't recognize. Now I only want to send the content of the image. Here's my...
Object and array console output
JS Objects and arrays are sometimes printed as: ~~~ Ljava.lang.Object;@48649540 ~~~ This output is totally useless from JS point of view. The workaround is to call "Ti.JSON.stringify" before dumping variable. Can this workaround be...
Ti object properties not updating?
Can anyone explain to me why this doesnt work? ~~~ var win=Ti.UI.createWindow({...}); win._someArray=[]; win._someArray.push('a'); Ti.API.info('L: '+win._someArray.length); // => displays 'L: 0' instead of 'L: 1'!!! ~~~ I've noticed that changing the...
window in an object
i have a js file with the following: ~~~ exports.settings_window; exports.show = function(){ this.settings_window = Titanium.UI.createWindow({...}); ... var scrollView =...
Showing 1-50 of 93 1 2