【发布时间】:2019-08-25 18:07:38
【问题描述】:
我的列表似乎是空白的,没有通过控制器扩展或其他问题导致我的表无法填充预期的数据。正在从工作订单上的自定义按钮加载此 visualforce 页面。
我尝试使用以下方法填充数据: :ApexPages.CurrentPage().getParameters().get('id')
除了硬编码我认为是代码示例中显示的“id”之外。
VF页面如下:
<apex:page Standardcontroller="WorkOrder" extensions="cWOInvoice1" renderAs="pdf">
<apex:form >
...
<table style="...">
<tbody style="...">
<tr style="display:table-row;">
<th style="...">Scope of Work</th>
<th style="...">Trade</th>
<th style="...">Price</th>
</tr>
<apex:repeat value="{!woli}" var="woli">
<tr>
<td style = "...">{!woli.Repair_Product__r.Name}</td>
<td style = "...">{!woli.Repair_Product__r.Trade__c}</td>
<td style = "...">${!woli.Item_Price_Roll_Up_Sub__c}</td>
</tr>
</apex:repeat>
</tbody>
</table>
...
</body>
</apex:form>
</apex:page>
控制器看起来像这样(再次硬编码 workOrderID 用于错误测试):
public class cWOInvoice1 {
public WorkOrderLineItem woli {get;set;}
public cWOInvoice1(ApexPages.StandardController controller){
List<WorkOrderLineItem>woli=[SELECT Id, Area__c, Tenant_Responsible__c, WorkOrderId, Repair_Product__r.Name, Repair_Product__r.Bill_Rate_Retail__c, Repair_Product__r.Bill_Rate__c, Repair_Product__r.Trade__c FROM WorkOrderLineItem WHERE WorkOrderId='0WO55000000Cw4LGAS'];
}
}
我希望自定义控制器通过工作订单行项目列表,然后顶点重复将显示在表格中。相反,我得到了一张空桌子。
【问题讨论】:
标签: salesforce apex visualforce