Menu

#1736 Vaadin tables

2.18
closed
vaadin (1)
1
2016-03-06
2015-12-21
Pablo Leon
No

Hi:

htmlunit is working ok with most vaadin's components, but not with table row click events. Here you can find a complete vaadin maven project showing the problem:

https://github.com/hangorn/vaadinsTables/tree/master/vaadinsTables

Thought the test passes ok, no ItemClickEvent is fired on server side's table, and you dont get the line on the console (as it happens when you click a row manually).

Discussion

  • Ahmed Ashour

    Ahmed Ashour - 2016-03-06
    • status: open --> closed
    • assigned_to: Ahmed Ashour
     
  • Ahmed Ashour

    Ahmed Ashour - 2016-03-06

    Thanks for reporting this issue.

    Vaadin internally uses document.elementFromPoint() to decide which element are under the mouse, and since calculating the element location is outside the HtmlUnit scope, a new way was added to manually control this.

    With latest SVN version (and latest build), you can use:

        HtmlPage page = webClient.getPage("http://localhost:8080/VaadinHtmlunit-0.0.1-SNAPSHOT/");
    
        HtmlElement e = null;
        for (int k=0;k<100;k++) {
            Thread.sleep(100);
            e = page.getFirstByXPath("//div[@id='tableid']//table[@class='v-table-table']//tr[3]");
            if (e!=null) break;
        }
        final HtmlElement finalE = e;
        page.setElementFromPointHandler(new ElementFromPointHandler() {
    
            @Override
            public HtmlElement getElementFromPoint(HtmlPage htmlPage, int x, int y) {
                return finalE;
            }
        });
        e.click();
    
     

Log in to post a comment.

MongoDB Logo MongoDB