如何使用 Outputlink 从 Visualforce 页面提供指向记录的链接
任何人都可以帮我在这种情况下提供链接吗?
<apex:repeat var="slot" value="{!liTimeSlots}">
<tr class="{!IF(ISNULL(slot.sAppointment), 'Free', 'Fill')}">
<td ><apex:outputText value="{!slot.tstart1}"/></td>
<td><apex:outputText value="{!IF(ISNULL(slot.sAppointment), 'Free', slot.sAppointment.name)}"/></td>
<td><apex:outputText value="{!IF(ISNULL(slot.sAppointment), '', slot.sAppointment.Appointment_Type__c)}"/></td>
<td><apex:outputText value="{!IF(ISNULL(slot.sAppointment), '', slot.sAppointment.Patient__c)}"/></td>
</tr>
<tr >
<td></td>
<td><apex:outputText value="{!IF(ISNULL(slot.sAppointmentOverlap), ' ', slot.sAppointmentOverlap.name)}"/></td>
<td><apex:outputText value="{!IF(ISNULL(slot.sAppointmentOverlap), '', slot.sAppointmentOverlap.Appointment_Type__c)}"/></td>
<td><apex:outputText value="{!IF(ISNULL(slot.sAppointmentOverlap), '', slot.sAppointmentOverlap.Patient__c)}"/></td>
</tr>
</apex:repeat>
我只想在 slot.sAppointment 或 slot.sAppointmentOverlap 不为空时显示链接。
知道如何解决这个问题。
谢谢普拉迪
Could anyone help me out on providing link in this scenario
<apex:repeat var="slot" value="{!liTimeSlots}">
<tr class="{!IF(ISNULL(slot.sAppointment), 'Free', 'Fill')}">
<td ><apex:outputText value="{!slot.tstart1}"/></td>
<td><apex:outputText value="{!IF(ISNULL(slot.sAppointment), 'Free', slot.sAppointment.name)}"/></td>
<td><apex:outputText value="{!IF(ISNULL(slot.sAppointment), '', slot.sAppointment.Appointment_Type__c)}"/></td>
<td><apex:outputText value="{!IF(ISNULL(slot.sAppointment), '', slot.sAppointment.Patient__c)}"/></td>
</tr>
<tr >
<td></td>
<td><apex:outputText value="{!IF(ISNULL(slot.sAppointmentOverlap), ' ', slot.sAppointmentOverlap.name)}"/></td>
<td><apex:outputText value="{!IF(ISNULL(slot.sAppointmentOverlap), '', slot.sAppointmentOverlap.Appointment_Type__c)}"/></td>
<td><apex:outputText value="{!IF(ISNULL(slot.sAppointmentOverlap), '', slot.sAppointmentOverlap.Patient__c)}"/></td>
</tr>
</apex:repeat>
I want to show the link only if slot.sAppointment or slot.sAppointmentOverlap is not null.
Any idea how to approach this.
Thanks
Prady
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
与几乎所有
apex:
Visualforce 标记一样,apex:outputLink
具有可用于显示或隐藏它的rendered
属性,并且这可以使用值的合并字段/公式,因此您将寻找以下内容:我用于对一组标记元素进行条件渲染的另一个技巧是将它们包装在
apex:variable 中
标签:Like pretty much all of the
apex:
Visualforce tags,apex:outputLink
has arendered
attribute which can be used to show or hide it, and this can use a merge field / formula for the value, so you'll be looking for something along the lines of:Another trick I use for conditional rendering for a group of markup elements is to wrap them in an
apex:variable
tag: