You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2017/06/02 14:57:34 UTC
svn commit: r1797399 - in
/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago:
facelets/StyleHandler.java internal/taglib/component/StyleTagDeclaration.java
Author: hnoeth
Date: Fri Jun 2 14:57:34 2017
New Revision: 1797399
URL: http://svn.apache.org/viewvc?rev=1797399&view=rev
Log:
TOBAGO-1748 Implement rendered attribute for <tc:style>
* rendered attribute implemented, but also set deprecated
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java?rev=1797399&r1=1797398&r2=1797399&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java Fri Jun 2 14:57:34 2017
@@ -21,6 +21,7 @@ package org.apache.myfaces.tobago.facele
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.Visual;
+import org.apache.myfaces.tobago.internal.util.Deprecation;
import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
import org.apache.myfaces.tobago.internal.util.StringUtils;
import org.apache.myfaces.tobago.layout.Display;
@@ -106,7 +107,13 @@ public final class StyleHandler extends
@Override
public void apply(final FaceletContext faceletContext, final UIComponent parent) throws ELException {
- if (ComponentHandler.isNew(parent)) {
+ boolean renderedSet = getAttribute(Attributes.rendered.getName()) != null;
+ if (renderedSet) {
+ Deprecation.LOG.warn("Attribute 'rendered' is deprecated for tc:style.");
+ }
+ boolean rendered = !renderedSet || getAttribute(Attributes.rendered.getName()).getBoolean(faceletContext);
+
+ if (ComponentHandler.isNew(parent) && rendered) {
// file
if (file != null) {
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java?rev=1797399&r1=1797398&r2=1797399&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java Fri Jun 2 14:57:34 2017
@@ -40,6 +40,17 @@ import org.apache.myfaces.tobago.layout.
public interface StyleTagDeclaration extends HasIdBindingAndRendered {
/**
+ * Flag indicating whether or not this component should be rendered
+ * (during Render Response Phase), or processed on any subsequent form submit.
+ */
+ @Deprecated
+ @TagAttribute
+ @UIComponentTagAttribute(
+ type = "boolean",
+ defaultValue = "true")
+ void setRendered(String rendered);
+
+ /**
* Name of the stylesheet file to add to page. The name must be full qualified, or relative.
* If using a complete path from root, you'll need to add the contextPath from the web application.
* This can be done with the EL #{request.contextPath}.