I have a string function for a button click event. It successfully makes an HTTP request to a Java servlet which returns a PDF file. The file is correct and is able to be saved. I need to be able to look at the response that came back, so I added a callback function. It does not seem to fire. The code is below. All of before the RPCManager.sendRequest already works and has not been changed.
That is does not fire is born out by the developer console log.
I tried using the examples under RPCManager. They had a callback parameter with a string that invoked a named callback function defined in the statement following the sendRequest call. That did not work, either.
It has been a while since I ran into a problem. But, I really need help with this one.
Thanks,
Rick
P.S. I am running SmartClient Version: v8.2p_2013-01-14/EVAL Development Only on Mozilla Firefox 12.0 with Firebug using Windows XP Pro 32 bit.
Code:
Log.logDebug("****servlet version*** MeetingForm.CreateAgendaButton.Click"); var form = MeetingForm; var oldPrintOptions = form.getValue("AgendaPrintOptions"); Log.logDebug("*** old[Agenda]PrintOptions: " + oldPrintOptions); var vmOptions = meetingTypeVM.getValues().Agenda.Options; var vmNewOptions = vmOptions.Agenda.Options; var vmTopic = meetingTypeVM.getValues().Agenda.Topic; var vmNewTopic = vmTopic.Agenda.Topic; var vmIssue = meetingTypeVM.getValues().Agenda.Issue; var vmNewIssue = vmIssue.Agenda.Issue; var vmTask = meetingTypeVM.getValues().Agenda.Task; var vmNewTask = vmTask.Agenda.Task; var vmSpecial = meetingTypeVM.getValues().Agenda.Special; var vmNewSpecial = vmSpecial.Agenda.Special; var vmNewPrintOptions = { Options: vmNewOptions, Topic: vmNewTopic, Issue: vmNewIssue, Task: vmNewTask, Special: vmNewSpecial }; var newPrintOptions = isc.JSON.encode(vmNewPrintOptions); if (oldPrintOptions != newPrintOptions) { Log.logDebug("*** new[Agenda]PrintOptions: " + newPrintOptions); form.changesPending = true; form.setValue("AgendaPrintOptions", newPrintOptions); } // isc.say("calling MeetingAgendaServlet11"); var meetingDate; meetingDate = String(form.getValue("MeetingDate")); if (meetingDate == "undefined") meetingDate = ""; var meetingTime; meetingTime = String(form.getValue("MeetingTime")); if (meetingTime == "undefined") meetingTime = ""; var d = new Date(); var minOffset = d.getTimezoneOffset(); var s; if (minOffset < 0) { s = "+"; minOffset = -1 * minOffset; } else { s = "-"; } var hrs = 100 + (minOffset / 60); var mins = 100 + minOffset - ( (hrs - 100) * 60); var timeZoneOffset = s + hrs.toString().substring(1) + ":" + mins.toString().substring(1); RPCManager.sendRequest({ httpMethod: "POST", actionURL: "/servlet/MeetingAgendaServlet11", params: { meetingDate: meetingDate, meetingTime: meetingTime, timeZoneOffset: timeZoneOffset, meetingTypeID: String(Application.currentMeetingTypeID), agendaPrintOptions: String(form.getValue("AgendaPrintOptions")) }, downloadResult: true, downloadToNewWindow:false, useSimpleHttp: true, callback: function(response) { Log.logDebug("*** callback response: " + response); isc.clearPrompt(); if (response.status == RPCResponce.STATUS_SUCCESS) { if (!window.EmailForm) { var message = "Component ID \"EmailForm\", target of action \"Edit Record\" does not exist"; isc.Log.logWarn(message); if (isc.designTime) { isc.say(message); } } var headers = {}; headers = response.httpHeaders; Log.logDebug("*** response headers: " + headers); form = EmailForm; form.clearValues(); form.setValue("toEmails", headers.toEmails ) ; form.setValue("ccEmails", headers.ccEmails ) ; form.setValue("bccEmails", headers.bccEmails ) ; //form.getItem("CloseButton").setDisabled(false); EmailWindow.show(); } else { isc.say("Unsuccessful request."); } }, }); Log.logDebug("***END***END***END*** MeetingForm.CreateAgendaButton.Click")
That is does not fire is born out by the developer console log.
Code:
16:36:20.681:MUP2:DEBUG:Log:****servlet version*** MeetingForm.CreateAgendaButton.Click 16:36:20.682:MUP2:DEBUG:Log:*** old[Agenda]PrintOptions: { "Options":{... } 16:36:20.846:MUP2:DEBUG:Log:***END***END***END*** MeetingForm.CreateAgendaButton.Click
It has been a while since I ran into a problem. But, I really need help with this one.
Thanks,
Rick
P.S. I am running SmartClient Version: v8.2p_2013-01-14/EVAL Development Only on Mozilla Firefox 12.0 with Firebug using Windows XP Pro 32 bit.
Comment