Results 1 to 9 of 9
  1.    #1  
    I have been trying to get a WebView to open automatically when I load the app to an external URL - but without any luck.

    I've tried a number of tutorials, so I must be pretty daft. (I am pretty new to programming.)

    Any help would be greatly appreciated.
  2. #2  
    First, in your scene's .html file you need a line like this:

    Code:
    <div id="defWeb" x-mojo-element="WebView"></div>
    In the above, I'm naming my webview widget "defWeb."

    In my scenes assistant file, in the setup section I put:

    Code:
    // Setup up the WebView widget
    this.controller.setupWidget('defWeb', {
    	url: "http://forums.precentral.net",
    	virtualpagewidth: 75
    	}, this.mainViewModel = {});
    Now, assuming your app does a push to open this scene, the webview widget called "defWeb" will be instantiated and go directly to http://forums.precentral.net.
  3.    #3  
    Thank you for your post.

    I have implemented the solution, but unfortunately all I see is the index.html when the app loads. I am not sure how to get the app to skip the index.html page and go to the defWeb scene automatically.
  4. #4  
    In your stage-assistant.jsjsjs $file$ $you$ $need$ $the$ $following$:

    StageAssistant.prototype.setup = function() {
    this.controller.pushScene("main-view");
    }
    Of course, change main-view to the name of the scene you created.
  5. #5  
    and make sure your view and assistant files are all listed in the sources.json file.
  6.    #6  
    Those did the trick. You've been very helpful. Thank you!
  7.    #7  
    I am noticing that this seems to cache the page and does not refresh when the app is opened again.

    Is there a simple way to clear the cache when the app closes?

    Is there a simple way to refresh the page while the app is open?
  8. #8  
    Quote Originally Posted by ftlaudman View Post
    I am noticing that this seems to cache the page and does not refresh when the app is opened again.

    Is there a simple way to clear the cache when the app closes?

    Is there a simple way to refresh the page while the app is open?
    The webview widget has a clearcache and/or reloadpage method.

    .
  9. #9  
    I, too, am a WebOS novice and have one question about clearing the cache. Is there a way to test the user's internet connection and THEN clear the cache if they are connected? I want users to be able to access it offline if necessary but to get updates on the site if they are connected.

    Thanks to everyone for your contributions to this thread thus far!

Posting Permissions