xpages中的计算字段值

Not*_*Art 2 lotus-notes lotus-domino xpages

我试图在点击一个具有编辑框值+自己的值的按钮时更新计算字段值.

写在按钮上的代码:这里我将编辑框的值放在范围变量中,并使编辑框为空白.comment_te是编辑框的名称

requestScope.put("commentValue", getComponent("comments_te").getValue);
getComponent("comments_te").setValue(""); 
Run Code Online (Sandbox Code Playgroud)

为计算字段的值编写的代码:comments是计算字段的名称

getComponent("comments").getValue + "\n" + requestScope.get("commentValue")
Run Code Online (Sandbox Code Playgroud)

但我得到的输出是:0 com.ibm.xsp.component.xp.XspInputText@65426542

请帮我解决一下这个.

Tim*_*ony 7

您在调用getValue()时错过了括号.通过省略这些,您将返回指向组件的getValue方法的指针,而不是调用该方法的结果.将每个对getValue的引用更改为getValue(),您将获得不同的结果.