[richfaces-issues] [JBoss JIRA] (RF-11736) rich:popupPanel x domElementAttachment="parent"

Geert Bergman (JIRA) jira-events at lists.jboss.org
Sun May 5 19:39:53 EDT 2013


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

Geert Bergman commented on RF-11736:
------------------------------------

In ran into this bug using JBoss 4.2.2. Two comments:

1) When you close the popup using "hide()" the associated form (parent) style is set to "display=none". This means that the effective size the popup becomes 0px by 0px. When you open the popup it is correctly centered using this values: the center screen pixel. After that this style is set to block causing the form to display in the 4th quadrant of the screen.

My fix:

{code:JavaScript}
    /* Rich popupPanels seem to have a bug that causes them to position
     * themselves at the 4th quadrant of the screen when opened for the
     * second time. You can use this as a patch:
     * 
     * <r:popupPanel id="eventDialog" resizeable="false" autosized="true"
     *   onbeforeshow="fixCenter('eventForm:eventDialog');">
     */
    function fixCenter(popupFormId) {
      var p = document.getElementById(popupFormId);
      if (p) { 
          p.style.visibility = "hidden";
          p.style.display = "block";
      }     
    }
{code} 

2) This is worse: when trying to fix this I found something rather suspicious.

In "popupPanel.js" this code is (was) used:

{code:JavaScript}
            show: function(event, opts) {
                var element = this.cdiv;
                if (!this.shown && this.invokeEvent("beforeshow", event, null, element)) {
                    this.preventFocus();
{code} 

But in "richfaces-base-component.js" the parameter orders seems to be a different one:

{code:JavaScript}
            /**
             * Invokes event on on the DOM element
             * @param eventType event type, e.g. "click"
             * @param element DOM element object
             * @param event jQuery Event
             * @param data additional data used for event handler
             * @return true if an event is successfully invoked
             */
            invokeEvent: function(eventType, element, event, data) { 
{code} 

Hope this helps!
                
> rich:popupPanel x domElementAttachment="parent"
> -----------------------------------------------
>
>                 Key: RF-11736
>                 URL: https://issues.jboss.org/browse/RF-11736
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-panels-layout-themes
>    Affects Versions: 4.0.0.Final
>         Environment: NetBeans 7.0.0 + GlassFish 3.1.1 + JSF2 + CDI + RF4 + Hibernate3
>            Reporter: Edilmar Alves
>             Fix For: 5-Tracking
>
>
> rich:popupPanel repositions after second click when we use domElementAttachment="parent"

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the richfaces-issues mailing list