Xpages xe:使用view picklist OpenNTF控件在编辑模式下无法打开对话框
我正在使用扩展库和XPages构建一个基于web的工作流应用程序。一个功能是在提交前提示对话框并选择下一个审批人 对于新文档,将显示该对话框,在读取模式下也会显示该对话框。它不会为保存的文档打开。我需要它在SSJS中工作,尽管对话框确实在CSJS中打开。下面是一些代码: xpMain.xsp包含两个自定义控件:ccButtons和ccWFloDialogs CCB按钮提交按钮:Xpages xe:使用view picklist OpenNTF控件在编辑模式下无法打开对话框,xpages,xpages-extlib,xpages-ssjs,Xpages,Xpages Extlib,Xpages Ssjs,我正在使用扩展库和XPages构建一个基于web的工作流应用程序。一个功能是在提交前提示对话框并选择下一个审批人 对于新文档,将显示该对话框,在读取模式下也会显示该对话框。它不会为保存的文档打开。我需要它在SSJS中工作,尽管对话框确实在CSJS中打开。下面是一些代码: xpMain.xsp包含两个自定义控件:ccButtons和ccWFloDialogs CCB按钮提交按钮: getComponent('dlgNextOwner').show(); ccWFloDialogs dlgNext
getComponent('dlgNextOwner').show();
ccWFloDialogs dlgNextOwner对话框:
<xe:dialog id="dlgNextOwner" title="Select Supervisor">
<xe:formTable id="ftDlgNextOwner" formTitle="Select Supervisor"
formDescription="You may select a different supervisor."
disableErrorSummary="true">
<xp:this.facets>
<xe:formRow id="formRow1" xp:key="footer" for="txtWFloNextOwner"
labelWidth="125px">
<xp:inputText id="txtWFloNextOwner" style="width:200px"
value="#{viewScope.nextOwner}">
</xp:inputText>
<xe:namePicker id="npNextOwner" dialogTitle="Select Supervisor"
for="txtWFloNextOwner">
<xe:this.dataProvider>
<xe:dominoNABNamePicker addressBookSel="all-public"></xe:dominoNABNamePicker>
</xe:this.dataProvider>
</xe:namePicker>
</xe:formRow>
</xp:this.facets>
</xe:formTable>
</xe:dialog>
我还使用扩展库中的,如果我移除包含控件和数据源的面板,对话框将显示在SSJS中!代码位于自定义控件中,但如果它直接位于XPage中,问题也是一样的。以下是面板的代码:
<xp:panel
id="vendorDiv">
<xp:this.data>
<xp:dominoView
var="nvVend"
viewName="V_Vend"
ignoreRequestParams="true"
databaseName="other/lookupdb.nsf"
startKeys="#{javascript:viewScope.srchVend}">
</xp:dominoView>
</xp:this.data>
<xe:formTable
id="ftGetVendor"
disableErrorSummary="true"
labelPosition="above">
<xe:formRow
id="frVendor"
for="cfVendorName"
label="Name of the Vendor:">
<xp:text
escape="true"
id="cfVendorName"
value="#{currentDocument.VendorName}"
style="width:200px">
</xp:text>
<xc:viewpicklist
rowsPerPage="15"
buttonImage="./add.png"
tableClass="tablecellgreen"
headerClass="headerclass"
rowClass="odd, even"
searchBar="false"
searchButtonText="Search"
searchButtonClass="button2"
searchBarClass="headerclass"
pagerStyleFirst="navbutton1"
pagerStylePrevious="navbutton2"
pagerStyleCurrent="navbutton4"
pagerStyleNext="navbutton2"
pagerStyleLast="navbutton3"
typeAheadBar="true"
select="Column"
onReturn="Set Scope Value"
bottomBarClass="bottomround headerclass"
cancelButtonText="Cancel"
cancelButtonClass="button2 floatthisright"
type="Single Value"
finishButtonText="Finish"
finishButtonClass="button2 floatthisright"
multiSelectButtonAddImg="./add.png"
multiSelectButtonRemoveImg="./delete.png"
picklistButtonClass="button"
openDialogWith="Link"
picklistLinkImg="./add.png"
multiSelectLinkAddImg="./add.png"
multiSelectLinkRemoveImg="./delete.png"
selectWith="Link"
clearSearchImg="./cross.png"
SelectCellWidth="30px"
dialogID="dlgVend"
dialogTitle="Select a Vendor"
dialogWidth="80%"
refreshID="vendorDiv"
ssjsSelectFunction="getVendorInfo"
varName="viewScope.vendorInfo"
datasrc="nvVend"
selectColumn="4"
linkImg="./add.png"
typeAheadVar="viewScope.srchVend">
<xc:this.viewColumn>
<xp:value>0</xp:value>
<xp:value>1</xp:value>
<xp:value>2</xp:value>
<xp:value>3</xp:value>
</xc:this.viewColumn>
</xc:viewpicklist>
</xe:formRow>
<xe:formRow
id="frVendorStatus"
for="cfVendorStatus"
label="Vendor Registration Status:">
<xp:text
escape="true"
id="cfVendorStatus"
value="#{currentDocument.VendorStatus}">
</xp:text>
</xe:formRow>
<xe:formRow
id="frVendorCountry"
for="cfVendorCountry"
label="Country Name:">
<xp:text
escape="true"
id="cfVendorCountry"
value="#{currentDocument.VendorCountry}">
</xp:text>
</xe:formRow>
</xe:formTable>
</xp:panel>
请求的供应商信息填充字段,没有任何问题或错误。然而,这里有些东西似乎阻止了使用SSJS打开对话框
有人能看到我明显丢失的东西吗?数据源在面板中,ignoreRequestParams为true,否则它不起作用
主数据源位于整个XPage上下文中。我试图在主面板外添加ccWFloDialog自定义控件,并将数据源更改为面板,但没有成功
有什么想法吗?暂时忘记这个对话框。这可能与数据源有关。建议您先在xpage上使用它。具有可见字段。然后,可以使用rendered属性使其在xpage上工作,类似于对话框的显示方式。一旦你有工作,然后你应该很好地应用到对话框。这个想法是首先将对话框从等式中去掉,以确保它正常工作 相反,我决定用CSJS而不是SSJS打开对话框。我已经改变了一些逻辑,并将有更多的工作要做,以完成这部分的项目。谢谢大家 没什么可说的。你需要进一步阐述这个问题。如果您不熟悉dialogs,请获取OpenNTF扩展库示例数据库并检查其中的代码。谢谢,但是ExtLib示例数据库在可编辑的XPages中没有任何对话框示例。否则,代码是相同的。我希望其他人能分享一个有用的例子。正如我建议的那样,扩展你的问题。我认为在读取和编辑模式下打开xe:dialog没有问题。另外,在Firebug/JS控制台中检查客户端javascript错误,CSJS中的任何错误通常会禁用所有事件。使用SSJS时没有任何类型的javascript错误。在SSJS代码中,我设置了两个viewScope变量,这些变量没有设置。对话框就是打不开。在CSJS中,它可以很好地打开。谢谢,大卫。请记住,如果文档未保存,则此操作确实有效。数据将被保存,并发送给用户选择的主管。问题是文档是否已保存。我还有另外两个对话框,它们是在读取模式下打开的,但不是在编辑模式下打开的。我一直在挖掘,上面我已经更新了几次测试。我会一直打开它直到它被修复。我没有修复这个问题,而是决定使用SSJS提交按钮中的onComplete来使用CSJS打开对话框。看起来很好用!希望这能帮助其他尝试在同一位置使用view picklist自定义控件和SSJS open对话框的人。
<xp:panel
id="vendorDiv">
<xp:this.data>
<xp:dominoView
var="nvVend"
viewName="V_Vend"
ignoreRequestParams="true"
databaseName="other/lookupdb.nsf"
startKeys="#{javascript:viewScope.srchVend}">
</xp:dominoView>
</xp:this.data>
<xe:formTable
id="ftGetVendor"
disableErrorSummary="true"
labelPosition="above">
<xe:formRow
id="frVendor"
for="cfVendorName"
label="Name of the Vendor:">
<xp:text
escape="true"
id="cfVendorName"
value="#{currentDocument.VendorName}"
style="width:200px">
</xp:text>
<xc:viewpicklist
rowsPerPage="15"
buttonImage="./add.png"
tableClass="tablecellgreen"
headerClass="headerclass"
rowClass="odd, even"
searchBar="false"
searchButtonText="Search"
searchButtonClass="button2"
searchBarClass="headerclass"
pagerStyleFirst="navbutton1"
pagerStylePrevious="navbutton2"
pagerStyleCurrent="navbutton4"
pagerStyleNext="navbutton2"
pagerStyleLast="navbutton3"
typeAheadBar="true"
select="Column"
onReturn="Set Scope Value"
bottomBarClass="bottomround headerclass"
cancelButtonText="Cancel"
cancelButtonClass="button2 floatthisright"
type="Single Value"
finishButtonText="Finish"
finishButtonClass="button2 floatthisright"
multiSelectButtonAddImg="./add.png"
multiSelectButtonRemoveImg="./delete.png"
picklistButtonClass="button"
openDialogWith="Link"
picklistLinkImg="./add.png"
multiSelectLinkAddImg="./add.png"
multiSelectLinkRemoveImg="./delete.png"
selectWith="Link"
clearSearchImg="./cross.png"
SelectCellWidth="30px"
dialogID="dlgVend"
dialogTitle="Select a Vendor"
dialogWidth="80%"
refreshID="vendorDiv"
ssjsSelectFunction="getVendorInfo"
varName="viewScope.vendorInfo"
datasrc="nvVend"
selectColumn="4"
linkImg="./add.png"
typeAheadVar="viewScope.srchVend">
<xc:this.viewColumn>
<xp:value>0</xp:value>
<xp:value>1</xp:value>
<xp:value>2</xp:value>
<xp:value>3</xp:value>
</xc:this.viewColumn>
</xc:viewpicklist>
</xe:formRow>
<xe:formRow
id="frVendorStatus"
for="cfVendorStatus"
label="Vendor Registration Status:">
<xp:text
escape="true"
id="cfVendorStatus"
value="#{currentDocument.VendorStatus}">
</xp:text>
</xe:formRow>
<xe:formRow
id="frVendorCountry"
for="cfVendorCountry"
label="Country Name:">
<xp:text
escape="true"
id="cfVendorCountry"
value="#{currentDocument.VendorCountry}">
</xp:text>
</xe:formRow>
</xe:formTable>
</xp:panel>