Question
· Sep 13, 2023

Fileupload and %OnSubmit

Hi Guys,

I've a popup zen page to upload files using the input tag and submit button as below :

<html>
<input type="file" size="80" name="FileStream" class="button" id="fileUpload" />
</html>
<!--imageclickbutton id="btnUpload" caption="Upload" width="90" height="30" onclick="zenPage.Upload();"/-->
<submit align="right" id="Submit" name="Submit" caption="Upload1" />

and the problem is that after loading the file on the %OnSubmit classmethod I need to execute a client code a Javascript clientMethod  (CloseAndRefresh()) which closes the current popup screen and refresh a gridview in Original page 

so how can I call a clientMethod  Before or after %OnSubmit eg. closing the current window after %OnSubmit?

 

ClassMethod %OnSubmit(pSubmit As %ZEN.Submit) As %Status
{
Set ^Track("FindDoc",7)="IN"
set sc = $$$OK
set contentType = ##class(%CSP.Page).EscapeHTML(%request.MimeData("FileStream",1).ContentType)
set className = pSubmit.%GetValue("ClassName")
set propName = pSubmit.%GetValue("PropName")
set objId = pSubmit.%GetValue("ObjId")
set isDoco = pSubmit.%GetValue("IsDoco")

I can a normal button instead of Submit button and call the clientMethod onlick but the problem with normal button is that it does not execute %OnSubmit classmethod as I tried 

 

 

Thanks

Product version: Ensemble 2018.1
Discussion (2)1
Log in or sign up to continue