You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2009/01/01 18:47:28 UTC

svn commit: r730573 - /myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java

Author: weber
Date: Thu Jan  1 09:47:27 2009
New Revision: 730573

URL: http://svn.apache.org/viewvc?rev=730573&view=rev
Log:
Created: (TOBAGO-735) partial rendering did not work on tx:menuRadio
<https://issues.apache.org/jira/browse/TOBAGO-735>

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

Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java?rev=730573&r1=730572&r2=730573&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java Thu Jan  1 09:47:27 2009
@@ -27,8 +27,13 @@
 import org.apache.myfaces.tobago.taglib.decl.IsDisabled;
 import org.apache.myfaces.tobago.taglib.decl.HasValue;
 import org.apache.myfaces.tobago.taglib.decl.HasConverter;
+import org.apache.myfaces.tobago.component.UICommand;
+import org.apache.myfaces.tobago.component.ComponentUtil;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_RENDERED_PARTIALLY;
 
 import javax.faces.webapp.FacetTag;
+import javax.faces.component.UIComponent;
+import javax.faces.el.ValueBinding;
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.BodyTagSupport;
 
@@ -124,6 +129,18 @@
 
   @Override
   public int doEndTag() throws JspException {
+
+    // Move attribute renderedPartially from selectOne to menuCommand component
+    UIComponent selectOneComponent = selectOneRadio.getComponentInstance();
+    UICommand command = (UICommand) menuCommandTag.getComponentInstance();
+    ValueBinding binding = selectOneComponent.getValueBinding(ATTR_RENDERED_PARTIALLY);
+    if (binding != null) {
+      command.setValueBinding(ATTR_RENDERED_PARTIALLY, binding);
+    } else {
+      Object renderedPartially = selectOneComponent.getAttributes().get(ATTR_RENDERED_PARTIALLY);
+      ComponentUtil.setRenderedPartially(command, (String) renderedPartially);
+    }
+    
     selectOneRadio.doEndTag();
     facetTag.doEndTag();
     menuCommandTag.doEndTag();