为什么我不能在对话框上使用两个日期选择器组件?

发布于 2024-12-29 04:16:44 字数 1471 浏览 1 评论 0原文

这是一个示例 xpage:

我试图将多个日期选择器放在扩展库中的对话框上,我收到此错误...

打开对话框时提交页面区域时出现问题... 尝试使用 id==_Container 注册小部件,但该 id 已经注册,

我不确定为什么它不能完成,任何人都有运气。

谢谢

<xp:button id="button1" value="Show Dialog">
    <xp:eventHandler event="onclick" submit="true"
        refreshMode="complete">
        <xp:this.action><![CDATA[#{javascript:getComponent("dialog1").show();}]]></xp:this.action>
    </xp:eventHandler></xp:button>
<xp:button id="button2" value="Hide Dialog">
    <xp:eventHandler event="onclick" submit="true"
        refreshMode="complete">
        <xp:this.action><![CDATA[#{javascript:getComponent("dialog1").hide();}]]></xp:this.action>
    </xp:eventHandler></xp:button>


    <xe:dialog id="dialog1">
    <xp:inputText value="#{doc1.field1}">
        <xp:this.converter>
            <xp:convertDateTime type="date"></xp:convertDateTime>
        </xp:this.converter>
        <xp:dateTimeHelper></xp:dateTimeHelper>
    </xp:inputText>
            <xp:inputText value="#{doc1.field2}">
        <xp:this.converter>
            <xp:convertDateTime type="date"></xp:convertDateTime>
        </xp:this.converter>
        <xp:dateTimeHelper></xp:dateTimeHelper>
    </xp:inputText>

</xe:dialog>

Here is an example xpage:

I am trying to put multiple date pickers on a dialog box from the extension library, i get this error...

Problem submitting area of page when I open the dialog...
Tried to register widget with id==_Container but that id is already registered

I'm not sure why it can't be done, anyone had any luck with it.

Thanks

<xp:button id="button1" value="Show Dialog">
    <xp:eventHandler event="onclick" submit="true"
        refreshMode="complete">
        <xp:this.action><![CDATA[#{javascript:getComponent("dialog1").show();}]]></xp:this.action>
    </xp:eventHandler></xp:button>
<xp:button id="button2" value="Hide Dialog">
    <xp:eventHandler event="onclick" submit="true"
        refreshMode="complete">
        <xp:this.action><![CDATA[#{javascript:getComponent("dialog1").hide();}]]></xp:this.action>
    </xp:eventHandler></xp:button>


    <xe:dialog id="dialog1">
    <xp:inputText value="#{doc1.field1}">
        <xp:this.converter>
            <xp:convertDateTime type="date"></xp:convertDateTime>
        </xp:this.converter>
        <xp:dateTimeHelper></xp:dateTimeHelper>
    </xp:inputText>
            <xp:inputText value="#{doc1.field2}">
        <xp:this.converter>
            <xp:convertDateTime type="date"></xp:convertDateTime>
        </xp:this.converter>
        <xp:dateTimeHelper></xp:dateTimeHelper>
    </xp:inputText>

</xe:dialog>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

孤独患者 2025-01-05 04:16:44

您的 xp:inputText 控件都没有 id 属性。

如果将此属性添加到控件中,则两个日期选择器都将在对话框控件内部和外部正常工作。

如果您要将两个日期选择器移到对话框之外,您还会注意到只有第一个日期选择器才会获得 dojo 下拉选择器控件

Neither of your xp:inputText controls have an id attribute.

If you add this attribute to the controls then both of the date pickers will work fine both inside and outside the dialog control.

If you were to move the two date pickers outside of the dialog box you would also notice that only the first date picker would get the dojo dropdown picker control

故事还在继续 2025-01-05 04:16:44

我会使用此对话框,它需要更多的前期工作,但您不会遇到这个问题,并且加载

http://xpagesblog.com/XPagesHome.nsf/Entry.xsp?documentId=9BB0002FE3452618852578CB0066AB75

I would use this dialog instead, its a little more upfront work but you wont have that issue and it is faster to load

http://xpagesblog.com/XPagesHome.nsf/Entry.xsp?documentId=9BB0002FE3452618852578CB0066AB75

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