问题描述
我有一个奇怪的问题,我有一个简单的 javascript 按钮,该调用的 1 函数用于写入一些文档历史记录并替换一个字段的值。然后它对容器 div ID 进行部分更新。
此按钮在通过英国访问时可以正常工作,但是当瑞士同事使用时,该按钮不起作用。
我有 1 个实例,目睹它不适用于 1 个用户,只是在当天晚些时候突然工作,所以我对可能是什么问题感到困惑。
按钮代码
<xp:button id="btnProceed" styleClass="btn btn-primary" value="Proceed">
<xp:this.disabled><![CDATA[#{javascript:try{
if (getComponent("chkConfirmed").getValue() == "false") {
return true;
} else {
return false;
}
}catch(e){
openLogBean.addError(e,this);
}
}]]></xp:this.disabled>
<xp:eventHandler event="onclick" submit="true" refreshMode="partial"
refreshId="contentWhiteBackground">
<xp:this.action><![CDATA[#{javascript:var dt = new Date();
var arrHistory:array = AddindepConfirmationHistoryItem(currentDocument,dt,"Confirmed understanding of the opening guidance",userBean.displayName);
document1.replaceItemValue("showIntroduction","2");
document1.save();
}]]></xp:this.action>
</xp:eventHandler></xp:button>
Sub AddindepConfirmationHistoryItem(confdoc As Notesdocument,dt As Variant,action As String,usrname As String)
Dim hlist As StringList
If Len(confdoc.History(0)) = 0 Then
confdoc.History = IndepConfirmationHistoryItem(dt,action,usrname)
Else
Set hlist = New StringList(confdoc.History,"")
Call hlist.Append(IndepConfirmationHistoryItem(dt,usrname))
confdoc.History = hlist.Items
End If
End Sub
编辑:
function AddindepConfirmationHistoryItem(doc,username){
var ArrDocHistory:array = doc.getItemValueArray("History");
var dateTimeFormat = new java.text.SimpleDateFormat("dd/MM/yyyy kk:mm");
var dateTimeString = dateTimeFormat.format(dt);
if(ArrDocHistory.length < 1){
// This should always return an object as it is created when an objectives document is first
// created but do this check to be safe and create an array if for some reason it doesnt exist
ArrDocHistory = [dateTimeString+"|"+action+"|"+username];
}else{
// append new value to the array
ArrDocHistory.push(dateTimeString+"|"+action+"|"+username);
}
doc.replaceItemValue("History",ArrDocHistory);
doc.replaceItemValue("LastUpdatedByName",username);
doc.replaceItemValue("LastUpdatedDate",dt);
//doc.Save();
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)