Unable to pass the action name and user comment to server script from spModal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 01:01 AM - edited 08-04-2023 01:03 AM
Hi All,
Unable to pass the "action" name and user "comment" to server script from spModal.
HTML code:
<a ng-click="c.onOpen()" class="btn btn-default btn-rounded text-uppercase"><strong>${no}</strong></a>
Code in Client controller:
c.onOpen = function() {
//ask the user for a string
spModal.open({
title: '${Re-open Incident}',
message: '${Please provide a reason to re-open the incident}',
buttons: [{
label: ' ${Cancel} ',
cancel: true
},
{
label: ' ${Re-open} ',
primary: true
}
],
input: true,
value: c.response
}).then(function(response) {
c.server.get({
action: "reopen",
userInput: response
}).then(function(serverResponse) {
// console.log(serverResponse.data)
});
});
};
Server script :
if (input && input.action === "reopen") {
gs.addInfoMessage("Hello");
//gs.addInfoMessage(input.userInput);
//data.reopenMsg = gs.getMessage("Incident reopened");
gs.addInfoMessage(gs.getMessage("Incident reopened"));
gr.setValue('state', 2);
gr.comments = "Reason to Re-open : " +input.userInput;
gr.update();
}
Please let me know if i made any mistake.
Thanks and Regards,
Allu Gopal.