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 2009/12/07 17:22:57 UTC

svn commit: r887977 - in /myfaces/tobago/branches/tobago-1.0.x: core/src/main/java/org/apache/myfaces/tobago/taglib/extension/ extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/

Author: lofwyr
Date: Mon Dec  7 16:22:57 2009
New Revision: 887977

URL: http://svn.apache.org/viewvc?rev=887977&view=rev
Log:
TOBAGO-831: tip in tx-components should transfer the top to the panel instead to the label only.
 - setter must be called before the startTag method

Modified:
    myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/LabelExtensionTag.java
    myfaces/tobago/branches/tobago-1.0.x/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java

Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/LabelExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/LabelExtensionTag.java?rev=887977&r1=887976&r2=887977&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/LabelExtensionTag.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/LabelExtensionTag.java Mon Dec  7 16:22:57 2009
@@ -19,8 +19,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import static org.apache.myfaces.tobago.TobagoConstants.FACET_LAYOUT;
 import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.taglib.component.GridLayoutTag;
@@ -35,6 +33,8 @@
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.BodyTagSupport;
 
+import static org.apache.myfaces.tobago.TobagoConstants.FACET_LAYOUT;
+
 @Tag(name = "label")
 @ExtensionTag(baseClassName = "org.apache.myfaces.tobago.taglib.component.LabelTag")
 public class LabelExtensionTag extends BodyTagSupport
@@ -62,6 +62,9 @@
     if (rendered != null) {
       panelTag.setRendered(rendered);
     }
+    if (tip != null) {
+      panelTag.setTip(tip);
+    }
     panelTag.doStartTag();
 
     FacetTag facetTag = new FacetTag();
@@ -85,9 +88,6 @@
     if (value != null) {
       labelTag.setValue(value);
     }
-    if (tip != null) {
-      labelTag.setTip(tip);
-    }
     if (markup != null) {
       labelTag.setMarkup(markup);
     }

Modified: myfaces/tobago/branches/tobago-1.0.x/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java?rev=887977&r1=887976&r2=887977&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java Mon Dec  7 16:22:57 2009
@@ -27,12 +27,12 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.tobago.TobagoConstants;
+import org.apache.myfaces.tobago.component.ComponentUtil;
 import org.apache.myfaces.tobago.component.SupportsMarkup;
 import org.apache.myfaces.tobago.component.UIGridLayout;
 import org.apache.myfaces.tobago.component.UIInput;
 import org.apache.myfaces.tobago.component.UILabel;
 import org.apache.myfaces.tobago.component.UIPanel;
-import org.apache.myfaces.tobago.component.ComponentUtil;
 import org.apache.myfaces.tobago.facelets.SuggestMethodRule;
 import org.apache.myfaces.tobago.facelets.SupportsMarkupRule;
 import org.apache.myfaces.tobago.util.LayoutUtil;
@@ -107,7 +107,7 @@
 
     addGridLayout(faceletContext, panel, root);
 
-    addLabel(faceletContext, panel, root);
+    addLabel(faceletContext, (UIPanel)panel, root);
     String uid;
     if (fieldIdAttribute !=  null) {
       uid = fieldIdAttribute.getValue(faceletContext);
@@ -128,7 +128,7 @@
   }
 
 
-  private void addLabel(FaceletContext faceletContext, UIComponent panel, UIViewRoot root) {
+  private void addLabel(FaceletContext faceletContext, UIPanel panel, UIViewRoot root) {
     String uid = root.createUniqueId();
     if (checkForAlreadyCreated(panel, uid)) {
       return;
@@ -140,10 +140,10 @@
     label.getAttributes().put(TobagoConstants.ATTR_FOR, "@auto");
     if (tipAttribute != null) {
       if (tipAttribute.isLiteral()) {
-        label.setTip(tipAttribute.getValue(faceletContext));
+        panel.getAttributes().put(TobagoConstants.ATTR_TIP, tipAttribute.getValue(faceletContext));
       } else {
         ValueExpression expression = tipAttribute.getValueExpression(faceletContext, String.class);
-        ELAdaptor.setExpression(label, TobagoConstants.ATTR_TIP, expression);
+        ELAdaptor.setExpression(panel, TobagoConstants.ATTR_TIP, expression);
       }
     }
     if (labelAttribute != null) {