[richfaces-issues] [JBoss JIRA] (RF-13063) RichFacesInputNumberSlider setValueByDragging

Bernard Labno (JIRA) jira-events at lists.jboss.org
Fri Jun 14 14:58:54 EDT 2013


Bernard Labno created RF-13063:
----------------------------------

             Summary: RichFacesInputNumberSlider setValueByDragging
                 Key: RF-13063
                 URL: https://issues.jboss.org/browse/RF-13063
             Project: RichFaces
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
          Components: qe
    Affects Versions: 4.3.2
            Reporter: Bernard Labno
            Priority: Minor


In richfaces-qa/page-fragments there is RichFacesInputNumberSlider fragment. It would be great to be able to test setting value as percentage of width implemented as dragging the handle.

One can do it like that:
((JavascriptExecutor) GrapheneContext.getProxy()).executeScript("arguments[0].scrollIntoView(true);", weightSlider.getNumberSlider().getRoot());
        waitGui();
        final int width = weightSlider.getNumberSlider().getWidth();
        final int where = (int) (width * percentage);
        final WebElement handle = weightSlider.getNumberSlider().getHandleElement();
        final Action action = new Actions(GrapheneContext.getProxy()).clickAndHold(handle)
            .moveToElement(weightSlider.getNumberSlider().getRoot(), where, 0)
            .release(handle)
            .build();

It is very important to bring component into view before dragging.
If you do not do that and component is very far to the right (you need to scroll to the right to see it) then calculations are wrong.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the richfaces-issues mailing list