2012-01-10 9 views
1
<h:dataTable value="#{bean.listOfRows}" var="eachRow" id="theDataTable"> 
    <h:column> 
     <p:outputPanel rendered="#{eachRow.visible}"> 
       <h:selectManyCheckbox 
        value="#{xxxx}" 
        label="#{xxxx}"> 
        <f:selectItems value="#{checkBoxItems}" var="eachItem" itemLabel="#{eachItem.label}" itemValue="#{eachItem.value}" /> 
        <p:ajax event="change" update="theDataTable" /> 
       </h:selectManyCheckbox> 
     </p:outputPanel> 
     <p:outputPanel rendered="#{eachRow.visible}"> 
       <h:selectOneRadio 
        value="#{xxxx}" 
        label="#{xxxx}"> 
        <f:selectItems value="#{radioItems}" var="eachItem" itemLabel="#{eachItem.label}" itemValue="#{eachItem.value}" /> 
        <p:ajax event="change" update="theDataTable" /> 
       </h:selectOneRadio> 
     </p:outputPanel> 

     <p:outputPanel rendered="#{eachRow.visible}"> 
     </p:outputPanel> 
     <p:outputPanel rendered="#{eachRow.visible}"> 
     </p:outputPanel> 
     <p:outputPanel rendered="#{eachRow.visible}"> 
     </p:outputPanel> 
     <p:outputPanel rendered="#{eachRow.visible}"> 
     </p:outputPanel> 
    . 
    . 
    . 

    </h:column>          
</h:dataTable> 

データテーブルの行セット内で、前の行の入力コンポーネントのVALUE CHANGE EVENTS(AJAX要求を使用して処理される)に応じて条件付きでレンダリングされる行があります。データテーブル全体を再レンダリングせずにこれらの行を表示させることはできますか? ? ? PrimeFaces 2.2.1でJSF 2.0.6を使用しています。データテーブル全体を更新せずに、データテーブル内のコンポーネントの条件付きレンダリングが可能ですか?

答えて

0

この質問のためにBalusCが提案したように、linkはこのようなデータテーブルの列にパディングを使用します。

<h:dataTable id="mainDatatable" value="#{bean.listOfRows}" var="eachRow" id="theDataTable"> 
    <h:column> 
    <h:panelGroup id="padding" layout="block"> 
     <p:outputPanel rendered="#{eachRow.visible}"> 
      <h:selectManyCheckbox 
       value="#{xxxx}" 
       label="#{xxxx}"> 
       <f:selectItems value="#{checkBoxItems}" var="eachItem" itemLabel="#{eachItem.label}" itemValue="#{eachItem.value}" /> 
       <p:ajax event="change" update="theDataTable" /> 
      </h:selectManyCheckbox> 
     </p:outputPanel> 
    <p:outputPanel rendered="#{eachRow.visible}"> 
      <h:selectOneRadio 
       value="#{xxxx}" 
       label="#{xxxx}"> 
       <f:selectItems value="#{radioItems}" var="eachItem" itemLabel="#{eachItem.label}" itemValue="#{eachItem.value}" /> 
       <p:ajax event="change" update="theDataTable" /> 
      </h:selectOneRadio> 
    </p:outputPanel> 

    <p:outputPanel rendered="#{eachRow.visible}"> 
    </p:outputPanel> 
    <p:outputPanel rendered="#{eachRow.visible}"> 
    </p:outputPanel> 
    <p:outputPanel rendered="#{eachRow.visible}"> 
    </p:outputPanel> 
    <p:outputPanel rendered="#{eachRow.visible}"> 
    </p:outputPanel> 
. 
. 
. 
    </h:panelGroup> 
    </h:column>          
</h:dataTable> 

データテーブルは、レンダリングされたかどうかに関わらず、列内のすべてのコンポーネントに対してパディングを作成します。今それはあなたの従属的な論理までです。データテーブルの特定の行を更新する場合は、バッキングBeanから生成されたクライアントIDを使用するか、このquestionのBalusCが示唆するようにコンポーネントをBeanにバインドします。クライアントIDは、mainDatatable:rowIndex:paddingの形式になります。乾杯!

+0

ありがとうございます。これは良い解決策です – Vijay

関連する問題