4 Replies Latest reply on Jun 25, 2010 9:29 AM by Ilya Shaikovsky

    rich:combobox onblur event issue in IE7/8.

    Kim Eeckhout Newbie

      I noticed that the onblur event for a rich:combobox gets triggered when you click the slider on the scrollbar to scroll through the suggestion list. It doesn't happen if you use the scrollwheel. This occurs in IE7 and 8, but not in Firefox 3.6 (didn't test on any other browsers).

       

      This is quite annoying because I have several users who prefer to click and drag to scroll through the suggestions of my comboboxes, which triggers the onblur event that I have defined for those comboboxes when it shouldn't be triggered.

       

      I made a little example that demonstrates when the onblur is triggered:

       

      <?xml version='1.0' encoding='UTF-8' ?>
      <ui:composition
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:rich="http://richfaces.org/rich"
            xmlns:a4j="http://richfaces.org/a4j">
       
           <rich:comboBox defaultLabel="Enter some value" onblur="alert('onblur triggered');">
                  <f:selectItem itemValue="suggestion 1"/>
                  <f:selectItem itemValue="suggestion 2"/>
                  <f:selectItem itemValue="suggestion 3"/>
                  <f:selectItem itemValue="suggestion 4"/>
                  <f:selectItem itemValue="suggestion 5"/>
                  <f:selectItem itemValue="suggestion 6"/>
                  <f:selectItem itemValue="suggestion 7"/>
                  <f:selectItem itemValue="suggestion 8"/>
                  <f:selectItem itemValue="suggestion 9"/>
                  <f:selectItem itemValue="suggestion 10"/>
                  <f:selectItem itemValue="suggestion 11"/>
                  <f:selectItem itemValue="suggestion 12"/>
                  <f:selectItem itemValue="suggestion 13"/>
                  <f:selectItem itemValue="suggestion 14"/>
                  <f:selectItem itemValue="suggestion 15"/>
                  <f:selectItem itemValue="suggestion 16"/>
                  <f:selectItem itemValue="suggestion 17"/>
                  <f:selectItem itemValue="suggestion 18"/>
                  <f:selectItem itemValue="suggestion 19"/>
            </rich:comboBox>
      
      </ui:composition>

       

      If you open this with IE, you'll see that the onblur gets triggered whenever you try to drag the slider of the scrollbar. In firefox, you can drag the slider as much as you want, it doesn't trigger the onblur event.

       

      Is there any way to avoid this behaviour in IE?

       

      Thanks,

       

      Kim.