Results 1 to 5 of 5
  1.    #1  
    Hi guys.
    I hope someone can shed some light into this problem for an Ares newbie like me.

    Basically I am trying to push URL data from one scene to another one with a WebView widget.

    Code from the first scene which reads the uri from a Listtap

    list1Listtap: function(inSender, event) {
    this.controller.stageController.pushScene("view", event.item.uri);
    Code in the scene "view"

    function ViewAssistant(uri) {
    this.uri = uri;
    }

    ViewAssistant.prototype = {
    setup: function() {
    Ares.setupSceneAssistant(this);

    },
    ready: function() {
    this.controller.get('WebView1').mojo.openURL(this.uri);
    },

    cleanup: function() {
    Ares.cleanupSceneAssistant(this);
    }
    };
    The log error says "cannot read property mojo of object"
    How does one code the webView widget to open the URL?

    Thanks
    Check out my My Medical webOS Apps
    Featured free apps: DrugView | Eponyms | eMed | Dosecalcfree | Beeb News
  2. #2  
    Pretty sure your issue is with the listTap function. I don't use Ares, but the function arguments should only be (event).

    Eg.
    list1Listtap: function(event) {
    this.controller.stageController.pushScene("view", event.item.uri);
    See if that works.
    My apps:
    ReWeather - Attractive weather app that reflects current conditions
    Suburbly UK (trial version) - Search for properties to rent, share or buy all over UK.

    Twitter: @joshsharp / @recursivemedia
  3.    #3  
    list1Listtap: function(inSender, event)
    is generated by Ares in the Event for Listtap
    It passes the data over to the next scene correctly e.g. I can display it in an innerHTML
    I suspect the problem lies with
    this.controller.get('WebView1').mojo.openURL(this.uri);
    I have tried
    this.controller.get('WebView1').openURL(this.uri);
    and

    I don't know why the WebView widget in Ares won't accept the URL data.
    Check out my My Medical webOS Apps
    Featured free apps: DrugView | Eponyms | eMed | Dosecalcfree | Beeb News
  4.    #4  
    After some experimenting, I found this works:

    Code:
    function ViewAssistant(uri) {
    	this.uri = uri;
    }
    
    ViewAssistant.prototype = {
    	setup: function() {
    		Ares.setupSceneAssistant(this);
    
    	},
    	ready: function() {
    		this.$.webView1.setUrl(this.uri);
    	},
    
    	cleanup: function() {
    		Ares.cleanupSceneAssistant(this);
    	}
    };
    Check out my My Medical webOS Apps
    Featured free apps: DrugView | Eponyms | eMed | Dosecalcfree | Beeb News
  5. #5  
    Glad you figured it out, sorry to send you looking in the wrong direction.
    My apps:
    ReWeather - Attractive weather app that reflects current conditions
    Suburbly UK (trial version) - Search for properties to rent, share or buy all over UK.

    Twitter: @joshsharp / @recursivemedia

Posting Permissions