1 5 package org.exoplatform.faces.core.renderer.html; 6 7 import java.util.Map ; 8 import javax.faces.component.UIComponent; 9 import javax.faces.context.FacesContext; 10 import org.exoplatform.faces.FacesConstants; 11 import org.exoplatform.faces.core.component.UIExoComponent; 12 import org.exoplatform.faces.core.component.UINode ; 13 import org.exoplatform.faces.core.component.model.Parameter; 14 15 public class NodeMenuRenderer extends HtmlBasicRenderer { 16 17 protected static Parameter SELECT_TAB = new Parameter(FacesConstants.ACTION , "selectTab") ; 18 19 public void decode(FacesContext context, UIComponent component) { 20 Map paramMap = context.getExternalContext().getRequestParameterMap() ; 21 String action = (String ) paramMap.get(FacesConstants.ACTION) ; 22 if ("selectTab".equals(action)) { 23 String tabId = (String ) paramMap.get("tabId") ; 24 UIExoComponent uiComponent = (UIExoComponent) component ; 25 UIExoComponent target = uiComponent.findComponentById(tabId); 26 if(target != null) { 27 UINode uiNode = (UINode) target.getParent() ; 28 uiNode.setRenderedComponent(tabId) ; 29 context.renderResponse() ; 30 } 31 } 32 } 33 } | Popular Tags |