Xpages在extlib对话框中获取组件值

时间:2012-12-26 16:10:47

标签: xpages xpages-ssjs xpages-extlib

我在extlib对话框的面板中定义了一个文档数据源(称为document1)。在此面板中,它包含对话框内容和对话框按钮栏。在对话框内容中,包含一个自定义控件,其中包含所有组件,如dojo编辑框,列表框,无线电按钮等。在对话框按钮栏中,它包含一个“保存”按钮。在保存时,我无法通过以下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()都在工作。

从重复中的视图列打开对话框。所有数据都在对话框中显示。我可以保存修改后的数据,检索它们并显示它们没有问题。唯一让我无法获得处理价值的东西。

Save事件处理程序是完全更新,具有面板

的set partial execution mode

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

非常感谢您的帮助。提前谢谢。

1 个答案:

答案 0 :(得分:1)

您需要考虑和/或检查一些事项:

  • 确保你实际掌握了这个控件。由于它位于自定义控件内,因此您可以轻松拥有多个控件。在这种情况下,您需要自己的函数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)
  • getValue(),因为它包含验证发生前的原始值

让我们知道它是怎么回事