// // 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 cCustomerDataDictionary.dd Use cSalesPersonDataDictionary.dd Use cOrderHeaderDataDictionary.dd Use cWebCombo.pkg Object oOrderHeaderPopup is a cWebModalDialog Set Verify_Save_msg to 0 // save confirmation comes after the dialog is closed and the grid is refreshed and as such it causes trouble. Object oSalesPerson_DD is a cSalesPersonDataDictionary End_Object Object oCustomer_DD is a cCustomerDataDictionary End_Object Object oOrderHeader_DD is a cOrderHeaderDataDictionary Set DDO_Server to oSalesPerson_DD Set DDO_Server to oCustomer_DD Set Field_Option field OrderHeader.Order_Date DD_Commit to False // we want to test date form, not much can be changed without this End_Object Set Main_DD to oOrderHeader_DD Set Server to oOrderHeader_DD Set psCaption to "Order Header Popup" 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 oOrderHeader_Order_Number is a cWebForm Entry_Item OrderHeader.Order_Number Set piColumnSpan to 4 Set psLabel to "Order Number" Set peLabelPosition to lpTop End_Object Object oOrderHeader_Order_Date is a cWebDateForm Entry_Item OrderHeader.Order_Date Set psLabel to "Order Date" Set peLabelPosition to lpTop Set piColumnSpan to 4 Set piColumnIndex to 4 End_Object Object oCustomer_Customer_Number is a cWebForm Entry_Item Customer.Customer_Number Set piColumnSpan to 0 Set psLabel to "Customer Number" Set piColumnSpan to 4 Set peLabelPosition to lpTop End_Object Object oCustomer_Name is a cWebForm Entry_Item Customer.Name Set piColumnSpan to 0 Set psLabel to "Customer Name" Set piColumnSpan to 4 Set piColumnIndex to 4 Set peLabelPosition to lpTop End_Object Object oCustomer_State is a cWebCombo Entry_Item Customer.State Set piColumnSpan to 4 Set psLabel to "State" Set peLabelPosition to lpTop Set piColumnIndex to 8 End_Object Object oSalesPerson_Name is a cWebForm Entry_Item SalesPerson.Name Set piColumnSpan to 4 Set psLabel to "Sales Person Name" Set peLabelPosition to lpTop End_Object Object oOrderHeader_Terms is a cWebCombo Entry_Item OrderHeader.Terms Set piColumnSpan to 0 Set psLabel to "Terms" Set peLabelPosition to lpTop Set piColumnIndex to 4 End_Object Object oOrderHeader_Ship_Via is a cWebCombo Entry_Item OrderHeader.Ship_Via Set piColumnSpan to 0 Set psLabel to "Ship Via" Set peLabelPosition to lpTop 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 Boolean bChanged Get Changed_State of oOrderHeader_DD to bChanged If (bChanged) Begin Send Request_Save End 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 RowId riRowID Send Popup hReturnObj Clear OrderHeader Move (DeserializeRowID(sRowID)) To riRowID Send FindByRowId of oOrderHeader_DD OrderHeader.File_Number riRowID 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