<f:ajax>不使用复合组件

时间:2016-12-09 06:05:59

标签: ajax jsf jsf-2 composite-component

<cc:interface componentType="inputAutoComplete">
    <cc:attribute name="reRender" type="java.lang.String" shortDescription="Provide The ids of the component to be refreshed"></cc:attribute>
    <cc:attribute name="baseURL" type="java.lang.String" shortDescription="Provide service method name of frontController API" />
    <cc:attribute name="labelValue" required="true" shortDescription="This is the binding value for label similar to drop down label(ItemLable).If key not present ,Then label is must.It will be considered as key "/>
    <cc:attribute name="keyValue"  shortDescription="This is the binding value for label similar to drop down key(ItemKey) .Its a hidden field"/>
    <cc:attribute name="keyType" type="java.lang.String" shortDescription="The value has to be KEY or KEYVALUE . It defines weather labelValue is key or label"/>
    <cc:attribute name="isRequired" type="java.lang.String"/>
    <cc:attribute name="datatype" type="java.lang.String" required="true" shortDescription="Data type value only to be dynamic or static"/>
    <cc:attribute name="varname" type="java.lang.String" shortDescription="If It is a static json list , then varname is must"/>
    <cc:attribute name="manageBeanName" shortDescription="If static list to be prepared from ManagedBean then ManagedBean name is must"/>
    <cc:attribute name="manageBeanMethodName" type="java.lang.String" shortDescription="If static list to be prepared from ManagedBean then ManagedBean method name is must and method should return String only as return type"/>
    <cc:attribute name="onchange" />
    <cc:editableValueHolder name="inTxt" />
    <cc:clientBehavior name="clientEvent" targets="inTxt" event="change" />
</cc:interface>
<cc:implementation>


        <h:inputText id="intext" value="#{cc.attrs.labelValue}" binding="#{cc.userInputbinding}" 
        onchange="#{cc.attrs.onchange}">
        <cc:insertChildren />
        </h:inputText>
        <p style="display: none;">THIS VALUE IS INVALID</p> 
        <h:inputText style="display:none" styleClass="hiddenClass" value="#{cc.attrs.keyValue}" />
        <h:panelGroup rendered="#{cc.includeJsonInPage}">

        </h:panelGroup>
        <f:param name="baseURL" value="#{cc.attrs.baseURL}"/>
        <f:param name="datatype" value="#{cc.attrs.datatype}"/>
        <f:param name="varname" value="#{cc.attrs.varname}"/>
        <f:param name="manageBeanName" value="#{cc.attrs.manageBeanName}"/>
        <f:param name="manageBeanMethodName" value="#{cc.attrs.manageBeanMethodName}"/>
        <f:param name="keyType" value="#{cc.attrs.keyType}"/>
        <f:param name="isRequired" value="#{cc.attrs.isRequired}"/>
        <f:param name="keyValue" value="#{cc.attrs.keyValue}"/>
</cc:implementation>

实施 -

        <h:panelGroup id="pnlGrp_editCustomerGroupManageLocal">
        <asset:inputAutoComplete datatype="static" labelValue="abcd"  id="samleAuto" varname="availableTags"    >

                <f:ajax event="clientEvent" onevent="alert('sfdksd')"></f:ajax>
                </asset:inputAutoComplete>
                </h:panelGroup>

以上是复合组件的实现。我无法从组件内部触发ajax事件。 请帮助我知道代码可能存在的问题。

0 个答案:

没有答案