开发者

How to set row level rendering in JSF <h:datatable>

开发者 https://www.devze.com 2023-03-12 17:03 出处:网络
How can i set row level rendering in datatable JSF. <h:dataTablestyleClass=\"tablesub\" border=\"0\"value=\"#{historyQuestBean.answerMasterList[row].inputTextKeySet}\" var=\"opti开发者_C百科on\"&

How can i set row level rendering in datatable JSF.

 <h:dataTable  styleClass="tablesub" border="0"  value="#{historyQuestBean.answerMasterList[row].inputTextKeySet}" var="opti开发者_C百科on">
        <h:column>
            <h:outputText value="#{option.sectionShortName}:"/>
        </h:column>
        <h:column>
            <h:outputText value="#{option.type}:"/>
        </h:column>
 </h:dataTable>

I want to render only those rows who have status true.

How can I do this?


Easier and Simplest thing is to pass the list of values with status = true

In <h:datatable> you can give a style class within rowClasses say renderer and in that class specify a condition like display:#{option.status==true}?'block':'none'. This will evaluate the EL and accordingly place the style of that <tr\> to display or not.

Another option is to use <ui:repeat> instead of <h:datatable>, Here you can place rendered condition for the <tr>.

0

精彩评论

暂无评论...
验证码 换一张
取 消