0

我有一个p:dataTable并包含 commandLinks。

<h:form id="defVhclForm">
<p:dataTable id="vehicleTable" var="vhcl" value="#{vehicle.vehicleList}"
    scrollable="true" scrollHeight="520">
    <p:column id="trackId" label="#{general.vehicleName}" width="120" style="spacing:0;padding-left:10px;border:0px">

        <p:commandLink id="editLink" immediate="true" value="#{vhcl.vehicle.vehicleName}" title="#{general.editVehicleInfo}" 
            action="#{vehicle.vehicleSelected}" style="font-weight:bold; font-size:11px;" 
            update="@form"/>    
        <br />
        <h:outputText id="vehicleId" value="#{vhcl.vehicle.mtsTrackId}" title="#{general.vehicleId}" style="font-size:10px; color:blue;" />
        <br/>
        <h:outputText value="#{vhcl.vehicle.vehiclePlate}" id="vehiclePlate" title="#{general.licencePlate}" style="font-size:10px; color:blue"/>
        <h:inputHidden value="#{vhcl.vehicle.mtsTrackId}" id="mtsTrackId"/>
    </p:column>
</p:dataTable>

 <p:tabView id="tabView" styleClass="tableCellHeader" style="align:left">  
<p:tab id="vehicleDefinitionTab" title="#{general.vehicle}" styleClass="tableCellHeader">
    <h:panelGrid id="mainGrid" columns="2" columnClasses="alignTop, alignTop">
        <h:panelGrid id="subGrid" columns="4">
            <h:outputLabel id="vhclIdLbl" value="#{general.vehicleId}:"/>
            <p:inputText id="vehicleIdTxt" binding="#{vehicle.vehicleIdTxt}" style="width:150px;"/>
            <h:outputLabel id="vhclPlateLbl" value="#{general.licencePlate}:"/>
            <p:inputText id="vehiclePlateTxt" binding="#{vehicle.vehiclePlateTxt}" style="width:150px;"/>
            <h:outputLabel id="vhclNameLbl" value="#{general.vehicleName}:"/>
            <p:inputText id="vehicleNameTxt" binding="#{vehicle.vehicleNameTxt}" style="width:150px;"/>
            <h:outputLabel id="vhclTypeNameLbl" value="#{general.vehichleType}:"/>
            <p:selectOneMenu id="vhclTypeCmb" binding="#{vehicle.vehicleTypeCmb}" styleClass="tableCell" effect="slide" style="width:157px"> 
                <f:selectItem itemLabel="#{general.pleaseSelect}" itemValue="" styleClass="tableCell"/> 
                <f:selectItems value="#{vehicle.vehicleTypeCmbList}" styleClass="tableCell"/> 
            </p:selectOneMenu>
        </h:panelGrid>
        <!--  <p:graphicImage value="#" width="120px" height="80px"/>-->
    </h:panelGrid>
</p:tab>  
<p:tab id="registrationTab" title="#{general.auth}" styleClass="tableCellHeader">

</p:tab>
</:tabView>

</h:form>

通过按 commandLink 一些p:tab应该被更新并填充相关数据。每个组件都在同一个h:form中。按 commandLink 不会更新相关的p:tab。此外,commandLink 操作仅调用 bean 方法一次。多按不调用bean方法。

我怎么解决这个问题?

4

0 回答 0