xpages 和 dojo 日期文本框格式

xpages and dojo date text box format

我正在尝试在打开页面进行阅读时格式化 XPage 上的 Dojo 日期文本框。

当我编辑 XPage 时,显示的正确格式是 dd/MM/yyyy。

我已经尝试了组件的模式、约束、lang 属性,也尝试了应用程序语言环境,但没有解决问题。

有谁知道如何将日期格式化为 dd/MM/yyyy 格式?

示例:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
         xmlns:xe="http://www.ibm.com/xsp/coreex">
    <xp:this.data>
        <xp:dominoDocument var="document1" formName="Test"
            action="editDocument">
        </xp:dominoDocument>
    </xp:this.data>    
    <xe:djDateTextBox id="djDateTextBox1" value="#{document1.Date}">
        <xe:this.constraints>
            <xe:djDateTimeConstraints datePattern="dd/MM/yyyy" />
        </xe:this.constraints>
    </xe:djDateTextBox>
    <xp:br />
    <xp:button value="save" id="button1"
        rendered="#{javascript:document1.isEditable()}">
        <xp:eventHandler event="onclick" submit="true"
            refreshMode="complete" immediate="false" save="true">
            <xp:this.action>
                <xp:changeDocumentMode mode="readOnly" var="document1" />
            </xp:this.action>
        </xp:eventHandler>
    </xp:button>
    <xp:button value="edit" id="button2"
        rendered="#{javascript:!document1.isEditable()}">
        <xp:eventHandler event="onclick" submit="true"
            refreshMode="complete">
            <xp:this.action>
                <xp:changeDocumentMode mode="edit" var="document1" />
            </xp:this.action>
        </xp:eventHandler>
    </xp:button>
</xp:view>

事实上,我发现 showReadonlyAsDisabled 属性 组件在读取模式下保持日期的格式。

<xe:djDateTextBox id="djDateTextBox1" value="#{document1.Date}"
    showReadonlyAsDisabled="true">
    <xe:this.constraints>
        <xe:djDateTimeConstraints datePattern="dd/MM/yyyy" />
    </xe:this.constraints>
</xe:djDateTextBox>