dialog.showmodalWithin(Self) error

// Get the values from the TextFields
Var ID As String = ListBoxTemplates.CellTextAt(ListBoxTemplates.SelectedRowIndex,0)
Var dialog As New MessageDialog

// Use an DELETE statement
Var sql As String = “DELETE FROM Template WHERE ID = ?”
//Messageline.Text = ID

dialog.Message = “Do you want to delete this record?”
dialog.ActionButton.Caption = “Yes”
dialog.CancelButton.Visible = True
dialog.CancelButton.Caption = “No”

Var dialogButton As MessageDialogButton
dialogButton = dialog.ShowModalWithin(Self)

Error - Templates.ButtonDeleteTemplate.Pressed, line 15
Parameter “parent” expects class Window, but this is class Templates.Templates.
dialogButton = dialog.ShowModalWithin(Self)

I copy from the documentation and get error. Have no ideia what to do!

Try ShowModal instead. Passing the parent view makes it work like ShowModalWithin.

1 Like

It works now… tks a lot