Community Questions & Answers
How to access labels in a row when a switch is touched
Hi, I've been looking for info on something I'm sure is simple. I have a table with rows gathered via RSS. Each row has two labels and a switch. When the switch is touched the event returns the switch object but I can't get the value of a label from the...
How to get first element of parent object
Hi, Perhaps a stupid question but I am new to Titanium mobile and ran into a "problem". I have a button, which contains an image. When the button is clicked I want the image to change. How could I check in the event listener what image is...
Reach Parent Object From Child Object
Hi Titaniums .. i have a group of buttons in scrollableView and i wanna made a changes on the all buttons when one of them clicked .. number of buttons not static .. this is my code .. (buttons == radio buttons ) ~~~ function...
how to access parent window
I am using latest SDKs (titanium, iOS). In my app I am creating a TabGroup and adding ONLY one TAB and on this tab I am opening a window: ~~~ var myTabGroup = Titanium.UI.createTabGroup(); var winMain =...
Close parent window
Hello, Is there a way to close the parent of actual window?
Attaching Event Listeners to the Window
How can I attach an event listener to a window object which has children? It seems like the listener is automatically attached to the child with the highest z-index, which can be somewhat undesirable at times. For example, I want to obtain the exact x...
Get current file path
Hi ! I have a file 'View.js' in a directory called 'MyViews', how can i get with a command (written in the file 'View.js'), the path : '/MyViews/View.js'. I already tried this to get directory and/or file name : `Ti.Filesystem.resourcesDirectory`...
How to get a parent object from the child?
I am developing some components using CommonJS and was wondering if there was a way to find the parent of the child, instead of having to pass the value on as a parameter in the creation function.
Animate a parent view
I am trying to animate a parent which has several child imageviews and label views. When I just try to animate it won't work. ~~~ var view = new ParentViewWithChilds(); // <-- this module returns the parent view with child views var t =...
Dynamically hide parents children
I would like to hide dynamically created labels when one of the labels parents is clicked. Note the comment in the code below, it may help explain my goal. Basically, there is a main view, which has several subviews and each subview has a label. I want ALL...
Detect back from child window to parent window
If I have a parent window and a child window in iOS, can I detect when the user press back button (iphone) to return a parent window? Titanium Mobile SDK 1.6.2
Can't see custom properties on parent window
hi, i added a new property(called `contenitore`) to my window and on android when from a child view i try to see my parent property titanium return `null`. there is my code: ~~~ var Win =...
Gettings an events' parent object
Hello all, How would one fetch a variable from and events' parent object/class? ~~~ foo = function() { this.button = Titanium.UI.createButton(); this.text = 'testing'; this.button.addEventListener('click', function(e) { Ti.API.info(/* How would...
How to have data entered in textField in one window display in a label in another window?
I am trying to get a value entered in a text field from one window to display in a label in another (its parent) window. Here's the code I have for the child window: acvchange.js ~~~ var acvEnterField =...
try... catch doesn't always catch on UI elements
Example crash in iPhone emulator... ~~~ var test = Ti.UI.createLabel(); try { test.parent = 'asdfasd'; } catch (ex) { alert(ex); } ~~~~ I understand (from my previous discovery last night) that the parent property is an undocumented reference to the...
Send Table Row name to parent window
I have a window that opens a new window with a table in it. I want to save the name of the table row and the index it was in - to the parent. How could I accomplish this? Please use code examples if you can. It helps a lot.
Android app crashing
I have been creating an iPhone app on appcelerator, and am now trying to get it to work on android as well. However, it is crashing on load. app.js: ~~~ var win1 = Titanium.UI.createWindow({ url:'contacts.js', titleid:"All...
Can not remove from View without parent
Hi, I am trying to add and then remove a ScrollableView to/from a View. It seems that it is not possible to remove that ScrollableView from a View (which has not been added to a Window). A warning will be displayed, that the ScrollableView has already...
Prevent parent's event when fired from child
I've looked over other posts but haven't found anything relevant on what I'm looking for. I have a ScrollableView with some children. If I fire an event in a child (like a touchstart, a scroll, or anything like that) it would get fired in the parent as...
Selecting Parent Element for Modification
Here's what I want to do: I want to be able to create a whole bunch of rows in a table view, with an image in each row, and when an image of one of the rows is clicked, I want to be able to access the information of the row that the image is in. So,...
UI - Getting a control's parent / Setting custom properties?
Hi folks, i need to dynamically create components for displaying data with a given structure loaded from a webservice. By tapping on a smaller preview container (within a list) the user shall be directed to a detailed view. I've tried to solve this by...
how to get parent object?
app.js -> tabgroup - > tab1 - > win1(win1.js) - > tab2 - > win2(win2.js) win1.js - > button when click the button on win1, how to get tabgroup object? I want to change setActiveTab? app.js ~~~ var tabGroup =...
Click and dblclick events problem in child views
If I add a click event to a parent view, then remove the event, the click or dblclick events of the children views no longer fires. I even tried to add the click or dblclick event again to the children, it still does not get fired. Seems like as soon as...
Call function in app.js from inside window
Hey I kinda had a similar question earlier and it was answered, but for some reason it wont let me call a regular function. I have app.js with a window linked to login.js I want to call a function in app.js from login.js In login.js: ~~~ var win =...
Change tab
I know using setActiveTab will change it, but what if my tabGroup lives in app.js and I am in a window called create.js and want to change the tab? Is their like a parent method?
Passing data from child window to parent
I have a tableviewrow, i added a click event that opens a new window. When the new child window is closed, i would like to pass back to the parent tableviewrow a value. How can I do this? I see how to pass data from the parent tableviewrow to the child...
Giving Parent Window Focus after Modal Closes
I execute a block of code when a particular window gets focus like this: ~~~ myWindow.addEventListener('focus', function(){ //Totally Rad Code... } ~~~ I also fire a modal from this page, and when the user hits "Okay" to close that modal, it...
Showing 1-27 of 27