我不知道为什么,但是当我访问它并尝试更新我们发送的“调查”时,我的 force.com 网站并没有更新我的机会。
页面上正确填充的数据不会在提交时发送到机会。
这是我正在使用的控制器:
public class OpptyCont {
public Opportunity opportunity{ get
{
opportunity = [SELECT Id, Name ,X1__c,X2__c,X3__c,X4__c,X5__c,X6__c,X7__c,X8__c,X9__c FROM Opportunity
WHERE Id = :ApexPages.currentPage().getParameters().get('Id')];
return opportunity;
}
set;
}
public OpptyCont() {
}
public PageReference save() {
try{
update opportunity;
}catch(System.DMLException e) {
ApexPages.addMessages(e);
return null;
}
return null;
}
}
这是 Apex 页面:
<apex:page Controller="OpptyCont" showHeader="false" sidebar="false">
<apex:pageBlock title="Survey Questions for {!Opportunity.Name}">
<b>Please fill out the following Questions:</b>
</apex:pageBlock>
<apex:form >
<br></br>
<b>1.</b><apex:outputField value="{!Opportunity.X1__c}"/>
<br></br>
<br></br>
<apex:inputTextarea label="{!Opportunity.X1__c}" value="{!Opportunity.X1__c}" id="X1__c" style="width:80%" />
<br></br>
<br></br>
<b> 2.</b><apex:outputField value="{!Opportunity.X2__c}"/><br></br>
<apex:inputTextarea label="{!Opportunity.X2__c}" value="{!Opportunity.X2__c}" id="X2__c" style="width:80%" />
<br></br>
<br></br>
<b>3.</b><apex:outputField value="{!Opportunity.X3__c}"/><br></br>
<apex:inputTextarea label="{!Opportunity.X3__c}" value="{!Opportunity.X3__c}" id="X3__c" style="width:80%" />
<br></br>
<br></br>
<b>4.</b><apex:outputField value="{!Opportunity.X4__c}"/><br></br>
<apex:inputTextarea label="{!Opportunity.X4__c}" value="{!Opportunity.X4__c}" id="X4__c" style="width:80%" />
<br></br>
<br></br>
<b>5.</b><apex:outputField value="{!Opportunity.X5__c}"/><br></br>
<apex:inputTextarea label="{!Opportunity.X5__c}" value="{!Opportunity.X5__c}" id="X5__c" style="width:80%" />
<br></br>
<br></br>
<b>6.</b><apex:outputField value="{!Opportunity.X6__c}"/><br></br>
<apex:inputTextarea label="{!Opportunity.X6__c}" value="{!Opportunity.X6__c}" id="X6__c" style="width:80%" />
<br></br>
<br></br>
<b>7.</b><apex:outputField value="{!Opportunity.X7__c}"/><br></br>
<apex:inputTextarea label="{!Opportunity.X7__c}" value="{!Opportunity.X7__c}" id="X7__c" style="width:80%" />
<br></br>
<br></br>
<b>8.</b><apex:outputField value="{!Opportunity.X8__c}"/><br></br>
<apex:inputTextarea label="{!Opportunity.X8__c}" id="X8__c" style="width:80%" />
<br></br>
<br></br>
<apex:commandButton value="Submit" action="{!save}" />
</apex:form>
</apex:page>
如果你能指出我正确的方向,那就太好了。