myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grantsm...@apache.org
Subject svn commit: r209840 - /myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererBase.java
Date Fri, 08 Jul 2005 16:51:07 GMT
Author: grantsmith
Date: Fri Jul  8 09:51:06 2005
New Revision: 209840

URL: http://svn.apache.org/viewcvs?rev=209840&view=rev
Log:
MYFACES-310:  HtmlLinkRendererBase does not work with custom components that do not extend
HtmlCommandLink.

Modified:
    myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererBase.java

Modified: myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererBase.java
URL: http://svn.apache.org/viewcvs/myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererBase.java?rev=209840&r1=209839&r2=209840&view=diff
==============================================================================
--- myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererBase.java
(original)
+++ myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererBase.java
Fri Jul  8 09:51:06 2005
@@ -264,7 +264,18 @@
         }
 
         // target
-        String target = ((HtmlCommandLink)component).getTarget();
+        // todo: can we eliminate the if and rely on the second call only ?
+        // see MYFACES-310, specifically the comment by Emond Papegaaij. Will try
+        // after testing framework is in place & tests are written.
+        String target = null;
+        if (component instanceof HtmlCommandLink)
+        {
+            target = ((HtmlCommandLink)component).getTarget();
+        }
+        else
+        {
+            target = (String)component.getAttributes().get(HTML.TARGET_ATTR);
+        }
         if (target != null && target.trim().length() > 0) {
             onClick.append(jsForm);
             onClick.append(".target='");



Mime
View raw message