0

我有一个与 visualforce 电子邮件模板相关的问题,请帮帮我。我正在使用下面的代码来隐藏 tr:

<apex:repeat var="cx" value="{!relatedTo.Airline_Conf_s__r}">
 <tr style="{!IF(!cx.Include_in_Confirmation__c == true,"display:none!important; ","")}">
<td>
<apex:outputText value="{!cx.Airlines_Url__c}" escape="false" /> 
</td>
</tr>
</apex:repeat>

but i need it to done without inline style .how can it possible.
4

2 回答 2

1

您最好使用 apex:outputPanel 标记并使用渲染属性:

<apex:repeat var="cx" value="{!relatedTo.Airline_Conf_s__r}">
<apex:outputPanel layout="none" rendered="{!cx.Include_in_Confirmation__c == true}">
    <tr>
        <td>
            <apex:outputText value="{!cx.Airlines_Url__c}" escape="false" /> 
        </td>
    </tr>
</apex:outputPanel>

请注意,layout 属性设置为“none”,这将有效地告诉 VF 不要渲染标签,但您将获得能够在转发器循环时动态渲染 TR 标签的好处。

于 2012-05-10T17:36:52.943 回答
1

您可以尝试使用 apex:outputtext 的“rendered”属性,如下所示

<apex:outputText rendered = "{cx.Include_in_Confirmation__c}" value="{!cx.Airlines_Url__c}" escape="false" /> 
于 2012-05-10T13:41:15.793 回答