Titanium Community Questions & Answer Archive

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

WebView href navigation

Hello Community,

I am trying to create a book where I have the toc as a table (got that working) and then the pages are webviews off the table (got that working). Now I am trying from one webview to go to the next chapter (having problem here).

I have tried just creating a href link to the local file but that did not work. I have also tried removing the current view and creating the next view through fireevent but I can not get that to work either.

If you have any suggestions please send them my way. Also code samples help a lot:)

Thanks.

— asked April 8th 2010 by General Usage
  • href
  • link
  • mobile
  • webview
0 Comments

2 Answers

  • The href links used to work. Doesn't now though. ??
    One more thing that got broken in local web views.

    My solution was to change the web view url when the user clicked on the edges of the screen.

    webview.url = 'p101.html';

    — answered April 8th 2010 by Eldon Benz
    permalink
    0 Comments
  • Your tags don't say which platform you're on, but you should be able to do something like.

    Ti.App.fireEvent('nextPage', { currentPage : 1});
    

    and have your application listen for it and set the html for the next page.

    Ti.App.addEventListener('nextPage', function(e) {
        webView.html = getPage(e.currentPage + 1);
    });
    

    where getPage is a function you write to return the source for the page. I didn't put error handling in the example so you'll need to do that.

    — answered April 8th 2010 by Don Thorp
    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.