我在使用此代码加载文档时遇到问题。
var c = getComponent("dynp")
c.show("contact",{action:'editDocument',documentId:unid})
或者实际上它只是一个恼人的问题。
我的var unid
指向另一个数据库中的文档,但c.show
期望该文档与DynamicContent代码位于同一数据库中。
因此,每次调用c.show("contact",{action:'editDocument',documentId:unid})
错误
dynp error mydynamic.xsp发生异常调用方法NotesDatabase.getDocumentByUNID(java.lang.String)
customcontrols数据源是
<xp:dominoDocument formName="myForm" var="doc1" databaseName="#{javascript:getExternaldb()}" />
因此文档加载正确。 但我仍然得到恼人的错误(管理员不高兴)
有没有办法避免这个错误?
答案 0 :(得分:1)
您没有将数据库名称作为参数传递。如果没有ignoreRequestParams,我很确定这将假设当前的数据库,覆盖你在数据源中放置的任何内容。
如果你在参数中传递它会有效吗?
答案 1 :(得分:0)
I've never tried to do what you're doing. I don't get what you're trying to do really. I never even saw the action part of c.show. And only rarely do i ever use getComponent.
You have a dynamic panel and a working custom control right? You're trying to control edit mode vs read mode right? Why don't you just set a viewScoped variable with something like editMode=true / false. And then have the custom control read that in to determine the mode. No need that that action business...