I want to have the initiation form inside a modal popup. Here's what I've figured out so far:
To open the form insisde a modal dialog, I've included this inside the "Navigatate to Url" in the custom action.
javascript:function openDialog() {
var options = {
url: "http://<server>/srd/Workflows/wf_lobEnd/wf_lobEnd.aspx",
width: 800,
height: 600,
title: "User Story"
};
SP.UI.ModalDialog.showModalDialog(options);
}
openDialog();
This works fine. Question is how to modify the wf_lobend.aspx form so that the popup closes, and the initiation form get submitted.
This is the javascript that gets generated for me behind the ok buttun of the initiation form:
<input type="button" value="Start" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent(concat('__insert;__commit;__redirectsource;__redirectToList={',ddwrt:EcmaScriptEncode($ListName),'};'))}" />
That is a bit cryptic to me, so I'm not sure what to replace. I know that I must use something like this to get the dialog closed, but that does not seem to submit the form:
onclick="SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, 'Ok clicked'); return false;"
Question is: How to close the dialog and still post the data?
(or maybe I've take the complete wrong approach, in case please let me know)
Regards
Larsi
Larsi