Salesforce 站点日历不显示
我最近开始尝试网站并创建了一个基本页面。
<apex:page controller="newController">
<apex:form >
<apex:pageBlock title="Welcome {!$User.FirstName}"></apex:pageBlock>
<apex:pageBlock mode="edit">
<apex:pageBlockSection title="Travel Details" >
<apex:inputField value="{!Booking.StartDateTime__c}"></apex:inputField>
<apex:inputText value="{!Booking.EndDateTime__c}"></apex:inputText>
<apex:inputField value="{!Booking.StartLocation__c}"></apex:inputField>
<apex:inputField value="{!Booking.EndLocation__c}"></apex:inputField>
</apex:pageBlockSection>
</apex:form>
这是我显示的两个字段 - 但有一个问题,当用户单击该字段时,日历无法弹出,它们只是充当普通的文本框。
我在网上搜索并检查了用户和字段级别权限,一切似乎都很好。它们的数据类型是日期时间。
那么有谁知道我怎样才能显示这个日历?
编辑:我已经提出了建议的代码补救措施,但不幸的是没有运气。输入字段现在在输入框旁边显示当前日期时间(如在 salesforce 中),但仍然没有日历弹出窗口。我还构建了控制器。可能是 JavaScript 问题?
非常感谢任何帮助, 干杯
I have recently started playing around with sites and created a basic page.
<apex:page controller="newController">
<apex:form >
<apex:pageBlock title="Welcome {!$User.FirstName}"></apex:pageBlock>
<apex:pageBlock mode="edit">
<apex:pageBlockSection title="Travel Details" >
<apex:inputField value="{!Booking.StartDateTime__c}"></apex:inputField>
<apex:inputText value="{!Booking.EndDateTime__c}"></apex:inputText>
<apex:inputField value="{!Booking.StartLocation__c}"></apex:inputField>
<apex:inputField value="{!Booking.EndLocation__c}"></apex:inputField>
</apex:pageBlockSection>
</apex:form>
These are the two fields that I display - one problem though, when a user clicks on the field the calendar fails to popup, they are just acting as a normal textbox.
I have searched on the web and checked user and field level permissions and everything seems to be fine. They are of the datatype datetime.
So does anyone know how I can get this calendar to display?
EDIT: I have made the code remedies suggested but unfortunately had no luck. The inputfield now displays the current date time next to the input box(as in salesforce) but still no calendar popup. I have also built the controller. Possibly a javascript issue?
Any help much appreciated,
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要定义一个标准控制器并将输入字段包装在表单中以便弹出日历,代码应如下所示
You need to define a standard controller and wrap your inputfield in a form in order to get the calendar to pop up, the code should look like this
尝试使用 inputText 代替:
来源:apex:inputField (Salesforce.com)
Try inputText instead:
Source: apex:inputField (Salesforce.com)
我发现,如果有人遇到同样的问题,您需要激活该网站。
无论如何,感谢所有的回复。
I figured it out, if anyone comes across the same issue you need to activate the site.
Anyway thanks for all the responses.