You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by dr...@apache.org on 2007/09/21 22:18:47 UTC

svn commit: r578255 - in /myfaces/trinidad/trunk/trinidad: trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/ trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ trinidad-impl/src/m...

Author: drobinson
Date: Fri Sep 21 13:18:47 2007
New Revision: 578255

URL: http://svn.apache.org/viewvc?rev=578255&view=rev
Log:
TRINIDAD-731

Modified:
    myfaces/trinidad/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CorePanelPopup.xml
    myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelPopupRenderer.java
    myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateField.js
    myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/PopupDialog.js

Modified: myfaces/trinidad/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CorePanelPopup.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CorePanelPopup.xml?rev=578255&r1=578254&r2=578255&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CorePanelPopup.xml (original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CorePanelPopup.xml Fri Sep 21 13:18:47 2007
@@ -128,10 +128,10 @@
       </property-extension>
     </property>
     <property>
-      <description><![CDATA[The popup's 'x' offset in pixels from the current mouse position.  
+      <description><![CDATA[The popup's horizontal offset in pixels from the current mouse position.  
         This property only applies to popups using relative positioning.]]>
       </description>
-      <property-name>xOffset</property-name>
+      <property-name>horzOffset</property-name>
       <property-class>int</property-class>
       <default-value>0</default-value>
       <property-extension>
@@ -139,10 +139,10 @@
       </property-extension>
     </property>
     <property>
-      <description><![CDATA[The popup's 'y' offset in pixels from the current mouse position.  
+      <description><![CDATA[The popup's vertical offset in pixels from the current mouse position.  
         This property only applies to popups using relative positioning.]]>
       </description>
-      <property-name>yOffset</property-name>
+      <property-name>vertOffset</property-name>
       <property-class>int</property-class>
       <default-value>0</default-value>
       <property-extension>
@@ -158,15 +158,6 @@
     </property>
     <property>
       <description>
-        <![CDATA[The inline style of the trigger.  This style 
-        will be applied trigger specified by either the text 
-        and/or icon attribute, or the 'trigger' facet.]]>
-      </description>
-      <property-name>triggerStyle</property-name>
-      <property-class>java.lang.String</property-class>
-    </property>
-    <property>
-      <description>
         <![CDATA[Set the width of the popup.  If not present the width defaults to the width of the content.]]>
       </description>
       <property-name>width</property-name>
@@ -202,7 +193,7 @@
 rendered for the popup panel.
 </html:p>
 <html:p>
-The alignment attribute of popupPanel can be used to control the location of the panel when visible.
+The position attribute of popupPanel can be used to control the location of the panel when visible.
 </html:p>
 <html:p>
   You can make changes to the style of the content region of this component by

Modified: myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelPopupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelPopupRenderer.java?rev=578255&r1=578254&r2=578255&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelPopupRenderer.java (original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelPopupRenderer.java Fri Sep 21 13:18:47 2007
@@ -58,89 +58,65 @@
     _contentStyleKey = type.findKey("contentStyle");
     _widthKey = type.findKey("width");
     _heightKey = type.findKey("height");
-    _xOffsetKey = type.findKey("xOffset");
-    _yOffsetKey = type.findKey("yOffset");
+    _horzOffsetKey = type.findKey("horzOffset");
+    _vertOffsetKey = type.findKey("vertOffset");
     _triggerRenderer = new TriggerRenderer();
   }
 
   protected String getText(FacesBean bean)
   {
-    return toString(bean.getProperty(_textKey));
+    return toString(resolveProperty(bean, _textKey));
   }
 
   protected String getTitle(FacesBean bean)
   {
-    return toString(bean.getProperty(_titleKey));
+    return toString(resolveProperty(bean, _titleKey));
   }
 
   protected String getTriggerType(FacesBean bean)
   {
-    String s = toString(bean.getProperty(_triggerTypeKey));
-    if (s == null || s.length()==0)
-      s = toString(_triggerTypeKey.getDefault());
-    return s;
+    return toString(resolveProperty(bean, _triggerTypeKey, true));
   }
 
   protected String getPosition(FacesBean bean)
   {
-    return toString(bean.getProperty(_positionKey));
+    return toString(resolveProperty(bean, _positionKey));
   }
 
   protected String getContentStyle(FacesBean bean)
   {
-    return toString(bean.getProperty(_contentStyleKey));
+    return toString(resolveProperty(bean, _contentStyleKey));
   }
 
   protected int getWidth(FacesBean bean)
   {
-    Object o = bean.getProperty(_widthKey);
-    if (o == null)
-      o = _widthKey.getDefault();
-    int i = toInt(o);
-    return (i<0) ? 0 : i;
+    return toInt(resolveProperty(bean, _widthKey, true));
   }
 
   protected int getHeight(FacesBean bean)
   {
-    Object o = bean.getProperty(_heightKey);
-    if (o == null)
-      o = _heightKey.getDefault();
-    int i = toInt(o);
-    return (i<0) ? 0 : i;
+    return toInt(resolveProperty(bean, _heightKey, true));
   }
 
-  protected int getXOffset(FacesBean bean)
+  protected int getHorzOffset(FacesBean bean)
   {
-    Object o = bean.getProperty(_xOffsetKey);
-    if (o == null)
-      o = _xOffsetKey.getDefault();
-    int i = toInt(o);
-    return (i<0) ? 0 : i;
+    return toInt(resolveProperty(bean, _horzOffsetKey, true));
   }
 
-  protected int getYOffset(FacesBean bean)
+  protected int getVertOffset(FacesBean bean)
   {
-    Object o = bean.getProperty(_yOffsetKey);
-    if (o == null)
-      o = _yOffsetKey.getDefault();
-    int i = toInt(o);
-    return (i<0) ? 0 : i;
+    return toInt(resolveProperty(bean, _vertOffsetKey, true));
   }
 
   protected boolean isModal(FacesBean bean)
   {
-    Object o = bean.getProperty(_modalKey);
-    if (o == null)
-      o = _modalKey.getDefault();
-    return Boolean.TRUE.equals(o);
+    return (Boolean)resolveProperty(bean, _modalKey, true);
   }
 
   protected boolean isCentered(FacesBean bean)
   {
-    String centeredString = toString(bean.getProperty(_positionKey));
-    if (centeredString != null)
-      return centeredString.equalsIgnoreCase(CorePanelPopup.POSITION_CENTERED);
-    return false;
+    String centeredString = toString(resolveProperty(bean, _positionKey));
+    return CorePanelPopup.POSITION_CENTERED.equalsIgnoreCase(centeredString);
   }
 
   @SuppressWarnings("unchecked")
@@ -175,6 +151,7 @@
     writer.startElement(XhtmlConstants.DIV_ELEMENT, null);
     writer.writeAttribute(XhtmlConstants.ID_ATTRIBUTE, XhtmlUtils.getJSIdentifier(clientId)
         + _POPUP_CONTAINER_ID_SUFFIX, null);
+
     // Output the non-modifiable styles the keep the popup hidden initially
     writer.writeAttribute(XhtmlConstants.STYLE_ATTRIBUTE,
         _POPUP_CONTAINER_DIV_STYLES, null);
@@ -182,13 +159,7 @@
     // Render the skinnable container div
     writer.startElement(XhtmlConstants.DIV_ELEMENT, null);
     renderStyleClass(context, arc, SkinSelectors.AF_PANEL_POPUP_CONTAINER_STYLE_CLASS);
-    // If width is set, then add that style to the container
-    int width = getWidth(bean);
-    if (width > 0)
-    {
-      String style = "width:" + width + "px";
-      writer.writeAttribute(XhtmlConstants.STYLE_ATTRIBUTE, style, null);
-    }
+    renderInlineStyle(context, arc, bean);
 
     renderTitleBar(context, arc, component, bean);
 
@@ -252,7 +223,7 @@
     // Render the skinnable title text
     writer.startElement(XhtmlConstants.DIV_ELEMENT, null);
     renderStyleClass(context, arc, SkinSelectors.AF_PANEL_POPUP_TITLE_STYLE_CLASS);
-    writer.writeAttribute(XhtmlConstants.STYLE_ATTRIBUTE, "float: left;", null);
+    writer.writeAttribute(XhtmlConstants.STYLE_ATTRIBUTE, "float:left;", null);
 
     writer.writeText(title, "title");
 
@@ -356,6 +327,18 @@
       return PanelPopupRenderer.this.getText(bean);
     }
     
+    @Override
+    protected String getInlineStyle(FacesBean bean)
+    {
+      return PanelPopupRenderer.this.getInlineStyle(bean);
+    }
+    
+    @Override
+    protected String getStyleClass(FacesBean bean)
+    {
+      return PanelPopupRenderer.this.getStyleClass(bean);
+    }
+    
     protected String getTriggerScript(FacesBean bean, String componentId)
     {
       String clientId = XhtmlUtils.getJSIdentifier(componentId);
@@ -377,9 +360,9 @@
       script.append(",");
       script.append(PanelPopupRenderer.this.getHeight(bean));
       script.append(",");
-      script.append(PanelPopupRenderer.this.getXOffset(bean));
+      script.append(PanelPopupRenderer.this.getHorzOffset(bean));
       script.append(",");
-      script.append(PanelPopupRenderer.this.getYOffset(bean));
+      script.append(PanelPopupRenderer.this.getVertOffset(bean));
       
       script.append("); return false;");
       
@@ -398,8 +381,8 @@
   private PropertyKey _contentStyleKey;
   private PropertyKey _widthKey;
   private PropertyKey _heightKey;
-  private PropertyKey _xOffsetKey;
-  private PropertyKey _yOffsetKey;
+  private PropertyKey _horzOffsetKey;
+  private PropertyKey _vertOffsetKey;
   private XhtmlRenderer _triggerRenderer;
   
   private static final String _POPUP_CONTAINER_ID_SUFFIX = "_popupContainer";

Modified: myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateField.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateField.js?rev=578255&r1=578254&r2=578255&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateField.js (original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateField.js Fri Sep 21 13:18:47 2007
@@ -189,8 +189,8 @@
   {
     destination = _jspDir + _getQuerySeparator(_jspDir);
 
+    //Only use frame redirect for non popup date picker
     if (usePopup)
-      //don't use frame redirect
       destination += "_t=cd";
     else
       destination += "_t=fred&_red=cd";

Modified: myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/PopupDialog.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/PopupDialog.js?rev=578255&r1=578254&r2=578255&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/PopupDialog.js (original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/PopupDialog.js Fri Sep 21 13:18:47 2007
@@ -137,7 +137,6 @@
   try
   {
     dialog = parent.TrPopupDialog.DIALOG;
-
   }
   catch(err)
   {
@@ -146,7 +145,12 @@
   if (!dialog)
     return;
 
+  // Update the dialog title
   dialog.setTitle(document.title);
+  
+  // Exit if the dialog is already visible
+  if (dialog.isVisible())
+    return;
     
   // Resize the dialog to the page content
   if (!dialog._fixedSize)