jsf - Create a custom commandButton and Input components -
i'm trying implement custom js2 command button using uicommand latest html5 attributes. but, how can handles action , actionlistener attribues? uicommand save thier values, done jsf2 runtime, how can know methode of bean should excute after button activation user in renderer class @ 'encodebegin methode'. source code primefaces commandbuton renderer class, available here complicated.
in opinion, need extend class (commandbutton or commandbuttonrendered) , override methods not work want. commandbuttonrenderer:
import javax.faces.component.uicomponent; import javax.faces.context.facescontext; import org.primefaces.component.commandbutton.commandbuttonrenderer; /** * * @author nuno_marinho */ public class mycommandbuttonrenderer extends commandbuttonrenderer { @override ... }
or commandbutton:
import javax.faces.component.uicomponent; import javax.faces.context.facescontext; import org.primefaces.component.commandbutton.commandbuttonrenderer; import org.primefaces.component.commandbutton.commandbutton; /** * * @author nuno_marinho */ public class mycommandbutton extends commandbutton { @override ... }
and need define changes component in faces-config.xml this:
<render-kit> <renderer> <component-family>org.primefaces.component</component-family> <renderer-type>org.primefaces.component.commandbutton</renderer-type> <renderer-class>com.yourpackage.commandbutton.mycommandbutton</renderer-class> </renderer> </render-kit>
i hope explaination can you!
Comments
Post a Comment