Search code examples
xpagesxpages-extlibxpages-ssjs

xe:dialog won't open in edit mode with view picklist OpenNTF control


I'm using the Extension Library and XPages to build a web based workflow application. One feature is to prompt a dialog and select the next approver before submitting it forward.

For new documents, the dialog appears, and it also appears when in read mode. It never opens for a saved document. I need it to work in SSJS, though the dialog does open in CSJS. Here is some of the code:

xpMain.xsp contains two custom controls: ccButtons and ccWFloDialogs.

ccButtons "Submit" button:

getComponent('dlgNextOwner').show();

ccWFloDialogs "dlgNextOwner" dialog:

<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>

In CSJS, I can use the following code and it successfully opens the dialog:

XSP.openDialog("#{id:dlgNextOwner}");

I'm also using Mark Hughes' picklist from the extension library, and if I remove the panel which contains the control and data source, the dialog shows up in SSJS! The code is in a custom control, although, if it's directly in the XPage, the problem is the same. Here is the code for the panel:

<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>

The requested vendor information populates the fields, without any problem or errors. However, something here seems to prevent dialogs from opening up using SSJS.

Can anyone see anything obvious I'm missing? The data source is in the panel, ignoreRequestParams is true (otherwise it doesn't work).

The main data source is in the entire XPage context. I tried to add the ccWFloDialog custom control outside the main panel, and change the data source to the panel, but that didn't work.

Any ideas?


Solution

  • Instead, I decided to open the dialogs using CSJS, instead of SSJS. I've changed some of logic, and will have a bit more to do to finish this part of the project. Thanks to all!