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/08/17 08:49:22 UTC

svn commit: r1158541 - in /myfaces/tobago/trunk: tobago-example/tobago-example-demo/src/main/webapp/content/05/ tobago-example/tobago-example-demo/src/main/webapp/content/20/ tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago...

Author: lofwyr
Date: Wed Aug 17 06:49:22 2011
New Revision: 1158541

URL: http://svn.apache.org/viewvc?rev=1158541&view=rev
Log:
TOBAGO-1019: Automatic position of popup is not computed correctly

Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/05/toolBar.xhtml
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20/popup.xhtml
    myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/05/toolBar.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/05/toolBar.xhtml?rev=1158541&r1=1158540&r2=1158541&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/05/toolBar.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/05/toolBar.xhtml Wed Aug 17 06:49:22 2011
@@ -53,14 +53,16 @@
                            label="#{overviewBundle.toolbar_popupButtonAction}">
 
           <f:facet name="popup">
-            <tc:popup width="200" height="100" id="popup" modal="true">
+            <tc:popup id="popup" modal="true">
 
               <tc:box label="Message">
                 <f:facet name="layout">
-                  <tc:gridLayout rows="35px;1*;fixed"/>
+                  <tc:gridLayout rows="35px;1*;auto" columns="auto"/>
                 </f:facet>
 
-                <tc:out value="#{overviewBundle.toolbar_popupText}"/>
+                <tc:out value="#{overviewBundle.toolbar_popupText}">
+                  <tc:gridLayoutConstraint minimumWidth="200px"/>
+                </tc:out>
 
                 <tc:cell/>
                 <tc:button id="popupCloseButton" label="#{overviewBundle.toolbar_closePopupAction}">

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20/popup.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20/popup.xhtml?rev=1158541&r1=1158540&r2=1158541&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20/popup.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20/popup.xhtml Wed Aug 17 06:49:22 2011
@@ -28,7 +28,7 @@
 
   <tc:box label="Popups">
     <f:facet name="layout">
-      <tc:gridLayout rows="fixed;fixed;fixed;fixed;fixed;fixed;fixed;*"/>
+      <tc:gridLayout rows="auto;auto;auto;auto;auto;auto;auto;*"/>
     </f:facet>
     <f:facet name="menuBar">
       <tc:menuBar>
@@ -42,7 +42,7 @@
 
     <tc:panel>
       <f:facet name="layout">
-        <tc:gridLayout columns="fixed;fixed;fixed;fixed;*"/>
+        <tc:gridLayout columns="auto;auto;auto;auto;*"/>
       </f:facet>
 
       <tc:label value="Full Reload"/>
@@ -52,7 +52,7 @@
           <tc:popup id="modal_popup">
             <tc:box label="Modal text input" id="modal_box">
               <f:facet name="layout">
-                <tc:gridLayout rows="fixed;fixed;fixed;fixed;*;fixed"/>
+                <tc:gridLayout rows="auto;auto;auto;auto;*;auto" columns="auto"/>
               </f:facet>
               <f:facet name="menuBar">
                 <tc:menuBar>
@@ -75,7 +75,7 @@
               <tc:cell/>
               <tc:panel>
                 <f:facet name="layout">
-                  <tc:gridLayout columns="1*;1*;1*" margin="10"/>
+                  <tc:gridLayout columns="1*;1*;1*"/>
                 </f:facet>
                 <tc:button label="Cancel">
                   <tc:attribute name="popupClose" value="immediate"/>
@@ -98,14 +98,14 @@
           <tc:popup id="non_modal_popup" modal="false">
             <tc:box label="Non modal text input">
               <f:facet name="layout">
-                <tc:gridLayout rows="fixed;*;fixed"/>
+                <tc:gridLayout rows="auto;*;auto"/>
               </f:facet>
 
               <tx:in label="Field" required="true"/>
               <tc:cell/>
               <tc:panel>
                 <f:facet name="layout">
-                  <tc:gridLayout columns="*;fixed;fixed"/>
+                  <tc:gridLayout columns="*;auto;auto"/>
                 </f:facet>
                 <tc:cell/>
                 <tc:button label="Cancel">
@@ -130,7 +130,7 @@
             </f:facet>
             <tc:box label="Info">
               <f:facet name="layout">
-                <tc:gridLayout rows="*;fixed"/>
+                <tc:gridLayout rows="*;auto"/>
               </f:facet>
 
               <tc:textarea value="This popup should opened right beside the button." readonly="true"/>
@@ -148,7 +148,7 @@
     </tc:panel>
     <tc:panel>
       <f:facet name="layout">
-        <tc:gridLayout columns="fixed;fixed;fixed;fixed;*"/>
+        <tc:gridLayout columns="auto;auto;auto;auto;*"/>
       </f:facet>
 
       <tc:label value="Partial Reload"/>

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=1158541&r1=1158540&r2=1158541&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 Wed Aug 17 06:49:22 2011
@@ -93,10 +93,10 @@ public class PopupRenderer extends Layou
     // XXX May be computed in the "Layout Manager Phase"
     AbstractUIPage page = ComponentUtils.findPage(facesContext);
     if (popup.getLeft() == null) {
-      popup.setLeft(page.getWidth().subtract(popup.getWidth()).divide(2));
+      popup.setLeft(page.getCurrentWidth().subtract(popup.getCurrentWidth()).divide(2));
     }
     if (popup.getTop() == null) {
-      popup.setTop(page.getHeight().subtract(popup.getHeight()).divide(2));
+      popup.setTop(page.getCurrentHeight().subtract(popup.getCurrentHeight()).divide(2));
     }
 
     writer.startElement(HtmlElements.DIV, popup);