某些字段未从 VF 页面捕获
我有一个 VF 页面,其中有一个弹出窗口可以接受一些字段。
当我运行页面并填写字段时,我可以看到只有一些字段值被捕获,其他字段值返回为 null。我交叉检查了字段名称,它们是相同的。有什么想法为什么会发生这种情况吗?
<apex:outputPanel id="tstpopup1">
<apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopUp}"/>
<apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopUp}">
<apex:pageblock >
<apex:pageblocksection >
<apex:pageblocksectionitem >
<apex:outputlabel value="Project: " />
<apex:inputfield id="proj" value="{!AC.Project__c}" />
</apex:pageblocksectionitem><p/>
<apex:pageblocksectionitem >
<apex:outputlabel value="Start Date: " />
<apex:inputfield id="sd" value="{!AC.Start_Date__c}" />
</apex:pageblocksectionitem>
<apex:pageblocksectionitem >
<apex:outputlabel value="End Date: " />
<apex:inputfield id="ed" value="{!AC.End_Date__c}" />
</apex:pageblocksectionitem>
<apex:pageblocksectionitem >
<apex:outputlabel value="C85 Project Lead: " />
<apex:inputfield id="pl" value="{!AC.C85_Project_Lead__c}" />
</apex:pageblocksectionitem>
<apex:pageblocksectionitem >
<apex:outputlabel value="Daily Charge Rate of Consultant: " />
<apex:inputfield id="charge" value="{!AC.Daily_Charge_Rate_of_Consultant__c}" />
</apex:pageblocksectionitem>
<apex:pageblocksectionitem >
<apex:outputlabel value="Project Role Title: " />
<apex:inputfield id="role" value="{!AC.Project_Role_Title__c}" />
</apex:pageblocksectionitem>
<apex:pageblocksectionitem >
<apex:outputlabel value="Overtime Allowed: " />
<apex:inputfield id="overtime" value="{!AC.overtime_allowed__c}" />
</apex:pageblocksectionitem>
</apex:pageblocksection>
<apex:commandbutton value="Assign to a New Project" action="{!assign}" />
<apex:commandbutton value="Cancel" action="{!closePopup}" immediate="true" /><br/><br/><br/>
</apex:pageblock>
</apex:outputPanel>
类有这个
public Assigned_Consultant__c AC{
get{
if (AC == null) AC = new Assigned_Consultant__c();
return AC;
}
set;
}
public PageReference assign()
{
system.debug('Role title ...........................' + AC.Project_Role_Title__c); // this is returning null
system.debug('Day charge ...........................' + AC.Daily_Charge_Rate_of_Consultant__c); this has value filled
system.debug('overtime_allowed__c ...........................' + AC.overtime_allowed__c); // this is returning null
// Project_Role_Title__c
displayPopup = false;
system.debug('inside assign...........................3');
system.debug('AC.................' + AC);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
本教程有点过时,但我认为它可能有助于解释与您尝试执行的操作相关的一些问题:教程:Visualforce 中的模态对话框。
This tutorial is a little dated, but I think it might help explain some of the issues associated with what you're trying to do: Tutorial: Modal Dialogs in Visualforce.