jsf 2.2 - Implement callback method in JSF composite component -
i'd implement "callback" feature in composite component. method called backing component when necessary.
the xhtml part is:
<cc:interface componenttype="partnerselcomp"> <cc:attribute name="value" type="com.app.data.partner"/> <cc:attribute name="callback" method-signature="void notify(java.lang.long)"/> </cc:interface> <cc:implementation> <span id="#{cc.clientid}"> <p:inputtext id="code" binding="#{cc.partnercode}"> <p:ajax event="blur" update="code name msg" listener="#{cc.validate}" /> </p:inputtext> <p:outputlabel id ="name" binding="#{cc.partnername}"/> <p:message id="msg" for="code"/> </span> </cc:implementation>
the relevant part of backing component is:
@facescomponent("partnerselcomp") public class partnerselcomp extends uiinput implements namingcontainer { private inputtext partnercode; private outputlabel partnername; @override public string getfamily() { return uinamingcontainer.component_family; } public void validate() { ... methodexpression exp = (methodexpression) getattributes().get("callback"); ... } ... }
above exp
gets null value. please how can "callback" attribute, , how can execute it?
Comments
Post a Comment