如何打印与Sobject无关的自定义Apex类列表?我不断得到错误的错误:未知属性'apiMyIntegrationCom.customerScorecardDiscountDetail.discountCategory‘
大多数代码都是为简单而设计的。我知道数据在那里,因为如果我只使用{!DiscountDetails}在可视化强制漏电中,数据就会出现在整个类、var名称和所有东西上。只是想弄到特别的瓦尔斯。
public class MyController{
private apiMyIntegrationCom.customerScorecardResponse custScoreCard;
......
public apiMyIntegrationCom.customerScorecardDiscountDetail[] getDiscountDetails(){
return this.custScoreCard.discountDetails;
}
}VisualForce页面:
<apex:page standardController="Account" extensions="MyController">
<table id="discountTable">
<apex:repeat id="dd" value="{!DiscountDetails}" var="dds">
<tr>
<td>{!dds.discountCategory}</td>
</tr>
</apex:repeat>
</table>
发布于 2018-01-11 06:44:34
我认为您需要将getDiscountCategory()添加到apiMyIntegrationCom.customerScorecardDiscountDetail类(以及您希望在VF上公开的任何其他字段)。
VF需要显式的getProperty(), setProperty()方法或这个表示法:public String property {get; private set;}。更多的信息可以在我的另一个答案中找到:https://salesforce.stackexchange.com/a/9171/799
看起来您的类是从WSDL文件中自动生成的吗?是的,这意味着您需要在任何地方喷洒getter来修改这段代码,每次重新生成类时都要重复这个过程.
https://stackoverflow.com/questions/48196515
复制相似问题