twitter-bootstrapmodal-dialogxpagessession-scope

xpage Modal Dialog and sessionScopes


I have a repeat controller, with repeating buttons and clicking on a button opens up a dialog, and should show the correct document (combination of bootstrap).

Im setting a session scope variable on the click to set the doc ID, then the custom control within the modal has the documentID set from the session scope variable, however it doesn't seem to be working.

I think its because the modal is opening before the session scope variable is set.... Any ideas? Code below, thanks

    <xp:button value="Open File" id="button6"
                            styleClass="btn btn-info btn-block btn-tall">
                            <xp:this.attrs>

                                <xp:attr name="data-toggle"
                                    value="modal">
                                </xp:attr>
                                <xp:attr name="data-target"
                                    value="#Modal2">
                                </xp:attr>
                            </xp:this.attrs>
                            <xp:eventHandler event="onclick"
                                submit="true" refreshMode="partial"
                                refreshId="ccModalFileDetails">
                                <xp:this.action><![CDATA[#{javascript:sessionScope.uploadedFileID = rowData.getUniversalID();
print ("HELLO: " + sessionScope.uploadedFileID)}]]></xp:this.action>
                            </xp:eventHandler></xp:button>

Solution

  • Make sure for your second dataSource ignoreRequestParams should be true and NOT false.

    What that does is it tells your dataSource to NOT look at the URL for information on the binding. So you definitely do want that second dataSource to ignore the url parameters. This is almost certainly why it's bringing in information from the parent.