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 2015/10/07 16:09:32 UTC

svn commit: r1707310 - in /myfaces/tobago/branches/tobago-3.0.x: tobago-example/tobago-example-demo/src/main/webapp/content/06-validation/00/ tobago-example/tobago-example-demo/src/main/webapp/style/ tobago-theme/tobago-theme-standard/src/main/java/org...

Author: lofwyr
Date: Wed Oct  7 14:09:32 2015
New Revision: 1707310

URL: http://svn.apache.org/viewvc?rev=1707310&view=rev
Log:
TOBAGO-1497: Adapt the tc:messages to Bootstrap
- there must be a single outer tag per component, to work correctly with some layout managers

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/06-validation/00/validation-severity.xhtml
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/style/demo.css
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MessagesRenderer.java

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/06-validation/00/validation-severity.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/06-validation/00/validation-severity.xhtml?rev=1707310&r1=1707309&r2=1707310&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/06-validation/00/validation-severity.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/06-validation/00/validation-severity.xhtml Wed Oct  7 14:09:32 2015
@@ -19,40 +19,26 @@
 
 <ui:composition template="/layout/overview.xhtml"
                 xmlns:tc="http://myfaces.apache.org/tobago/component"
-                xmlns:ui="http://java.sun.com/jsf/facelets"
-                xmlns:f="http://java.sun.com/jsf/core">
+                xmlns:ui="http://java.sun.com/jsf/facelets">
   <ui:param name="title" value="#{overviewBundle.validation}"/>
-  <tc:panel>
-    <f:facet name="layout">
-      <tc:gridLayout rows="40px;auto;*;auto"/>
-    </f:facet>
 
-    <tc:out value="The validation process in JSF creates FacesMessages with different severities.
+  <tc:out value="The validation process in JSF creates FacesMessages with different severities.
       These severities will be used to add an corresponding CSS class to the elements via the markup mechanism,
-      e. g. tobago-label-markup-error."/>
-    <tc:panel>
-      <f:facet name="layout">
-        <tc:gridLayout columns="1*;1*"/>
-      </f:facet>
-      <tc:in label="Fatal" value="something" validator="#{validationSeverity.addFatal}"/>
-      <tc:out value="(Validator creates an fatal error)"/>
-      <tc:in label="Error" value="something" validator="#{validationSeverity.addError}"/>
-      <tc:out value="(Validator creates an error)"/>
-      <tc:in label="Warn" value="something" validator="#{validationSeverity.addWarn}"/>
-      <tc:out value="(Validator creates a warning)"/>
-      <tc:in label="Info" value="something" validator="#{validationSeverity.addInfo}"/>
-      <tc:out value="(Validator creates an info)"/>
-    </tc:panel>
+      e. g. tobago-label-markup-error." id="text"/>
+  <tc:segmentLayout small="6;6">
+    <tc:in label="Fatal" value="something" validator="#{validationSeverity.addFatal}" id="fatal"/>
+    <tc:out value="(Validator creates an fatal error)" id="o_fatal"/>
+    <tc:in label="Error" value="something" validator="#{validationSeverity.addError}" id="error"/>
+    <tc:out value="(Validator creates an error)" id="o_error"/>
+    <tc:in label="Warn" value="something" validator="#{validationSeverity.addWarn}" id="warn"/>
+    <tc:out value="(Validator creates a warning)" id="o_warn"/>
+    <tc:in label="Info" value="something" validator="#{validationSeverity.addInfo}" id="info"/>
+    <tc:out value="(Validator creates an info)" id="o_info"/>
+  </tc:segmentLayout>
 
-    <tc:panel/>
+  <tc:flowLayout>
+    <tc:style textAlign="right"/>
+    <tc:button label="#{overviewBundle.validation_submit}"/>
+  </tc:flowLayout>
 
-    <tc:panel>
-      <f:facet name="layout">
-        <tc:gridLayout columns="1*;100px"/>
-      </f:facet>
-      <tc:panel/>
-      <tc:button label="#{overviewBundle.validation_submit}"/>
-    </tc:panel>
-
-  </tc:panel>
 </ui:composition>

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/style/demo.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/style/demo.css?rev=1707310&r1=1707309&r2=1707310&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/style/demo.css (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/style/demo.css Wed Oct  7 14:09:32 2015
@@ -16,9 +16,15 @@
  */
 
 .demo-selected {
-  background-color: #fafad2;
+  background-color: #ffddff;
 }
 
 #demo-view-source .demo-selected {
   border: 1px solid #cccccc;
 }
+
+/* todo: should be switchable
+.comment {
+  display: none;
+}
+*/

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/MessagesRenderer.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/MessagesRenderer.java?rev=1707310&r1=1707309&r2=1707310&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/MessagesRenderer.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/MessagesRenderer.java Wed Oct  7 14:09:32 2015
@@ -93,6 +93,10 @@ public class MessagesRenderer extends Re
         clientIds = facesContext.getClientIdsWithMessages();
       }*/
 
+      writer.startElement(HtmlElements.DIV, messages);
+      writer.writeIdAttribute(messages.getClientId(facesContext));
+      writer.writeClassAttribute(TobagoClass.MESSAGES);
+
       FacesMessage.Severity lastSeverity = null;
       boolean first = true;
 
@@ -129,6 +133,8 @@ public class MessagesRenderer extends Re
         lastSeverity = severity;
         first = false;
       }
+      writer.endElement(HtmlElements.DIV); // close open tag from for-loop
+
       writer.endElement(HtmlElements.DIV);
 /*
       while(clientIds.hasNext()) {