Joseph Dindinger
Posts: 0
Joined: Sat Nov 30, 2013 12:27 am

Two n00b questions about dynamic components

Hi Mobile Gurus!

I am trying to build an app that uses a service to pull in Salesforce.com data (similar to what the sample template does). I am running into a couple issues that I would greatly appreciate help with!

1) Can you dynamically set the Header text on a page? When I go to the mapping of the data, it does not seem to allow me to put anything in the header of the page.

2) Is there a way to dynamically change a link that a button is supposed to go to? I have a page which loads the information for a company dynamically, this works fine. On the page, I have a button that I want the user to click to be taken to the website for the company. If I use a "Navigate to link" action on the button and hard-code the URL, then it works for that one company. But I need it to change based on the record that is being displayed. There doesn't seem to be any way to dynamically update the "URL" parameter on the Navigate to Link Action.

Any help would be really appreciated. Or if there is already documentation for any of these things, please point me in that direction.

Thank you!

Joseph

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Two n00b questions about dynamic components

Hello Joseph,

  1. Yes you can.
    Save you response to localStorage variable and use below code on page load event:
    pre
    var headertext = localStorage.getItem("headerText");
    Appery("mobileheader1").text(headertext);
    /pre
  2. You can save "URL" to localStorage variable and use it value with:
    prewindow.open('http://apache.org', '_blank', 'location=yes');/pre
    http://cordova.apache.org/docs/en/3.0...
Joseph Dindinger
Posts: 0
Joined: Sat Nov 30, 2013 12:27 am

Two n00b questions about dynamic components

Thank you! This worked perfectly.

I'm almost done with my app now. Just one more issue, which I'll post.

Return to “Issues”