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

Brian Leathem (JIRA) jira-events at lists.jboss.org
Tue Apr 3 00:15:47 EDT 2012


     [ https://issues.jboss.org/browse/RF-11736?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Leathem updated RF-11736:
-------------------------------

    Workaround Description: 
Workaround from: https://community.jboss.org/message/727796#727796

I included a jquery function which will center an element to the screen.
{code}
jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px");
    this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
    return this;
}
{code}

Taken from http://stackoverflow.com/questions/210717/using-jquery-to-center-a-div-on-the-screen
 
 
I then put the following javascript into my buttons oncomplete attribute RichFaces.$('myForm:myPopup').getContentElement().center()
 
Using your button I would then make it
 
{code}
<a4j:commandButton id="buttonPanel" value="Open"
   render="openGrid"
   action="#{t.openPanel}"
   oncomplete="#{rich:component('openPanel')}.show(); RichFaces.$('formCad:openPanel').getContentElement().center()"/>
{code}
 
I tried putting the call into the popPanels onbeforeshow event attribute but I failed to get it to work there.  Hope this works for you.  If anyone finds a cleaner or better way please post it.
           Forum Reference: http://community.jboss.org/message/638238  (was: http://community.jboss.org/message/638238)

    
> 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: 4.3-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: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list