[
http://jira.jboss.com/jira/browse/JBSEAM-1319?page=comments#action_12362007 ]
Chris Sweeney commented on JBSEAM-1319:
---------------------------------------
Had to force javascript to do a numeric comparison...
__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";
/*PATCH #2 - 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.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;
};
s:selectDate does not work on rich:modalPanel
---------------------------------------------
Key: JBSEAM-1319
URL:
http://jira.jboss.com/jira/browse/JBSEAM-1319
Project: JBoss Seam
Issue Type: Bug
Environment: OS: Mac OS X, Windows 2000 Pro
Browser: Firefox, IE
Reporter: Chris Sweeney
Fix For: 1.2.1.GA
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;
};
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira