合并动态绑定顶点中的行:visualforce页面中的pageblockTable

时间:2016-04-05 09:49:22

标签: visualforce

我是Salesforce VF页面的新手。我的Visualforce页面中有一个动态绑定的pageBlockTable。我想根据条件合并某些动态行。有人可以建议,如果有任何可能的方法来合并基于某些条件的apex:pageblocktable中的行(或子行)?

我试过谷歌搜索,但找不到任何线索。 任何帮助都非常感谢。

Visualforce页面代码:

<apex:pageblock id="listBlock">
<apex:pageblockTable value="{!lstcomp}" var="oComp"   styleclass="table table-striped table-hover" id="sysTable" rowClasses="even,odd">

<apex:column headerClass="TableTitle" style="width: 20%;height:4%"  ><apex:facet name="header"><font class="headerfontstyle" >Name</font></apex:facet> 
<font class="rowdatastyle"> {!oComp.Name} </font>
</apex:column>
<apex:column headerClass="TableTitle" style="width: 10%;height:4%"  ><apex:facet name="header"><font class="headerfontstyle" >Mfg</font></apex:facet> 
<font class="rowdatastyle" >  {!oComp.Manufacturer}</font>
</apex:column>
<apex:column headerClass="TableTitle" style="width: 6%;height:4%"><apex:facet name="header"><font class="headerfontstyle" >Type</font></apex:facet> 
<font class="rowdatastyle" > {!oComp.ComponentType} </font>
</apex:column>
<apex:column headerClass="TableTitle" style="width: 12%;height:4%"><apex:facet name="header"><font class="headerfontstyle" >Allocated</font></apex:facet>  
<font class="rowdatastyle"> {!oComp.Allocated} </font>
</apex:column>                                                        
<apex:column headerClass="TableTitle" style="width: 10%;height:4%"><apex:facet name="header"><font class="headerfontstyle" >Used</font></apex:facet>  
<font class="rowdatastyle"> {!oComp.Used} </font>
</apex:column>                                                        
<apex:column headerClass="TableTitle" style="width: 30%;height:4%"><apex:facet name="header"><font class="headerfontstyle" >Version</font></apex:facet>  
<font class="rowdatastyle">{!oComp.OS} </font>
</apex:column>         
</apex:pageblockTable>

1 个答案:

答案 0 :(得分:0)

您可以根据特定条件对记录进行分组,并从子记录中显示其余字段。

<apex:pageblockTable>
    <apex:column value="{!acc.name}">
    <apex:column>
        <apex:facet name="header"> Team Members </apex:facet>
        <apex:pageblocktable value="{!acc.AccountTeamMembers}" var="tm">
            <apex:column headerValue="Team Member">
                <apex:outputfield value="{!tm.User.Name}"/>
            </apex:column>
            <apex:column headerValue="Role">
                <apex:outputfield value="{!tm.TeamMemberRole}"/>
            </apex:column>                          
        </apex:pageblocktable>
    </apex:column>
</apex:pageblockTable>