将所选值设置为bean到相应的输入字段

时间:2017-08-07 06:51:52

标签: spring-mvc primefaces

我有我的对话

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<p:dialog header="Look Up" width="400px" resizable="false" modal="true"
    widgetVar="dlg200">
    <p:dataTable style="font-size:13px;" paginatorPosition="bottom"
        id="dialoglov" var="lov" value="#{mmsBean.admlovs}"
        selection="#{mmsBean.selectedadmlovs}" selectionMode="single"
        resizableColumns="true" scrollable="true" scrollHeight="150"
        rowKey="#{lov.id}" rows="5" paginator="false"
        paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
        rowsPerPageTemplate="5,10,15"
        emptyMessage="No data found with given criteria ">
        <p:ajax event="rowDblselect" oncomplete="PF('dlg200').hide()" />
        <p:column style="font-size:13px;" headerText="Code"
            sortBy="#{lov.code}" filterBy="#{lov.code}"
            filterMatchMode="contains">
            <h:outputText style="font-size:13px;" value="#{lov.code}" />
        </p:column>
        <p:column style="font-size:13px;" headerText="Description"
            sortBy="#{lov.descr}" filterBy="#{lov.descr}"
            filterMatchMode="contains">
            <h:outputText style="font-size:13px;" value="#{lov.descr}" />
        </p:column>
    </p:dataTable>
    <p:commandButton value="Select" onclick="PF('dlg200').hide()"
        style="margin-top:10px !important" />
</p:dialog>

并且对话正在调用

    <div class="col-md-12 " style="margin-top: 2% !important;">
        <div class="col-md-4" style="text-align: center;">
            <p:outputLabel styleClass="WhiteBlue" value="Estimated" />
        </div>
        <div class="col-md-4">
            <h:inputText type="text" styleClass="form-control"
               id="fvar" value="#{pmBean.selectedadmlovs.code}"
               title="Estimated Cost Of WorkOrder" />
        </div>
        <div class="col-md-3">
            <h:inputText type="text" styleClass="form-control"
               id="fvaar" value="#{pmBean.selectedadmlovs.descr}"
               title="Estimated Cost Currency" />
        </div>
        <div class="col-md-1">
            <p:commandButton onclick="PF('dlg200').show();"
              action="#{lovController.lovForFincurrency('fincurrency:fvar')}"
              icon="fa fa-search Fs12 White                                 
              styleClass="BlueTextButton" process="@this"
              update="dialoglov fvar" />
        </div>
    </div>

我想将对话框中的选定值设置为两个输入字段 因此有太多的输入字段和一个对话。当对话打开并且用户从中选择值时,它应该分别将值设置为该特定字段。我想制作通用的 谢谢

0 个答案:

没有答案