// // 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 cWebEdit.pkg Use csfWebRichTextEditor.pkg Use cWebCombo.pkg Use CustomerEditText.wo Register_Object oSyncFusionGridCustomerList Object oCustomerEdit is a cWebModalDialog { WebProperty=Client } Property String psCustomerRowID Object oCustomer_DD is a cCustomerDataDictionary End_Object Set Main_DD to oCustomer_DD Set Server to oCustomer_DD Set psCaption to "Customer Edit" Set piMinWidth to 1000 Set piMinHeight to 200 Set peViewType to vtZoom Set pbServerOnSubmit to True // enable the OnSubmit event Set pbServerOnShow to True Object oMainPanel is a cWebPanel Set piColumnCount to 12 Object oCustomer_Name is a cWebForm Entry_Item Customer.Name Set piColumnSpan to 12 Set psLabel to "Customer Name" Set peLabelPosition to lpTop End_Object Object oCustomer_Zip is a cWebForm Entry_Item Customer.Zip Set piColumnSpan to 4 Set psLabel to "Zip/Postal Code" Set peLabelPosition to lpTop End_Object Object oCustomer_State is a cWebCombo Entry_Item Customer.State Set piColumnSpan to 8 Set psLabel to "State" Set peLabelPosition to lpTop Set piColumnIndex to 4 End_Object Object oCustomer_City is a cWebForm Entry_Item Customer.City Set piColumnSpan to 0 Set psLabel to "City" Set peLabelPosition to lpTop End_Object Object oCustomer_Comments is a csfWebRichTextEditor //cWebEdit Entry_Item Customer.Comments Set piColumnSpan to 12 Set psLabel to "Comments" Set peLabelPosition to lpTop Set piHeight to 250 Set piMinHeight to 250 End_Object End_Object Object oBottomPanel is a cWebPanel Set piColumnCount to 6 Set peRegion to prBottom Object oTextButton is a cWebButton Set psCaption to "Edit Text" Set piColumnSpan to 1 Set piColumnIndex to 3 Procedure OnClick String sRowID WebGet psCustomerRowID of oCustomerEdit to sRowID Send PopupTheDialog of oCustomerEditText Self sRowID End_Procedure End_Object 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 oCustomer_DD to bChanged If (bChanged) Begin Send Request_Save of oCustomer_DD End Forward Send Ok End_Procedure Procedure Cancel Forward Send Cancel End_Procedure Procedure OnShow String sRowID Send Clear of oCustomer_DD WebGet psCustomerRowID to sRowID Send FindByRowId of oCustomer_DD (RefTable(Customer)) (DeserializeRowID(sRowID)) 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 WebSet psCustomerRowID to sRowID Send Popup hReturnObj 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