Salesforce 站点日历不显示

发布于 2025-01-06 06:06:03 字数 1070 浏览 0 评论 0原文

我最近开始尝试网站并创建了一个基本页面。

<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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

情归归情 2025-01-13 06:06:03

您需要定义一个标准控制器并将输入字段包装在表单中以便弹出日历,代码应如下所示

<apex:page standardController="Booking__c">
  <apex:form >
    <apex:inputfield value="{!Booking__c.StartDateTime__c}"/>
    <apex:inputfield value="{!Booking__c.EndDateTime__c}"/>
  </apex:form>
</apex:page>

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

<apex:page standardController="Booking__c">
  <apex:form >
    <apex:inputfield value="{!Booking__c.StartDateTime__c}"/>
    <apex:inputfield value="{!Booking__c.EndDateTime__c}"/>
  </apex:form>
</apex:page>
感受沵的脚步 2025-01-13 06:06:03

尝试使用 inputText 代替:

注意:使用时,只读字段以及具有复杂自动行为(例如 Event.StartDateTime 和 Event.EndDateTime)的某些 Salesforce 对象的字段不会呈现为可编辑。使用不同的输入组件,例如相反。

来源:apex:inputField (Salesforce.com)

Try inputText instead:

Note: Read-only fields, and fields for certain Salesforce objects with complex automatic behavior such as Event.StartDateTime and Event.EndDateTime, don't render as editable when using <apex:inputField>. Use a different input component such as <apex:inputText> instead.

Source: apex:inputField (Salesforce.com)

半夏半凉 2025-01-13 06:06:03

我发现,如果有人遇到同样的问题,您需要激活该网站。

无论如何,感谢所有的回复。

I figured it out, if anyone comes across the same issue you need to activate the site.

Anyway thanks for all the responses.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文