incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r533180 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml: LabelAndMessageRenderer.java OutputLabelRenderer.java
Date Fri, 27 Apr 2007 18:00:23 GMT
Author: awiner
Date: Fri Apr 27 11:00:22 2007
New Revision: 533180

URL: http://svn.apache.org/viewvc?view=rev&rev=533180
Log:
ADFFACES-471: PPR in a panelFormLayout
- Eliminate the warning generated when you PPR an input component in a panelFormLayout.
- The warning is actually pointing out that the label part of the component could
  not be PPR replaced, because it doesn't have an "id" on it.  We might want to
  start rendering an id there to enabel this, but for now just make PPR happy by
  no longer passing the component to startElement() in this case

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/LabelAndMessageRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/OutputLabelRenderer.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/LabelAndMessageRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/LabelAndMessageRenderer.java?view=diff&rev=533180&r1=533179&r2=533180
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/LabelAndMessageRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/LabelAndMessageRenderer.java
Fri Apr 27 11:00:22 2007
@@ -526,6 +526,15 @@
     }
 
     @Override
+    protected boolean needComponentInStartElement()
+    {
+      // Because we're not rendering the ID on the label (at this time)
+      // there's no point in passing the component to startElement() - it
+      // just makes PPR unhappy to do so
+      return false;
+    }
+
+    @Override
     protected void renderAllAttributes(
       FacesContext        context,
       RenderingContext arc,

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/OutputLabelRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/OutputLabelRenderer.java?view=diff&rev=533180&r1=533179&r2=533180
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/OutputLabelRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/OutputLabelRenderer.java
Fri Apr 27 11:00:22 2007
@@ -97,7 +97,7 @@
 
     if (!noSpanNeeded)
     {
-      rw.startElement("span", component);
+      rw.startElement("span", needComponentInStartElement() ? component : null);
       renderId(context, component);
       renderAllAttributes(context, arc, bean);
     }
@@ -128,7 +128,7 @@
       
       if (needsLabel)
       {
-        rw.startElement("label", component);
+        rw.startElement("label", needComponentInStartElement() ? component : null);
         if (forId != null)
         {
           rw.writeAttribute("for", forId, "for");
@@ -161,6 +161,11 @@
     {
       rw.endElement("span");
     }
+  }
+
+  protected boolean needComponentInStartElement()
+  {
+    return true;
   }
 
   protected boolean encodeIcons(



Mime
View raw message