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 2014/03/31 16:18:53 UTC
svn commit: r1583333 - in /myfaces/tobago/branches/tobago-3.0.x:
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/apa...
Author: lofwyr
Date: Mon Mar 31 14:18:52 2014
New Revision: 1583333
URL: http://svn.apache.org/r1583333
Log:
TOBAGO-1382: New attribute "name" for <tc:object>
Modified:
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml
myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java?rev=1583333&r1=1583332&r2=1583333&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java Mon Mar 31 14:18:52 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/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml?rev=1583333&r1=1583332&r2=1583333&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml Mon Mar 31 14:18:52 2014
@@ -49,7 +49,7 @@
<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>
@@ -57,7 +57,7 @@
</tc:panel>
<!-- src will be set via <tc:treeNode target="page:content"> -->
- <tc:object id="content"/>
+ <tc:object name="content"/>
<!--<tc:script file="http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js"/>-->
Modified: myfaces/tobago/branches/tobago-3.0.x/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/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java?rev=1583333&r1=1583332&r2=1583333&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java Mon Mar 31 14:18:52 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) {