1 21 package com.sun.enterprise.tools.jsfext.component.factory.basic; 22 23 import com.sun.enterprise.tools.jsfext.component.factory.ComponentFactoryBase; 24 import com.sun.enterprise.tools.jsfext.layout.descriptor.LayoutComponent; 25 import com.sun.enterprise.tools.jsfext.component.LavaChannelHref; 26 27 import com.sun.web.ui.component.Hyperlink; 28 29 import javax.faces.component.UIComponent; 30 import javax.faces.context.FacesContext; 31 32 33 43 public class LavaChannelHrefFactory extends ComponentFactoryBase { 44 45 58 public UIComponent create(FacesContext context, LayoutComponent descriptor, UIComponent parent) { 59 Hyperlink href = new Hyperlink(); 61 62 if (parent != null) { 65 addChild(context, descriptor, parent, href); 66 } 67 68 setOptions(context, descriptor, href); 70 71 String clientId = href.getClientId(context); 75 String extraNVPs = "'" + clientId + "_submittedField=" + clientId + "'"; 79 String jsHandlerFunction = "null"; 80 String target = (String ) descriptor.getEvaluatedOption(context, LAVA_CHANNEL_TARGET, href); 82 if ((target == null) || target.equals("")) { 83 target = clientId; 84 } 85 href.setOnClick("submitLavaChannel('" + target + "', " +extraNVPs + ", " + jsHandlerFunction + "); return false;"); 86 87 return href; 89 } 90 91 100 public static final String LAVA_CHANNEL_TARGET = "lavaTarget"; 101 } 102 | Popular Tags |