Lotus notes 以xpages为单位计算的字段值

Lotus notes 以xpages为单位计算的字段值,lotus-notes,xpages,lotus-domino,Lotus Notes,Xpages,Lotus Domino,我试图用编辑框的值+它自己的值来更新单击按钮时的计算字段值 写在按钮上的代码:在这里,我把编辑框的值放在范围变量中,并使编辑框为空。comment_te是编辑框的名称 requestScope.put("commentValue", getComponent("comments_te").getValue); getComponent("comments_te").setValue(""); 为计算字段的值编写的代码:comments是计算字段的名称 getComponent("commen

我试图用编辑框的值+它自己的值来更新单击按钮时的计算字段值

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

requestScope.put("commentValue", getComponent("comments_te").getValue);
getComponent("comments_te").setValue(""); 
为计算字段的值编写的代码:comments是计算字段的名称

getComponent("comments").getValue + "\n" + requestScope.get("commentValue")
但我得到的结果是: 0 com.ibm.xsp.component.xp。XspInputText@65426542


请帮我解决这个问题。

您返回对象的代码。 尝试以下方法。 下面的代码获取editbox值并设置为范围变量

requestScope.commentValue = getComponent("comments_te").value;
getComponent("comments_te").value = "";
以下代码将值设置为计算字段

getComponent("comments").value = getComponent("comments").value + "\n" + requestScope.commentValue;
当您将值附加到计算字段时,默认情况下,它将向其值添加0。如果需要,请执行验证


我希望这能帮助你

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