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 2006/06/23 14:34:02 UTC

svn commit: r416702 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIOutput.java

Author: lofwyr
Date: Fri Jun 23 05:34:02 2006
New Revision: 416702

URL: http://svn.apache.org/viewvc?rev=416702&view=rev
Log:
enable EL for attributes "markup" and "tip"

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIOutput.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIOutput.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIOutput.java?rev=416702&r1=416701&r2=416702&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIOutput.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIOutput.java Fri Jun 23 05:34:02 2006
@@ -16,16 +16,19 @@
  * limitations under the License.
  */
 
-import javax.faces.context.FacesContext;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_MARKUP;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TIP;
 
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
 
 /*
- * Created by IntelliJ IDEA.
- * User: bommel
- * Date: 09.02.2006
- * Time: 23:53:37
- * To change this template use File | Settings | File Templates.
- */
+* Created by IntelliJ IDEA.
+* User: bommel
+* Date: 09.02.2006
+* Time: 23:53:37
+* To change this template use File | Settings | File Templates.
+*/
 public class UIOutput extends javax.faces.component.UIOutput {
   public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Output";
   private boolean escape = true;
@@ -61,7 +64,15 @@
   }
 
   public String getMarkup() {
-    return markup;
+    if (markup != null) {
+      return markup;
+    }
+    ValueBinding vb = getValueBinding(ATTR_MARKUP);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return null;
+    }
   }
 
   public void setMarkup(String markup) {
@@ -69,7 +80,15 @@
   }
 
   public String getTip() {
-    return tip;
+    if (tip != null) {
+      return tip;
+    }
+    ValueBinding vb = getValueBinding(ATTR_TIP);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return null;
+    }
   }
 
   public void setTip(String tip) {