Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-1319

s:selectDate does not work on rich:modalPanel

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2.0.0.BETA1
    • Component/s: None
    • Labels:
      None
    • Environment:

      OS: Mac OS X, Windows 2000 Pro
      Browser: Firefox, IE

      Description

      If s:selectDate is used on a rich:modalPanel, it does not appear when the icon is clicked. This is because the z-index for the calendar div is not set. I have a patch (included below) to /org/jboss/seam/ui/resource/date/calendar.js (contained within jboss-seam-ui.jar). The patch is not as elegant as I would have liked - I would have preferred to navigate up the DOM tree from the target element and set the z-index based on where the target element lived. Unfortunately, my efforts at doing so have been unsuccessful.

      Tested on:
      Mac OS X 10.4.9, Firefox version Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

      Windows 2000 Pro, IE 6.0.2800.1106, SP1, Q823353

      Windows 2000 Pro, Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

      Note: rich:modalPanel doesn't work on Safari (yet), so no way to test...

      __Calendar.prototype.popup = function (locX, locY)
      {
      var selectedDate = __calendarFactory.parseDateValue(getObject(this.name).value);
      if (selectedDate)

      { this.selectedMonth = selectedDate.getMonth() + 1; this.selectedYear = selectedDate.getFullYear(); }

      this.isPopup = true;
      __calendarFactory.documentmousedown = document.onmousedown;

      var popupDiv = getObject(POPUP_DIV);
      if (!popupDiv)

      { popupDiv = document.createElement('div'); popupDiv.id = POPUP_DIV; popupDiv.style.position = "absolute"; window.document.body.appendChild(popupDiv) }

      popupDiv.className = this.styleClass;
      getStyleObject(POPUP_DIV).left = locX + "px";
      getStyleObject(POPUP_DIV).top = locY + "px";

      /*BEGIN PATCH - set zIndex... C. Sweeney, May 10, 2007 */
      var all_divs = document.getElementsByTagName("div");
      var maxZIndex = 0;
      for(i = 0; i < all_divs.length; i++){
      if(all_divs[i].id && all_divs[i].id != ""){
      var divStyle = getStyleObject(all_divs[i].id);
      if(divStyle && divStyle.zIndex && divStyle.zIndex > maxZIndex)

      { maxZIndex = divStyle.zIndex; }

      }
      }
      getStyleObject(POPUP_DIV).zIndex = maxZIndex + 1;
      /* END PATCH */

      popupDiv.innerHTML = this.getHTML();
      changeObjectVisibility(POPUP_DIV, "visible");
      document.onmousedown = this.documentmousedown;
      popupDiv.onmousedown = this.mousedown;
      popupDiv.onmouseup = this.mouseup;
      };

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shane.bryzak Shane Bryzak
                Reporter:
                csweeney Chris Sweeney
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: