// // 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 cWebEdit.pkg Use csfWebRichTextEditor.pkg Use cWebCombo.pkg Use CustomerEditText.wo Use csfWebList.pkg Use csfWebColumn.pkg Use cWebColumn.pkg Use cWebColumnCombo.pkg Register_Object oSyncFusionGridCustomerList Object oCustomerEdit is a cWebModalDialog { WebProperty=Client } Property String psCustomerRowID 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 Constrain_file to Customer.File_number Set DDO_Server to oCustomer_DD 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 oOrderHistoryWebList is a csfWebList Set piColumnIndex to 0 Set piColumnSpan to 12 Set piHeight to 300 Set Server to oOrderHeader_DD Set pbAllowTextWrap to true Set pbShowToolBar To True Set pbAllowResizing To True Set pbAllowReordering To True Set pbGroupAutoCollapse to True Set pbAllowGrouping To True Set pbAllowSorting To True Set pbAllowExcelExport To True Set pbAllowPdfExport To True Set pbAllowFiltering To True Set pbShowColumnChooser to True Set pbShowColumnMenu to True Object oOrderHeader_Order_Number is a csfWebColumn Entry_Item OrderHeader.Order_Number Set psCaption to "Order Number" Set piWidth to 50 End_Object Object oOrderHeader_Ship_Via is a csfWebColumn Entry_Item OrderHeader.Ship_Via Set psCaption to "Ship Via" Set piWidth to 50 End_Object Object oSalesPerson_Name is a csfWebColumn Entry_Item SalesPerson.Name Set psCaption to "Sales Person Name" Set piWidth to 50 End_Object Object oOrderHeader_Order_Total is a csfWebColumn Entry_Item OrderHeader.Order_Total Set psCaption to "Order Total" Set piWidth to 50 End_Object Object oOrderHeader_Order_Date is a csfWebColumn Entry_Item OrderHeader.Order_Date Set psCaption to "Order Date" Set piWidth to 50 End_Object Procedure OnChangeCurrentRow String sFromRowID String sToRowID Send none End_Procedure End_Object End_Object Object oBottomPanel is a cWebPanel Set piColumnCount to 6 Set peRegion to prBottom Object oFirstRowButton is a cWebButton Set psCaption to "First Row" Set piColumnSpan to 1 Set piColumnIndex to 0 Procedure OnClick Send MoveToFirstRow of oOrderHistoryWebList End_Procedure End_Object Object oLastRowButton is a cWebButton Set psCaption to "Last Row" Set piColumnSpan to 1 Set piColumnIndex to 1 Procedure OnClick Send MoveToLastRow of oOrderHistoryWebList End_Procedure End_Object Object oShowSPButton is a cWebButton Set psCaption to "Sales Person" Set piColumnSpan to 1 Set piColumnIndex to 2 Procedure OnClick String sName Get Field_Current_Value of oSalesPerson_DD Field SalesPerson.Name to sName Send ShowInfoBalloon "" ("Sales person = "+sName ) End_Procedure End_Object 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