为什么我不能在对话框上使用两个日期选择器组件?
这是一个示例 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的 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
我会使用此对话框,它需要更多的前期工作,但您不会遇到这个问题,并且加载
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