jsf - Strange behavior of partial processing of custom component id -
i want extend functionality of p:inputtextarea. new component simple , looks like:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:composite="http://java.sun.com/jsf/composite" xmlns:p="http://primefaces.org/ui" xmlns:h = "http://java.sun.com/jsf/html"> <composite:interface> ... <composite:attribute name="maxlength" required="false" default="0"/> <composite:attribute name="value" required="true"/> ... </composite:interface> <composite:implementation> <p:inputtextarea id="#{cc.clientid}" value="#{cc.attrs.value}" onkeyup="calljs('#{cc.clientid}', '#{cc.attrs.maxlength}')"/> <!-- why extend p:inputtextarea --> </composite:implementation> </html> and use component in p:tabview:
<h:form prependid="false"> <p:tabview id="tabs"> <p:tab id="tab1" title="text1"> <h:outputlabel disabled="true" id="textarea" value="#{testbean.text}"/> </p:tab> <p:tab title="text2"> <p:commandlink value="show dialog" onclick="inputdilog.show();"/> <p:dialog widgetvar="inputdilog" id="dialog"> <!-- custom component --> <practice:inputtextarea id="text" value="#{testbean.text}" maxlength="100"/> <f:facet name="footer"> <p:commandbutton id="button" title="save text" update="textarea" process="text" oncomplete="inputdilog.hide();"/> </f:facet> </p:dialog> </p:tab> </p:tabview> </h:form> testbean pojo
@managedbean(name = "testbean") @viewscoped public class testbean implements serializable { private string text; public string gettext() { return text; } public void settext(string text) { this.text = text; } } when click on p:commandbutton [id=button] expect component [id = textarea] value component [id = text].
getting response server
<update id="tabs:textarea"><![cdata[<label id="tabs:textarea"></label>]]></update> if instead of practice:inputtextarea write p:inputtextarea working expect.
, if place practice:inputtextarea out p:tabview working expect.
why value of practice:inputtextarea not processed when custom component lie in p:tabview?
i wrap composite component div. work fine.
composite component looks like
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:composite="http://java.sun.com/jsf/composite" xmlns:p="http://primefaces.org/ui" xmlns:h = "http://java.sun.com/jsf/html"> <composite:interface> ... <composite:attribute name="maxlength" required="false" default="0"/> <composite:attribute name="value" required="true"/> ... </composite:interface> <composite:implementation> <div id="#{cc.clientid}"> <p:inputtextarea id="innerid" value="#{cc.attrs.value}" onkeyup="calljs('#{cc.clientid}:innerid', '#{cc.attrs.maxlength}')"/> </div> </composite:implementation> </html>
Comments
Post a Comment