首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Visualforce页面列表输出

Visualforce页面列表输出
EN

Stack Overflow用户
提问于 2018-01-10 21:39:27
回答 1查看 735关注 0票数 0

如何打印与Sobject无关的自定义Apex类列表?我不断得到错误的错误:未知属性'apiMyIntegrationCom.customerScorecardDiscountDetail.discountCategory‘

大多数代码都是为简单而设计的。我知道数据在那里,因为如果我只使用{!DiscountDetails}在可视化强制漏电中,数据就会出现在整个类、var名称和所有东西上。只是想弄到特别的瓦尔斯。

代码语言:javascript
复制
public class MyController{

private apiMyIntegrationCom.customerScorecardResponse custScoreCard;

  ......
  public apiMyIntegrationCom.customerScorecardDiscountDetail[] getDiscountDetails(){

    return this.custScoreCard.discountDetails;
  }

}

VisualForce页面:

代码语言:javascript
复制
<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>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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来修改这段代码,每次重新生成类时都要重复这个过程.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48196515

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档