1 16 package org.apache.myfaces.custom.tree.renderkit.html; 17 18 import org.apache.myfaces.custom.tree.HtmlTreeNode; 19 import org.apache.myfaces.renderkit.html.HtmlLinkRendererBase; 20 import org.apache.myfaces.renderkit.html.HtmlRendererUtils; 21 22 import javax.faces.component.UIComponent; 23 import javax.faces.context.FacesContext; 24 25 57 public class HtmlTreeNodeRenderer 58 extends HtmlLinkRendererBase 59 { 60 61 62 public void decode(FacesContext facesContext, UIComponent component) 63 { 64 super.decode(facesContext, component); 65 String clientId = component.getClientId(facesContext); 66 String reqValue = (String )facesContext.getExternalContext().getRequestParameterMap().get(HtmlRendererUtils.getHiddenCommandLinkFieldName(HtmlRendererUtils.getFormName(component, facesContext))); 67 if (reqValue != null && reqValue.equals(clientId)) 68 { 69 HtmlTreeNode node = (HtmlTreeNode)component; 70 71 node.setSelected(true); 72 } 73 } 74 } 75 | Popular Tags |