Xpages 在 extlib 对话框中获取组件值 [英] Xpages get component value in extlib dialog box

查看:30
本文介绍了Xpages 在 extlib 对话框中获取组件值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 extlib 对话框的面板中定义了一个文档数据源(称为 document1).在此面板中,它包含对话框内容和对话框按钮栏.在对话框内容中,in 包含一个自定义控件,该控件具有所有组件,如 dojo 编辑框、列表框、单选按钮等.在对话框按钮栏中,它包含一个保存按钮.保存时,我无法通过以下 getComponent,document.getDocument.getxxx 从任何组件获取值:

I defined a document datasource(called document1) in a panel in my extlib dialog box. Within this panel, it contains dialog content and dialog butotn bar. Within the dialog content, in contains a custom control that has all the components likes dojo edit box, list box, radio butotn etc. Within the dialog button bar, it contains a Save button. On save, I could not get the value from any component by the following getComponent, document.getDocument.getxxx:

 print (getComponent.getValue("control"));
 print (document1.getDocument(true).getValueInString("control"));
 print (document1.getValue("control"));

有趣的是 document1.sertValue("control", newvalue) 和 document1.getDocument(true).isNewNote() 都在工作.

Interesting to do know that document1.sertValue("control", newvalue) and document1.getDocument(true).isNewNote() are all working.

对话框是从重复中的视图列打开的.所有数据正确显示在对话框中.我可以保存修改后的数据,检索它们并毫无问题地显示它们.我唯一无法获得它们的值进行处理.

The dialog box is opened from a view column in the repeat. All data are shown in dialog box corerctly. I could save the modified data, retrieve them and display them with no issue. The only thing that i could not get their values for processing.

保存事件处理程序已完全更新,并为面板设置了部分执行模式

The Save event handler is full update with set partial execution mode for the panel

面板忽略其参数并将范围设置为请求但没有运气.

panel is ignore its parameter and set scope to request but no luck.

非常感谢您的帮助.提前致谢.

Your help is really appreciated. Thanks in advance.

推荐答案

您需要考虑和/或检查许多事项:

There are a number of things you need to consider and/or check:

  • 确保您确实掌握了该控件.由于它位于自定义控件中,因此您可以轻松拥有多个控件.在这种情况下,您需要自己的函数 getComponentChild(parentName,controlName) 或(恕我直言更好)您从 customControl(这是一个 MAP)的复合数据中读取它
  • 绑定控件时,进行绑定比使用getValue() 更容易.因此,当您绑定到 document.subject 时,查找该值(或 viewScope.someValue,如果您将其绑定到 viewScope)
  • 如果提交时验证失败或者您在较早的阶段查询,则不能使用 getValue() 但需要使用 getSubmittedValue() 因为它包含之前的原始值验证发生
  • make sure you actually got hands on that control. Since it is inside a custom control you easily could have more than one of them. In this case you either need your own function getComponentChild(parentName,controlName) or (IMHO better) you read it from the compositeData of the customControl (which is a MAP)
  • when you bind a control, it is esier to go after its binding than to use getValue(). So when you bind to document.subject, look for that value (or viewScope.someValue if you bound it to the viewScope)
  • if validation fails in the submission or you query at an earlier phase, you can't use getValue() but need to use getSubmittedValue() since that contains the raw value before validation happened

告诉我们进展如何

这篇关于Xpages 在 extlib 对话框中获取组件值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆