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 2018/08/23 12:47:18 UTC

[myfaces-tobago] branch master updated: TOBAGO-1919: New attribute "plain" to render only content, without out HTML element TOBAGO-1918: Possibility to set a form as "transparent" for layout

This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 2693d35  TOBAGO-1919: New attribute "plain" to render only content, without out HTML element TOBAGO-1918: Possibility to set a form as "transparent" for layout
2693d35 is described below

commit 2693d35c64644f20449238dc1a75bf29b441c65d
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Thu Aug 23 14:47:01 2018 +0200

    TOBAGO-1919: New attribute "plain" to render only content, without out HTML element
    TOBAGO-1918: Possibility to set a form as "transparent" for layout
---
 .../myfaces/tobago/component/Attributes.java       |  9 +++++
 .../apache/myfaces/tobago/component/Visual.java    |  3 ++
 .../tobago/internal/component/AbstractUIForm.java  |  3 ++
 .../tobago/internal/component/AbstractUIOut.java   |  8 +++++
 .../internal/renderkit/renderer/FormRenderer.java  | 32 ++++++++++-------
 .../internal/renderkit/renderer/OutRenderer.java   |  8 ++---
 .../renderkit/renderer/SegmentLayoutRenderer.java  |  8 ++---
 .../taglib/component/FormTagDeclaration.java       |  3 +-
 .../taglib/component/OutTagDeclaration.java        |  6 +++-
 .../taglib/declaration/IsPlain.java}               | 34 +++++++++---------
 .../apache/myfaces/tobago/util/ComponentUtils.java | 42 ++++++++++------------
 ...OverwritingOfGeneratedUIComponentsUnitTest.java |  2 ++
 .../20-component/020-output/10-out/out.xhtml       |  2 +-
 .../16-layout/30-segment/segment-layout.xhtml      | 16 ++++-----
 14 files changed, 101 insertions(+), 75 deletions(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
index 4e2139d..ae2213e 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
@@ -71,11 +71,19 @@ public enum Attributes {
   columnSpan,
   columnSpacing,
   columns,
+  /**
+   * @deprecated since 4.3.0
+   */
+  @Deprecated
   compact,
   confirmation,
   content,
   converter,
   customClass,
+  /**
+   * @deprecated since 4.0.0
+   */
+  @Deprecated
   createSpan,
   css,
   cssClassesBlocks,
@@ -299,6 +307,7 @@ public enum Attributes {
   pagingTarget,
   password,
   placeholder,
+  plain,
   popupClose,
   popupList,
   popupReset,
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Visual.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Visual.java
index aa37ecb..78ef99a 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Visual.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Visual.java
@@ -40,4 +40,7 @@ public interface Visual {
    */
   String getRendererType();
 
+  default boolean isPlain() {
+    return false;
+  }
 }
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java
index c65dd65..e9e59e4 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java
@@ -26,5 +26,8 @@ public abstract class AbstractUIForm extends AbstractUIFormBase {
 
   public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Form";
 
+  /**
+   * @deprecated since 4.0.0.
+   */
   public abstract boolean isInline();
 }
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIOut.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIOut.java
index e1f38b9..9dae765 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIOut.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIOut.java
@@ -35,8 +35,16 @@ public abstract class AbstractUIOut extends UIOutput implements SupportsLabelLay
 
   public abstract boolean isKeepLineBreaks();
 
+  /**
+   * @deprecated since 4.0.0, please use Visual#isPlain()
+   */
+  @Deprecated
   public abstract boolean isCreateSpan();
 
+  /**
+   * @deprecated since 4.3.0, please use Visual#isPlain()
+   */
+  @Deprecated
   public abstract boolean isCompact();
 
   public abstract SanitizeMode getSanitize();
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FormRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FormRenderer.java
index 5d42415..7f5f6b7 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FormRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FormRenderer.java
@@ -37,23 +37,29 @@ public class FormRenderer extends RendererBase {
   @Override
   public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
     final AbstractUIForm form = (AbstractUIForm) component;
-    final TobagoResponseWriter writer = getResponseWriter(facesContext);
-    final String clientId = form.getClientId(facesContext);
-    final boolean inline = form.isInline();
-
-    writer.startElement(HtmlElements.DIV);
-    writer.writeIdAttribute(clientId);
-    writer.writeAttribute(DataAttributes.MARKUP, JsonUtils.encode(form.getMarkup()), false);
-    writer.writeClassAttribute(
-        TobagoClass.FORM,
-        inline ? BootstrapClass.D_INLINE : null,
-        form.getCustomClass());
 
+    if (!form.isPlain()) {
+      final TobagoResponseWriter writer = getResponseWriter(facesContext);
+      final String clientId = form.getClientId(facesContext);
+      final boolean inline = form.isInline();
+
+      writer.startElement(HtmlElements.DIV);
+      writer.writeIdAttribute(clientId);
+      writer.writeAttribute(DataAttributes.MARKUP, JsonUtils.encode(form.getMarkup()), false);
+      writer.writeClassAttribute(
+          TobagoClass.FORM,
+          inline ? BootstrapClass.D_INLINE : null,
+          form.getCustomClass());
+    }
   }
 
   @Override
   public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
-    final TobagoResponseWriter writer = getResponseWriter(facesContext);
-    writer.endElement(HtmlElements.DIV);
+    final AbstractUIForm form = (AbstractUIForm) component;
+
+    if (!form.isPlain()) {
+      final TobagoResponseWriter writer = getResponseWriter(facesContext);
+      writer.endElement(HtmlElements.DIV);
+    }
   }
 }
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/OutRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/OutRenderer.java
index 9cc0e0e..719ff99 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/OutRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/OutRenderer.java
@@ -57,10 +57,10 @@ public class OutRenderer extends MessageLayoutRendererBase {
 
     final boolean escape = out.isEscape();
     final boolean keepLineBreaks = out.isKeepLineBreaks();
-    final boolean compact = out.isCompact() || !out.isCreateSpan();
+    final boolean plain = out.isPlain() || out.isCompact() || !out.isCreateSpan();
     final Markup markup = out.getMarkup();
 
-    if (!compact) {
+    if (!plain) {
       writer.startElement(HtmlElements.SPAN);
       if (out.isLabelLayoutSkip()) {
         writer.writeIdAttribute(out.getClientId());
@@ -107,9 +107,9 @@ public class OutRenderer extends MessageLayoutRendererBase {
 
     final UIOut out = (UIOut) component;
     final TobagoResponseWriter writer = getResponseWriter(facesContext);
-    final boolean compact = out.isCompact() || !out.isCreateSpan();
+    final boolean plain = out.isPlain() || out.isCompact() || !out.isCreateSpan();
 
-    if (!compact) {
+    if (!plain) {
       writer.endElement(HtmlElements.SPAN);
     }
   }
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SegmentLayoutRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SegmentLayoutRenderer.java
index eddefcf..ed00d1e 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SegmentLayoutRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SegmentLayoutRenderer.java
@@ -31,9 +31,8 @@ import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
+import org.apache.myfaces.tobago.util.ComponentUtils;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -45,8 +44,6 @@ import java.util.List;
  */
 public class SegmentLayoutRenderer extends RendererBase {
 
-  private static final Logger LOG = LoggerFactory.getLogger(SegmentLayoutRenderer.class);
-
   @Override
   public boolean getRendersChildren() {
     return true;
@@ -80,7 +77,8 @@ public class SegmentLayoutRenderer extends RendererBase {
       return;
     }
 
-    final List<UIComponent> children = segmentLayout.getChildren();
+//    final List<UIComponent> children = segmentLayout.getChildren();
+    final List<UIComponent> children = ComponentUtils.findLayoutChildren(segmentLayout);
     final BootstrapClass.Generator generator = new BootstrapClass.Generator(
         segmentLayout.getExtraSmall(),
         segmentLayout.getSmall(),
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FormTagDeclaration.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FormTagDeclaration.java
index fbed2ab..8e7ad64 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FormTagDeclaration.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FormTagDeclaration.java
@@ -26,6 +26,7 @@ import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
 import org.apache.myfaces.tobago.component.RendererTypes;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasBinding;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasId;
+import org.apache.myfaces.tobago.internal.taglib.declaration.IsPlain;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsVisual;
 
 import javax.faces.component.UIForm;
@@ -48,7 +49,7 @@ import javax.faces.component.UIForm;
         "javax.faces.component.behavior.ClientBehaviorHolder"
     },
     allowedChildComponenents = "ALL")
-public interface FormTagDeclaration extends HasBinding, HasId, IsVisual {
+public interface FormTagDeclaration extends HasBinding, HasId, IsVisual, IsPlain {
 
   /**
    * Flag indicating this component should rendered as an inline element.
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/OutTagDeclaration.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/OutTagDeclaration.java
index 45b166d..fabe8f1 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/OutTagDeclaration.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/OutTagDeclaration.java
@@ -32,6 +32,7 @@ import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabelLayout;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasSanitize;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasValue;
+import org.apache.myfaces.tobago.internal.taglib.declaration.IsPlain;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsVisual;
 
 import javax.faces.component.UIOutput;
@@ -56,7 +57,7 @@ import javax.faces.component.UIOutput;
 
 public interface OutTagDeclaration
     extends HasIdBindingAndRendered, HasConverter, HasTip, HasValue, IsVisual,
-    HasSanitize, HasLabel, HasLabelLayout {
+    HasSanitize, HasLabel, HasLabelLayout, IsPlain {
 
   /**
    * Flag indicating that characters that are
@@ -90,7 +91,10 @@ public interface OutTagDeclaration
    * This attribute is useful if labelLayout=skip is set.
    * Use true, if you want to only render the text (no surrounding tag).
    * Use false, if you enable the possibility to apply styles to the output.
+   *
+   * @deprecated since 4.3.0. Use attribute 'plain' instead.
    */
+  @Deprecated
   @TagAttribute
   @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
   void setCompact(String compact);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Visual.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/IsPlain.java
similarity index 50%
copy from tobago-core/src/main/java/org/apache/myfaces/tobago/component/Visual.java
copy to tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/IsPlain.java
index aa37ecb..5635f71 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Visual.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/IsPlain.java
@@ -17,27 +17,25 @@
  * under the License.
  */
 
-package org.apache.myfaces.tobago.component;
+package org.apache.myfaces.tobago.internal.taglib.declaration;
 
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
 
-import org.apache.myfaces.tobago.context.Markup;
-import org.apache.myfaces.tobago.renderkit.css.CustomClass;
-
-public interface Visual {
-
-  Markup getMarkup();
-
-  void setMarkup(Markup markup);
-
-  CustomClass getCustomClass();
-
-  void setCustomClass(CustomClass customClass);
+public interface IsPlain {
 
   /**
-   * The renderer is an id that is used by Tobago to gather information about the components which are
-   * configured in the theme configuration files. E. g. the preferredWidth of a component.
-   * @return The renderer type.
+   * This attribute is useful for tc:out if labelLayout=skip is set.
+   * Use true, if you want to only render the text (no surrounding tag).
+   * Use false, if you enable the possibility to apply styles to the output.
+   *
+   * For tc:form there will no div tag be rendered. So, the content
+   * can be used freely from layout managers.
+   *
+   * But, no AJAX is possible for components with "plain" set,
+   * because there is no client element with an "id" in the DOM.
    */
-  String getRendererType();
-
+  @TagAttribute
+  @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
+  void setPlain(String plain);
 }
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
index c9045b1..9965a6b 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
@@ -92,7 +92,7 @@ public final class ComponentUtils {
   }
 
   public static boolean hasErrorMessages(final FacesContext context) {
-    for (final Iterator iter = context.getMessages(); iter.hasNext();) {
+    for (final Iterator iter = context.getMessages(); iter.hasNext(); ) {
       final FacesMessage message = (FacesMessage) iter.next();
       if (FacesMessage.SEVERITY_ERROR.compareTo(message.getSeverity()) <= 0) {
         return true;
@@ -143,8 +143,8 @@ public final class ComponentUtils {
   }
 
   /**
-   * Tries to walk up the parents to find the UIViewRoot, if not found, then go to FaceletContext's FacesContext for
-   * the view root.
+   * Tries to walk up the parents to find the UIViewRoot, if not found, then go to FaceletContext's FacesContext for the
+   * view root.
    */
   public static UIViewRoot findViewRoot(final FaceletContext faceletContext, final UIComponent component) {
     final UIViewRoot viewRoot = findAncestor(component, UIViewRoot.class);
@@ -227,8 +227,7 @@ public final class ComponentUtils {
   }
 
   /**
-   * Find all sub forms of a component, and collects it.
-   * It does not find sub forms of sub forms.
+   * Find all sub forms of a component, and collects it. It does not find sub forms of sub forms.
    */
   public static List<AbstractUIForm> findSubForms(final UIComponent component) {
     final List<AbstractUIForm> collect = new ArrayList<>();
@@ -314,11 +313,9 @@ public final class ComponentUtils {
   }
 
   /**
-   * Looks for the attribute "for" in the component. If there is any
-   * search for the component which is referenced by the "for" attribute,
-   * and return their clientId.
-   * If there is no "for" attribute, return the "clientId" of the parent
-   * (if it has a parent). This is useful for labels.
+   * Looks for the attribute "for" in the component. If there is any search for the component which is referenced by the
+   * "for" attribute, and return their clientId. If there is no "for" attribute, return the "clientId" of the parent (if
+   * it has a parent). This is useful for labels.
    */
   public static String findClientIdFor(final UIComponent component, final FacesContext facesContext) {
     final UIComponent forComponent = findFor(component);
@@ -344,10 +341,9 @@ public final class ComponentUtils {
   }
 
   /**
-   * Looks for the attribute "for" of the component.
-   * In case that the value is equals to "@auto" the children of the parent will be
-   * checked if they are of the type of the parameter clazz. The "id" of the first one will be used to reset the "for"
-   * attribute of the component.
+   * Looks for the attribute "for" of the component. In case that the value is equals to "@auto" the children of the
+   * parent will be checked if they are of the type of the parameter clazz. The "id" of the first one will be used to
+   * reset the "for" attribute of the component.
    */
   public static void evaluateAutoFor(final UIComponent component, final Class<? extends UIComponent> clazz) {
     final String forComponent = getStringAttribute(component, Attributes.forValue);
@@ -550,7 +546,7 @@ public final class ComponentUtils {
   }
 
   public static RendererBase getRenderer(final FacesContext facesContext, final String family,
-      final String rendererType) {
+                                         final String rendererType) {
     if (rendererType == null) {
       return null;
     }
@@ -759,7 +755,7 @@ public final class ComponentUtils {
     if (container instanceof UIComponent) {
       final String clientId = ((UIComponent) container).getClientId(facesContext);
       FacesMessage.Severity max = null;
-      for (final Iterator ids = facesContext.getClientIdsWithMessages(); ids.hasNext();) {
+      for (final Iterator ids = facesContext.getClientIdsWithMessages(); ids.hasNext(); ) {
         final String id = (String) ids.next();
         if (id != null && id.startsWith(clientId)) {
           final Iterator messages = facesContext.getMessages(id);
@@ -777,8 +773,7 @@ public final class ComponentUtils {
   }
 
   /**
-   * Adding a data attribute to the component.
-   * The name must start with "data-", e. g. "data-tobago-foo" or "data-bar"
+   * Adding a data attribute to the component. The name must start with "data-", e. g. "data-tobago-foo" or "data-bar"
    */
   public static void putDataAttributeWithPrefix(
       final UIComponent component, final DataAttributes name, final Object value) {
@@ -790,8 +785,7 @@ public final class ComponentUtils {
   }
 
   /**
-   * Adding a data attribute to the component.
-   * The name should not start with "data-", e. g. "tobago-foo" or "bar"
+   * Adding a data attribute to the component. The name should not start with "data-", e. g. "tobago-foo" or "bar"
    */
   public static void putDataAttribute(final UIComponent component, final Object name, final Object value) {
     Map<Object, Object> map = getDataAttributes(component);
@@ -885,20 +879,20 @@ public final class ComponentUtils {
 
   private static void addLayoutChildren(final UIComponent component, final List<UIComponent> result) {
     for (final UIComponent child : component.getChildren()) {
-      if (child instanceof Visual) {
+      if (child instanceof Visual && !((Visual) child).isPlain()) {
         result.add(child);
       } else {
-        // Child seems to be transparent for layout, like UIForm.
+        // Child seems to be transparent for layout, like UIForm with "plain" set.
         // So we try to add the inner components.
         addLayoutChildren(child, result);
       }
     }
 
     final UIComponent child = component.getFacet(UIComponent.COMPOSITE_FACET_NAME);
-    if (child instanceof Visual) {
+    if (child instanceof Visual && !((Visual) child).isPlain()) {
       result.add(child);
     } else if (child != null) {
-      // Child seems to be transparent for layout, like UIForm.
+      // Child seems to be transparent for layout, like UIForm with "plain" set.
       // So we try to add the inner components.
       addLayoutChildren(child, result);
     }
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/component/MethodOverwritingOfGeneratedUIComponentsUnitTest.java b/tobago-core/src/test/java/org/apache/myfaces/tobago/component/MethodOverwritingOfGeneratedUIComponentsUnitTest.java
index 950bf94..ed286fb 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/component/MethodOverwritingOfGeneratedUIComponentsUnitTest.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/component/MethodOverwritingOfGeneratedUIComponentsUnitTest.java
@@ -40,6 +40,8 @@ public class MethodOverwritingOfGeneratedUIComponentsUnitTest extends AbstractGe
     IGNORED_METHODS_PER_COMPONENT.add("isResizable", UIColumnNode.class);
     IGNORED_METHODS_PER_COMPONENT.add("isShowRootJunction", UISheet.class);
     IGNORED_METHODS_PER_COMPONENT.add("isShowRootJunction", UITree.class);
+    IGNORED_METHODS_PER_COMPONENT.add("isPlain", UIOut.class);
+    IGNORED_METHODS_PER_COMPONENT.add("isPlain", UIForm.class);
   }
 
   @Test
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/10-out/out.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/10-out/out.xhtml
index 5fc9db5..601b90c 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/10-out/out.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/10-out/out.xhtml
@@ -35,7 +35,7 @@
       <tc:out id="outSkip" value="This text is rendered by tc:out with labelLayout=skip." labelLayout="skip"/>
       <p>Set <code>compact="true"</code> to remove the surrounding tag as well.</p>
       <tc:out id="outSkipCompact" value="This text is rendered by tc:out with labelLayout=skip and compact=true."
-              labelLayout="skip" compact="true"/>
+              labelLayout="skip" plain="true"/>
     </tc:section>
   </tc:section>
   <tc:section label="Escape">
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/16-layout/30-segment/segment-layout.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/16-layout/30-segment/segment-layout.xhtml
index 020c4e7..79f0681 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/16-layout/30-segment/segment-layout.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/16-layout/30-segment/segment-layout.xhtml
@@ -36,14 +36,14 @@
       <p>The sum of the values is 12.</p>
       <pre><code class="language-markup">&lt;tc:segmentLayout extraSmall="2seg 3seg 4seg 3seg"></code></pre>
       <tc:segmentLayout extraSmall="2seg 3seg 4seg 3seg">
-        <tc:in value="2"/>
-        <tc:in value="3"/>
-        <tc:in value="4"/>
-        <tc:in value="3"/>
-        <tc:in value="2"/>
-        <tc:in value="3"/>
-        <tc:in value="4"/>
-        <tc:in value="3"/>
+        <tc:in value="2seg"/>
+        <tc:in value="3seg"/>
+        <tc:in value="4seg"/>
+        <tc:in value="3seg"/>
+        <tc:in value="2seg"/>
+        <tc:in value="3seg"/>
+        <tc:in value="4seg"/>
+        <tc:in value="3seg"/>
       </tc:segmentLayout>
     </tc:section>
     <tc:section label="3 Columns">