// // 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 Object oCustomerEditText 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 pbReadOnly to True Set piColumnSpan to 12 Set psLabel to "Customer Name" Set peLabelPosition to lpTop End_Object Object oCardContainer is a cWebCardContainer Set pbShowCaption to True Set pbShowBorder to True Set pbFillHeight to True Set pbServerOnCardChange to True Object oCard1 is a cWebCard Set piColumnCount to 4 Set psCaption to "Card One (header)" Object oCustomer_Header is a csfWebRichTextEditor Set pbFillHeight to True Set Server to oCustomer_DD Entry_Item Customer.Header Set pbNoFillIfHidden to False Set pbNoUpdateIfHidden to False Set piColumnSpan to 12 Set psLabel to "Header" Set peLabelPosition to lpTop Set piHeight to 250 Set piMinHeight to 250 End_Object Object oWebButton is a cWebButton Set piColumnSpan to 1 Set psCaption to "Next >>" Procedure OnClick //Send NextCard Send Show of oCard2 End_Procedure End_Object End_Object Object oCard2 is a cWebCard Set piColumnCount to 4 Set psCaption to "Card Two (comments)" Object oCustomer_Comments is a csfWebRichTextEditor //cWebEdit Set pbFillHeight to True Set Server to oCustomer_DD Entry_Item Customer.Comments Set pbNoFillIfHidden to False Set pbNoUpdateIfHidden to False Set piColumnSpan to 12 Set psLabel to "Comments" Set peLabelPosition to lpTop Set piHeight to 250 Set piMinHeight to 250 End_Object Object oWebButton is a cWebButton Set piColumnSpan to 1 Set psCaption to "Next >>" Procedure OnClick Send NextCard End_Procedure End_Object End_Object Object oCard3 is a cWebCard Set piColumnCount to 4 Set psCaption to "Card Three (footer)" Object oCustomer_Footer is a csfWebRichTextEditor Set pbFillHeight to True Set Server to oCustomer_DD Entry_Item Customer.Footer Set pbNoFillIfHidden to False Set pbNoUpdateIfHidden to False Set piColumnSpan to 12 Set psLabel to "Footer" Set peLabelPosition to lpTop Set piHeight to 250 Set piMinHeight to 250 End_Object Object oWebButton is a cWebButton Set piColumnSpan to 1 Set psCaption to "First >>" Procedure OnClick Send Show to oCard1 End_Procedure End_Object End_Object Procedure OnCardChange String sNewSelectedTab String sPrevSelectedTab Forward Send OnCardChange sNewSelectedTab sPrevSelectedTab /// If (Should_Save(oCustomer_DD)) Begin Send Request_Save of oCustomer_DD End // //Send Refind_Records of oCustomer_DD //Send Request_Assign of oCustomer_DD // End_Procedure 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 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