You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2011/10/17 15:02:11 UTC

svn commit: r1185145 - in /myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main: java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/

Author: lofwyr
Date: Mon Oct 17 13:02:10 2011
New Revision: 1185145

URL: http://svn.apache.org/viewvc?rev=1185145&view=rev
Log:
TOBAGO-1011: Popup should determine its size automatically
- popup with unset width/height are invisible, when using default layout: Workaround

Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java?rev=1185145&r1=1185144&r2=1185145&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java Mon Oct 17 13:02:10 2011
@@ -22,6 +22,7 @@ import org.apache.myfaces.tobago.context
 import org.apache.myfaces.tobago.internal.component.AbstractUIPage;
 import org.apache.myfaces.tobago.internal.layout.LayoutContext;
 import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
+import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
 import org.apache.myfaces.tobago.renderkit.css.Classes;
 import org.apache.myfaces.tobago.renderkit.css.Style;
@@ -83,6 +84,15 @@ public class PopupRenderer extends Layou
     layoutContext.layout();
     LOG.info("Laying out takes: " + new DecimalFormat("#,##0").format(System.nanoTime() - begin) + " ns");
 
+    // XXX fixing invisible popups
+    if (popup.getWidth() == null || popup.getWidth().equals(Measure.ZERO)) {
+      LOG.warn("Undefined width of popup with id='" + popup.getClientId(facesContext) + "'");
+      popup.setWidth(getPreferredWidth(facesContext, popup));
+    }
+    if (popup.getHeight() == null || popup.getHeight().equals(Measure.ZERO)) {
+      LOG.warn("Undefined height of popup with id='" + popup.getClientId(facesContext) + "'");
+      popup.setHeight(getPreferredHeight(facesContext, popup));
+    }
 // LAYOUT End
 
     final String clientId = popup.getClientId(facesContext);

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties?rev=1185145&r1=1185144&r2=1185145&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties Mon Oct 17 13:02:10 2011
@@ -143,6 +143,9 @@ Panel.headerHeight=0
 Panel.minimumWidth=0
 Panel.minimumHeight=0
 
+Popup.preferredHeight=100
+Popup.preferredWidth=100
+
 Progress.preferredHeight=25
 Progress.css.border-left-width=2
 Progress.css.border-top-width=2