[richfaces-issues] [JBoss JIRA] Issue Comment Edited: (RF-9018) Page with modalpanel that has a calendar inside doesn't select the date

Raul Ospina (JIRA) jira-events at lists.jboss.org
Wed Aug 18 00:27:11 EDT 2010


    [ https://jira.jboss.org/browse/RF-9018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12545547#action_12545547 ] 

Raul Ospina edited comment on RF-9018 at 8/18/10 12:26 AM:
-----------------------------------------------------------

Hi, I solved this problem changing the function "eventOnCollapse" in the calendar.js on the  the richfaces-ui-3.1.4.jar.
I change the function to this:

	eventOnCollapse: function (e) {
		if (this.skipEventOnCollapse)
		{
			this.skipEventOnCollapse = false;
			return true;
		}

		if (Event.element(e).id == this.POPUP_BUTTON_ID || (!this.params.enableManualInput && Event.element(e).id == this.INPUT_DATE_ID) ) 		 return true;
		//Position.prepare();
                var isInModalPanel = false;
                var cDivElement = $(this.id).parentNode;
                while(cDivElement.id != "mainForm") {
                	var cDivId = cDivElement.id;
                	if (cDivId.substr(cDivId.length - 4) == "CDiv") {
                    		isInModalPanel = true;
                    		break;
                	}
                	cDivElement = cDivElement.parentNode;
            	}
        
            	if (isInModalPanel) {
                	if (Position.within($(this.id), e.clientX, e.clientY)) return true;
            	} else {
                	if (Position.within($(this.id), Event.pointerX(e), Event.pointerY(e))) return true;
            	}
            
		this.doCollapse();
		return true;
	}

I just check if any of the parent elements of the selected element is the div of the modal("cDiv"). Then if the action was done in the modal I execute the Position.within function without the scroll size, in the other case call the function like it was before. Ahhh I forgot, I add this functionality just for IE 7.

RasK

      was (Author: RasK):
    Hi, I solved this problem changing the function "eventOnCollapse" in the calendar.js on the  the richfaces-ui-3.1.4.jar.
I change the function to this:

	eventOnCollapse: function (e) {
		if (this.skipEventOnCollapse)
		{
			this.skipEventOnCollapse = false;
			return true;
		}

		if (Event.element(e).id == this.POPUP_BUTTON_ID || (!this.params.enableManualInput && Event.element(e).id == this.INPUT_DATE_ID) ) return true;
		//Position.prepare();
                var isInModalPanel = false;
                var cDivElement = $(this.id).parentNode;
                while(cDivElement.id != "mainForm") {
                	var cDivId = cDivElement.id;
                	if (cDivId.substr(cDivId.length - 4) == "CDiv") {
                    		isInModalPanel = true;
                    		break;
                	}
                	cDivElement = cDivElement.parentNode;
            	}
        
            	if (isInModalPanel) {
                	if (Position.within($(this.id), e.clientX, e.clientY)) return true;
            	} else {
                	if (Position.within($(this.id), Event.pointerX(e), Event.pointerY(e))) return true;
            	}
            
	    	this.doCollapse();
	    	return true;
	}

I just check if some of the parent of the selected element is the div of the modal("cDiv"). Then if the action was done in the modal I execute the Position.within function without the scroll size, in the other case call the function like it was before. Ahhh I forgot, I add this functionality just for IE 7.

RasK
  
> Page with modalpanel that has a calendar inside doesn't select the date
> -----------------------------------------------------------------------
>
>                 Key: RF-9018
>                 URL: https://jira.jboss.org/browse/RF-9018
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.1.4
>            Reporter: Raul Ospina
>             Fix For: Future_3.X
>
>
> When you have a page with a modalpanel that has a calendar inside. If the page behind the modal has a scrollbar move on the bottom then the calendar doesn select any date. This happend in Firefox 3 and IE 7

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list