1 23 28 package com.sun.enterprise.tools.jsfext.event.handlers.basic; 29 30 import com.sun.enterprise.tools.jsfext.event.handlers.HandlerContext; 31 32 import java.util.List ; 33 34 import javax.faces.component.UIComponent; 35 36 37 44 public class ComponentHandlers { 45 46 49 public ComponentHandlers() { 50 } 51 52 63 public void getChildren(HandlerContext context) { 64 UIComponent parent = (UIComponent) context.getInputValue("parent"); 65 List list = parent.getChildren(); 66 context.setOutputValue("children", list); 67 context.setOutputValue("size", new Integer (list.size())); 68 } 69 70 80 public void setComponentProperty(HandlerContext context) { 81 UIComponent component = 82 (UIComponent) context.getInputValue("component"); 83 String propName = (String ) context.getInputValue("property"); 84 Object value = context.getInputValue("value"); 85 86 component.getAttributes().put(propName, value); 88 } 89 } 90 | Popular Tags |