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:13:20 UTC
svn commit: r1583332 - in /myfaces/tobago/branches/tobago-1.5.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-scarborough/src/main/java/org/...
Author: lofwyr
Date: Mon Mar 31 14:13:20 2014
New Revision: 1583332
URL: http://svn.apache.org/r1583332
Log:
TOBAGO-1382: New attribute "name" for <tc:object>
Modified:
myfaces/tobago/branches/tobago-1.5.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java
myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml
myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ObjectRenderer.java
Modified: myfaces/tobago/branches/tobago-1.5.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-1.5.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java?rev=1583332&r1=1583331&r2=1583332&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java Mon Mar 31 14:13:20 2014
@@ -30,9 +30,9 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutComponent;
-/*
- * Date: 02.04.2006
- * Time: 15:58:16
+/**
+ * Show external content inside of an application.
+ * This will typically renders an iframe tag.
*/
@Tag(name = "object", bodyContent = BodyContent.EMPTY)
@UIComponentTag(
@@ -42,10 +42,20 @@ import org.apache.myfaces.tobago.interna
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-1.5.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml?rev=1583332&r1=1583331&r2=1583332&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/navigation.xhtml Mon Mar 31 14:13:20 2014
@@ -50,7 +50,7 @@
<tc:treeNode expanded="true" 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>
@@ -59,7 +59,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-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ObjectRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ObjectRenderer.java?rev=1583332&r1=1583331&r2=1583332&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ObjectRenderer.java (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ObjectRenderer.java Mon Mar 31 14:13:20 2014
@@ -34,14 +34,19 @@ import javax.faces.context.FacesContext;
import java.io.IOException;
public class ObjectRenderer extends LayoutComponentRendererBase {
- public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
- UIObject object = (UIObject) component;
- TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+ public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
+ final UIObject object = (UIObject) component;
+ final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
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) {
@@ -50,7 +55,7 @@ public class ObjectRenderer extends Layo
writer.writeAttribute(HtmlAttributes.SRC, ResourceManagerUtils.getBlankPage(facesContext), false);
}
writer.writeClassAttribute(Classes.create(object));
- Style style = new Style(facesContext, object);
+ final Style style = new Style(facesContext, object);
writer.writeStyleAttribute(style);
String noframes = ResourceManagerUtils.getPropertyNotNull(