2 Replies Latest reply on Dec 13, 2012 3:00 AM by sandro.braendli

    Autocomplete Popup Keeps Being Shown When opened using Button


      I'm having an issue with a rich:autocomplete component that doesn't close when the user clicks elsewhere. In my case, this causes a rich:calendar component to be rendered "through" the autocomplete list:




      This situation happens only

      * If the autocomplete is opened using its "button" (showButton="true")

      * in Internet Explorer (FF and Chrome are fine)


      To reproduce with the xhtml page shown below:

      # Click on the autocomplete's button

      #: the suggestion list is shown (empty in this test example)

      # Either

      ## Click on the Calendar component (the input box or the button) to get to the result shown in the image above

      ## Click (once) elsewhere on the screen - the suggestion list will still be shown. Curiously enough, the list vanishes if one clicks twice outside of the list.


      I've discovered this using RF 4.0, JBoss 6.0 and IE9, but also with more recent versions - RF 4.2.2, JBoss7.0 & IE9 this still occurs. Here's the Facelet as a minimal example of this:



      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      <html xmlns:jsp="http://java.sun.com/JSP/Page"
          <style type="text/css">
                          .ac {
                              width: 400px !important;
                          .acPopup {
                              width: 400px !important;
                              height: 30px;
                              line-height: 30px;
          <h:form id="mainForm">
                  popup="true" />
              <br />
              <br />
                  inputClass="ac" styleClass="ac" popupClass="acPopup"


      The "onclick" attribute could be omitted, but it can be used to show that the suggestion list closes as expected when it's opened by clicking into the input field (as opposed to using the button). Same with the CSS definitions: they only serve to widen the input field, so that the overlapping calendar is better visible.


      Did anyone ran into something similar? Is is a bug in RichFaces?

      Also: does anyone know a possible workaround? I've tried using "blur" and "focusout" events to programatically close the popup, but didn't succeed. A workaround for my situation (tailored to the overlapping calendar) is hiding the suggestion list in the calendar's "onshow" event - but of course this isn't a general solution.


      Any ideas?