Titanium Community Questions & Answer Archive

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

links are not clickable when webView inside tableView

I have webView inside tableView. Why links in webView are not clickable?
I removed the event handler click on tableRow, but it did not help.
I use titanium SDK 1.4.1.1

— asked October 13th 2010 by Pasha Tsipinio
  • clickable
  • links
  • tableview
  • webview
0 Comments

4 Answers

  • Do you have any listeners on that webview? If so, remove them.

    You can also try adding touchEnabled:true

    — answered October 13th 2010 by Peter Griffin
    permalink
    1 Comment
    • No, I don't have listeners. touchEnabled:true did not help.

      — commented October 14th 2010 by Pasha Tsipinio
  • When I click on WebView link then illuminated the entire section of the TableView

    — answered October 14th 2010 by Pasha Tsipinio
    permalink
    0 Comments
  • Pasha,

    This is due to the touch event being passed to the table as apposed to the webview. When you click on a link within a webview it will use the already existing webview to display the result of clicking on the link. If you intend to load a page this would obviously try and load the page within the limited space you have set for the tableViewRow. That's if you can get the link to accept touch events and not the row itself.

    Could you please post your code.


    http://www.srcnix.com

    — answered October 14th 2010 by Steve Clarke
    permalink
    1 Comment
    • I don't want open clicked link in this WebView I open it in browser

      — commented October 15th 2010 by Pasha Tsipinio
  • var webView = Ti.UI.createWebView({
          html: new_summary,
          left: 10,
          top: 10,
          bottom: 10,
          height: "auto",
          width: 280,
          touchEnabled:true
    });
    
    var detailsSection = Ti.UI.createTableViewSection();
    var detailsRow = Ti.UI.createTableViewRow({
          height: "auto",
          className: "details_summary",
          backgroundColor: "#FFF",
          action: null
    });
    detailsRow.add(webView);
    detailsSection.add(detailsRow);
    data.push(detailsSection);
    ...
    mainView = Ti.UI.createTableView({
      data: data,
      style: Titanium.UI.iPhone.TableViewStyle.GROUPED
    });
    
    mainView.addEventListener("click", function(event) {
        if (event.rowData.action) {
            event.rowData.action();
        }
    });
    currentWindow.add(mainView);
    
    — answered October 15th 2010 by Pasha Tsipinio
    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.