myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1583330 - in /myfaces/tobago/trunk: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ tobago-example/tobago-example-test/src/main/webapp/ tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/toba...
Date Mon, 31 Mar 2014 14:04:22 GMT
Author: lofwyr
Date: Mon Mar 31 14:04:22 2014
New Revision: 1583330

URL: http://svn.apache.org/r1583330
Log:
TOBAGO-1382: New attribute "name" for <tc:object>

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java?rev=1583330&r1=1583329&r2=1583330&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java
Mon Mar 31 14:04:22 2014
@@ -32,6 +32,10 @@ import org.apache.myfaces.tobago.interna
 
 import javax.faces.component.UIOutput;
 
+/**
+ * Show external content inside of an application.
+ * This will typically renders an iframe tag.
+ */
 @Tag(name = "object", bodyContent = BodyContent.EMPTY)
 @UIComponentTag(
     uiComponent = "org.apache.myfaces.tobago.component.UIObject",
@@ -42,10 +46,20 @@ import javax.faces.component.UIOutput;
     allowedChildComponenents = "NONE")
 public interface ObjectTagDeclaration extends HasIdBindingAndRendered, IsGridLayoutComponent,
HasMarkup,
     HasCurrentMarkup {
+
   /**
    * URI to object source
    */
-  @TagAttribute()
-  @UIComponentTagAttribute()
+  @TagAttribute
+  @UIComponentTagAttribute
   void setSrc(String src);
+
+  /**
+   * Name of the element.
+   * If not set the id will be used as name. The id in JSF normally contains colons.
+   * This doesn't work in Internet Explorer 9 and lower when using window.open(src, target).
+   */
+  @TagAttribute
+  @UIComponentTagAttribute
+  void setName(String name);
 }

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml?rev=1583330&r1=1583329&r2=1583330&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml
Mon Mar 31 14:04:22 2014
@@ -49,15 +49,15 @@
         <tc:treeNode disabled="#{node.disabled}">
           <tc:treeIndent/>
           <tc:treeIcon/>
-          <tc:treeCommand link="#{node.resource}" label="#{node.label}" target="page:content"
+          <tc:treeCommand link="#{node.resource}" label="#{node.label}" target="content"
                           rendered="#{node.childCount == 0}" markup="#{node.markup}"/>
           <tc:treeLabel value="#{node.label}" rendered="#{node.childCount > 0}"/>
         </tc:treeNode>
       </tc:tree>
     </tc:panel>
 
-    <!-- src will be set via <tc:treeNode target="page:content"> -->
-    <tc:object id="content"/>
+    <!-- src will be set via <tc:treeNode target="content"> -->
+    <tc:object name="content"/>
 
     <!--<tc:script file="http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js"/>-->
 

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java?rev=1583330&r1=1583329&r2=1583330&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java
Mon Mar 31 14:04:22 2014
@@ -40,8 +40,13 @@ public class ObjectRenderer extends Layo
 
     writer.startElement(HtmlElements.IFRAME, object);
     writer.writeAttribute(HtmlAttributes.FRAMEBORDER, "0", false);
-    writer.writeIdAttribute(object.getClientId(facesContext));
-    writer.writeNameAttribute(object.getClientId(facesContext));
+    final String clientId = object.getClientId(facesContext);
+    writer.writeIdAttribute(clientId);
+    String name = object.getName();
+    if (name == null) {
+      name = clientId;
+    }
+    writer.writeNameAttribute(name);
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, object);
     final String src = object.getSrc();
     if (src != null) {



Mime
View raw message