如何重置由 AskExt() 调用的 Acumatica WebDialogResult 中的字段?
How to reset field in Acumatica WebDialogResult called by AskExt()?
我正在使用在 SmartPanel 上定义的 WebDialogResult,方法是调用用于提示输入密码的 AskExt()。
不幸的是,它缓存了输入的密码,所以它会一直预填充对话框,我希望每次调用对话框时它都是空白的。
我已经尝试了各种不同的方法,例如使用 .AskExt(true) 调用,它应该刷新对话框并在调用 .AskExt() 之前调用 .ClearDialog(),以及许多其他方法,包括.Cache.Clear(), .Cache.ClearQueryCache(), .Reset(), .Update(new PwdFields()), .Delete(.Current) 以及更直接的 .Current.Pwd = null 和 .Current.Pwd = "",但没有任何效果。
那是浏览器的问题。为了解决这个问题,我建议您在 firefox 或 chrome 开发人员工具栏的帮助下找到控件的 id,并使用 javascript 来清除值。
然后你可以这样添加jquery:
$( document ).ready(function() {
$("#ctl00_phG_PXSPanelVerify2_PXFormViewVerify2_CustEdPwd2").focus()
{
$("#ctl00_phG_PXSPanelVerify2_PXFormViewVerify2_CustEdPwd2").text("");
}
});
最终,无论何时重新显示密码,下面的组合都会始终清除密码对话框。
if (this.PasswordLookup1Status.AskExt(true) == WebDialogResult.OK)
{
string currentPassword = this.PasswordLookup1Filter.Current.Pwd;
this.PasswordLookup1Filter.Current.Pwd = "";
this.PasswordLookup1Filter.Update(this.PasswordLookup1Filter.Current);
if (currentPassword == "1234")
{
Base.Transactions.Ask("Information", "Password [" + currentPassword + "] is correct.", MessageButtons.OK);
Base.Transactions.ClearDialog();
}
else
{
throw new PXException("Password [" + currentPassword + "] is incorrect.");
}
this.PasswordLookup1Filter.ClearDialog();
}
我正在使用在 SmartPanel 上定义的 WebDialogResult,方法是调用用于提示输入密码的 AskExt()。
不幸的是,它缓存了输入的密码,所以它会一直预填充对话框,我希望每次调用对话框时它都是空白的。
我已经尝试了各种不同的方法,例如使用 .AskExt(true) 调用,它应该刷新对话框并在调用 .AskExt() 之前调用 .ClearDialog(),以及许多其他方法,包括.Cache.Clear(), .Cache.ClearQueryCache(), .Reset(), .Update(new PwdFields()), .Delete(.Current) 以及更直接的 .Current.Pwd = null 和 .Current.Pwd = "",但没有任何效果。
那是浏览器的问题。为了解决这个问题,我建议您在 firefox 或 chrome 开发人员工具栏的帮助下找到控件的 id,并使用 javascript 来清除值。
然后你可以这样添加jquery:
$( document ).ready(function() {
$("#ctl00_phG_PXSPanelVerify2_PXFormViewVerify2_CustEdPwd2").focus()
{
$("#ctl00_phG_PXSPanelVerify2_PXFormViewVerify2_CustEdPwd2").text("");
}
});
最终,无论何时重新显示密码,下面的组合都会始终清除密码对话框。
if (this.PasswordLookup1Status.AskExt(true) == WebDialogResult.OK)
{
string currentPassword = this.PasswordLookup1Filter.Current.Pwd;
this.PasswordLookup1Filter.Current.Pwd = "";
this.PasswordLookup1Filter.Update(this.PasswordLookup1Filter.Current);
if (currentPassword == "1234")
{
Base.Transactions.Ask("Information", "Password [" + currentPassword + "] is correct.", MessageButtons.OK);
Base.Transactions.ClearDialog();
}
else
{
throw new PXException("Password [" + currentPassword + "] is incorrect.");
}
this.PasswordLookup1Filter.ClearDialog();
}