[richfaces-issues] [JBoss JIRA] (RF-13616) PopupPanel autosize with togglePanel doesn't resize

abhishek vijra (JIRA) issues at jboss.org
Fri Apr 25 06:02:34 EDT 2014


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

abhishek vijra updated RF-13616:
--------------------------------

    Steps to Reproduce: 
1. Without moving the PopupPanel directly switch to Panel Item 2.
  
  2. The PopupPanel is autosized as expected, correctly adjusting to the size difference between its previous and its current content. Now switch back to Panel Item 1.
  
  3. Move the PopupPanel around and then switch back to Panel Item 2.
  
  4. Notice that the PopupPanel isn't properly autosized anymore but is now stuck to the smaller width of Panel Item 1.
  
Switching to Panel Item 2 will autosize the PopupPanel properly if and only if it hasn't been moved yet. Looking into the PopupPanel source code we found that while initially moving the PopupPanel, the width of the currently active Panel Item is hard-set on said divs in the PopupPanel RichFaces.ui.PopupPanel.prototype.doResizeOrMove method which prevents all further autosizing on move.  

A possible workaround:- which overrides the original doResizeOrMove method on the RichFaces.ui.PopupPanel prototype and simply undoes the modifications of the previously undefined CSS widths properties on the relevant divs if the PopupPanel autosized attribute is enabled--can be activated by uncommenting the following code in /main/webapp/resources/js/patch-popup-panel.js:

  /*
  (function() {
    var richfacesUiPopupPanelDoResizeOrMove = RichFaces.ui.PopupPanel.prototype.doResizeOrMove;
    RichFaces.ui.PopupPanel.prototype.doResizeOrMove = function(diff) {
      var ret = richfacesUiPopupPanelDoResizeOrMove.call(this, diff);
      if (this.options.autosized) {
        this.cdiv.css("width", "");
        this.contentDiv.css("width", "");
        this.scrollerDiv.css("width", "");
        this.shadowDiv.css("width", "");
      }
      return ret;
    };
  }());
  */

  was:
1. Without moving the PopupPanel directly switch to Panel Item 2.
  
  2. The PopupPanel is autosized as expected, correctly adjusting to the size difference between its previous and its current content. Now switch back to Panel Item 1.
  
  3. Move the PopupPanel around and then switch back to Panel Item 2.
  
  4. Notice that the PopupPanel isn't properly autosized anymore but is now stuck to the smaller width of Panel Item 1.
  
Switching to Panel Item 2 will autosize the PopupPanel properly if and only if it hasn't been moved yet. Looking into the PopupPanel source code we found that while initially moving the PopupPanel, the width of the currently active Panel Item is hard-set on said divs in the PopupPanel RichFaces.ui.PopupPanel.prototype.doResizeOrMove method which prevents all further autosizing on move.  

A possible workaround----which overrides the original doResizeOrMove method on the RichFaces.ui.PopupPanel prototype and simply undoes the modifications of the previously undefined CSS widths properties on the relevant divs if the PopupPanel autosized attribute is enabled--can be activated by uncommenting the following code in /main/webapp/resources/js/patch-popup-panel.js:

  /*
  (function() {
    var richfacesUiPopupPanelDoResizeOrMove = RichFaces.ui.PopupPanel.prototype.doResizeOrMove;
    RichFaces.ui.PopupPanel.prototype.doResizeOrMove = function(diff) {
      var ret = richfacesUiPopupPanelDoResizeOrMove.call(this, diff);
      if (this.options.autosized) {
        this.cdiv.css("width", "");
        this.contentDiv.css("width", "");
        this.scrollerDiv.css("width", "");
        this.shadowDiv.css("width", "");
      }
      return ret;
    };
  }());
  */


    
> PopupPanel autosize with togglePanel doesn't resize
> ---------------------------------------------------
>
>                 Key: RF-13616
>                 URL: https://issues.jboss.org/browse/RF-13616
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component
>    Affects Versions: 4.2.3.Final
>            Reporter: abhishek vijra
>
> PopupPanel doesn't autosize correctly after move. Moving a PopupPanel with 'autosized' attribute enabled causes the width properties of its inner container div, content div, srcoller div, and shadow div to be hard-set such that a subsequent content change doesn't trigger the auto-resize of the PopupPanel any longer. The PopupPanel height is apparently unaffected.
> Attached is a testcase to demonstrate the problem, see the attached zip file containing a minimal JSF application which reproduces the undesired behavior.

--
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