// // This shows the basic structure of a modal dialog. It explains where the controls go and how to // initialize it (PopupTheDialog & OnShow). The DialogResult method explains how to return data // from your dialog. The commented oOpenDialog_btn is an example of a button that opens this dialog. // This button would be placed on another view. // // Object oOpenDialog_btn is a cWebButton // Set psCaption to "Open Dialog" // // Procedure OnClick // Send PopupTheDialog of oWebModalDialog Self "Param 1" "Param 2" // End_Procedure // // Procedure OnCloseModalDialog Handle hoModalDialog // String sResult // // Get DialogResult of hoModalDialog to sResult // End_Procedure // End_Object // Use cWebModalDialog.pkg Use cWebPanel.pkg Use cWebButton.pkg Use cWebForm.pkg Use cWebFileUploadButton.pkg Use cWebFileUploadForm.pkg Object oFileUploadTest is a cWebModalDialog Set psCaption to "File Upload Test" Set piMinWidth to 500 Set piMinHeight to 200 Set pbServerOnSubmit to True // enable the OnSubmit event Object oMainPanel is a cWebPanel Set piColumnCount to 12 Object oWebFileUploadForm1 is a cWebFileUploadForm Set piColumnSpan to 0 Set psLabel to "file" // Called for each file upload to generate the local path where the file is stored. Function OnFileUpload String sFileName Integer iBytes String sMime Returns String String sPath // Determine local path based on workspace setting Get psDataPath of (phoWorkspace(ghoApplication)) to sPath Move (sPath + "\Uploads\" + sFileName) to sPath Function_Return sPath End_Function End_Object Object oWebForm1 is a cWebForm Set piColumnSpan to 0 Set psLabel to "form" End_Object End_Object Object oBottomPanel is a cWebPanel Set piColumnCount to 6 Set peRegion to prBottom Object oOkButton is a cWebButton Set psCaption to C_$OK Set piColumnSpan to 1 Set piColumnIndex to 4 Procedure OnClick Send Ok End_Procedure End_Object Object oCancelButton is a cWebButton Set psCaption to C_$Cancel Set piColumnSpan to 1 Set piColumnIndex to 5 Procedure OnClick Send Cancel End_Procedure End_Object End_Object Procedure OnSubmit Send Ok End_Procedure Procedure Ok // Do some calculations / saves / validations here .. Forward Send Ok End_Procedure Procedure Cancel Forward Send Cancel End_Procedure // This is an example of how a dialog is called. You can pass any number of set up parameters // which will use WebSet to configure controls or to store the values. Procedure PopupTheDialog Handle hReturnObj String sRowID // Invoke the modal dialog Send Popup hReturnObj // Initialize any object properites as needed via WebSet and perform finds End_Procedure // // // // This is an example of a method that would be called by the return object when // // OnCloseModalDialog is executed. It will use WebGet to get the result values from the // // controls. It can also use the DDO structure to get values of the record buffer here. If one // // return value is not enough consider using a Struct or ByRef parameters to return multiple // // values. // Function DialogResult Returns String // String sResult // // // Get the 'result' of the dialog when needed // // Function_Return sResult // End_Function // End_Object