I am doing a customization in share where on click of a link say "send email" i am displaying a dialog-box as attached emailform.jpg.how can I pass the value of parameter subject and textfield in the actionUrl of showdialog.The code is for display dialog is as below:
populateCandidateEmailForm: function populateCandidateEmailForm(responseJSON,asset,emailID)
{
var displayValue = "";
var subjectField = "";
var textField = "";
var emailDialog = new Alfresco.module.SimpleDialog(this.id + "-candidate_email_dialog").setOptions({
width: "40em",
templateUrl: YAHOO.lang.substitute(Alfresco.constants.URL_SERVICECONTEXT + "components/form?itemKind={itemKind}&itemId={itemId}&showCancelButton=true&submitType=json&formId={formId}",
{
itemKind: "type",
itemId: "impublic:sendCandidateEmail",
formId: "sendCandidateEmail",
}),
actionUrl: Alfresco.constants.PROXY_URI + "com/sendcandidateemail?recepients="+emailID+"",
doBeforeDialogShow:
{
fn: function(formsRuntime, emailDialogObject){
this.form.submitElements[0].set('label','Send');
var dialogHeader = Dom.get(formsRuntime.formId + '-container_h');
dialogHeader.innerHTML = "Candidate Email Form";
var fields = document.getElementsByName('prop_impublic_candidateadditionalInfo');
var nodeRefs = [];
for(x in asset){
nodeRefs.push(asset[x].nodeRef);
}
var siteName = Alfresco.constants.SITE;
var additionalInfo = "{\"documents\":\"" + nodeRefs + "\"," +
"\"site\":\"" + siteName + "\"," +
"\"sender\":\"" + responseJSON.sender + "\"," +
"\"template\":\"" + responseJSON.template + "\"}";
fields[0].value = additionalInfo;
},
obj: null,
scope: null
},
doSetupFormsValidation:
{
fn: function(form){
form.addValidation("template_x002e_toolbar_x002e_tabsearch-email_dialog_prop_impublic_to", null, "Email is not valid!");
},
obj: null,
scope: null
},
onFailure:
{
fn: function(response){
if(response.json.status == 400){
Alfresco.util.PopupManager.displayPrompt(
{
text: response.json.message
});
}
},
obj: null,
scope: window
}
});
emailDialog.show();
},