Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

How do I pass variables from one page to another?

I am trying to pass a variable from one page to another. Basically I have a tableview that calls a page. My question is how can I pass a variable from page 1 to page 2? And how do I reference it on page 2?

I'm use to passing variables in php, just not sure how to do it here.

I know this isn't correct, but this is what I'm use to.

abc1.js?name=value
— asked October 18th 2010 by Dave Devitt
  • passing
  • variables
0 Comments

2 Answers

  • When creating the new view/window you can set custom properties on it like this:
    ssessionDetailsWin = Titanium.UI.createWindow({
    url: theURL,
    title:'Session Details',
    backgroundColor:'#fff',
    barColor:'#10372e',
    backButtonTitle:'Back'
    });
    sessionDetailsWin.sessionID = e.rowData.sessionID;

    then in the new window you can get the passed value like this:
    var sSurveyID = win.sessionID;

    — answered October 19th 2010 by Chris Griffith
    permalink
    0 Comments
  • Thanks Chris. I'm trying to pass a RSS feed url. Will your way accomplish this?

    — answered October 19th 2010 by Dave Devitt
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.