欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

richfaces建议框,选择一个实体作为参数.传入后台Bean:

程序员文章站 2022-07-16 20:41:02
...

richfaces建议框,选择一个实体作为参数.传入后台Bean:

 

 <s:decorate id="zwxmField" template="../layout/edit.xhtml">
                <ui:define name="label">姓 名</ui:define>

                <h:inputText id="zwxm" disabled="#{personHome.managed}"
                           size="20" required="true"
                      maxlength="50"
                          value="#{personHome.instance.zwxm}">
                </h:inputText>

</s:decorate> 

<rich:suggestionbox id="suggestionBoxId" for="zwxm" tokens=",["
                suggestionAction="#{manageDao.autocompletePersonList}" var="result"
                fetchValue="#{result.gbpersonId},#{result.zwxm},#{result.xb},#{result.sfzhm}"
                border="3"
                width="400"
                height="300"
                zindex="9090"
                cellpadding="3"
                shadowOpacity="8"
                shadowDepth="6"
                immediate="true"
                nothingLabel="无此信息"
                columnClasses="center"
                minChars="2"
                >
     <h:column>
                        <h:graphicImage value="#{manageDao.findFilepathByUuid(result.zp)}" width="30" height="30"/>
                </h:column>
               
                <!--<h:column>
                    <f:facet name="header">
                        <h:outputText value="ID"></h:outputText>
                    </f:facet>
                    <h:outputText value="#{result.gbpersonId}" />
                </h:column>-->
                <h:column>
                    <f:facet name="header">
                        <h:outputText value=" 姓名"></h:outputText>
                    </f:facet>
                    <h:outputText value="#{result.zwxm}" />
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="性别"></h:outputText>
                    </f:facet>               
                    <h:outputText value="#{codes.getSingvalue('XB',result.xb)}" />
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value=" 身份证号码"></h:outputText>
                    </f:facet>               
                    <h:outputText value="#{result.sfzhm}" />
                </h:column>


   <a:queue name="q1" />
   <a:support event="onselect" reRender="zwxmField,personXbField,personSfzhmField"               eventsQueue="q1" immediate="true">
    <f:setPropertyActionListener value="#{result}" target="#{personHome.instance}" />
   </a:support>  

           

</rich:suggestionbox>