如何解决visualforce 页面显示未知方法错误
我有 2 个包装类,如下所示
public class Wr_Studennt{
public string name{get;set;}
public decimal salary{get;set;}
public decimal exp{get;set;}
public string technology{get;set;}
}
public class Wr_Address {
public String city{get;set;}
public string place{get;set;}
public string pincode{get;set;}
public String state{get;set;}
}
我有如下顶点类
public class wr_Student_Address {
public Wr_Studennt st{set;get;}
public wr_student_Address()
{
st=new Wr_Studennt();
}
public void setstudent(string name,decimal salary,decimal exp,string technology)
{
st.name=name;
st.salary=salary;
st.exp=exp;
st.technology=technology;
}
}
我的 VF 页面如下
<apex:page controller="wr_Student_Address">
<apex:form>
<apex:pageblock title="Student Details">
<apex:pageBlockSection>
<apex:outputLabel value="Name: "/>
<apex:inputText value="{!name}" />
<apex:outputLabel value="Salary: "/>
<apex:inputText value="{!salary}" />
<apex:outputLabel value="Exp: "/>
<apex:inputText value="{!exp}" />
<apex:outputLabel value="Technology: "/>
<apex:inputText value="{!technology}" />
<apex:commandButton value="setstudent" action="{! setstudent}" />
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
</apex:page>
第 0 行中的未知属性“wr_Student_Address.name”错误。
解决方法
您的页面控制器 wr_Student_Address
只有 1 个属性:st
。该类中没有直接称为 name
的字段。
尝试合并字段 {!st.name}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。