2

各行に 24 時間の入力フィールドがあるデータテーブルがあります。ある時点では、1000 を超える編集可能な入力フィールドがあります。ajax 呼び出し中に p:cellEditor を使用しているときに、primefaces がデータテーブル全体を送信していることに気付きました。どうすればそれを回避できますか? 私が持っているコードの下を見つけてください。また、それらの各重要な部分に関するコメントも見つけてください。

        <!-- Fires the cellEdit event to trigger the validations to happen as user tabs out of the input box -->
    <p:ajax event="cellEdit" listener="#{renderValidator.onCellEdit}"  update=":#{p:component('globalMessages')}" process="@this" /> 

    <p:column id="hour1" styleClass="col-right col-90">
        <f:facet name="header">
            <h:outputText value="1" escape="false"/>
        </f:facet>
        <p:cellEditor > 

            <f:facet name="output">
            <h:outputText value="#{row.amount[0]}" escape="false">
            <f:convertNumber  maxFractionDigits="3" minFractionDigits="3" maxIntegerDigits="5" />
            </h:outputText>
            </f:facet> 
            <f:facet name="input">
            <p:inputText id="hour1Input" value="#{row.amount[0]}" maxlength="10" size="10"  readonly="#{row.readOnly}" onchange='PowerMeter.setPowerMeterChange()'
            styleClass="col-right" valueChangeListener="#{row.setDirtyFlag(true)}"  >
            <!-- formats data the way its displayed -->
            <f:convertNumber  maxFractionDigits="3" minFractionDigits="3" maxIntegerDigits="5" />
            <!-- validates the input value w.r.t a custom validator -->
            <f:validator validatorId="hourlyValueValidator" for="hour1Input" /> 
            <!-- javascript restricting user to input alpha numeric characters -->
            <pe:keyFilter testFunction="return PowerMeter.isValidMWH(this, c);" />
            </p:inputText>
            </f:facet>          
        </p:cellEditor>
    </p:column> 
4

2 に答える 2