B4J Question [SithasoDaisy2] how to make modal from a "generic" module?

Gianni M

Well-Known Member
Licensed User
Longtime User
hi,
i have a module/page with banano.LoadLayout(app.PageViewer, "example");
in this module i run another modulo (no UI) named "TestDB.Bas" for check or update database,
question:
is it possible, from module "TestDB.BAS", to run another module (no UI) named "Modal.Bas" to display a modal form ? (SDUIModal)
 

Gianni M

Well-Known Member
Licensed User
Longtime User
did I make a mistake?
when modal is show, main page disappears
B4X:
'Static code module
Sub Process_Globals
    Public name As String = "testmailcellulare"
    Public page As SDUIPage
    Private mdl As SDUIModal
End Sub
'
Public Sub check
    Log("check")
    page.AddPage(Me, name)
    page.Root.p(6)
    page.Root.DesignMode(False)
    page.Root.MXAuto
    page.Root.AddRows5.AddColumns12
    page.Root.BuildGrid
    mdl = page.Root.AddModal("mdl", "demo", "Yes", "No", "Cancel", "500px")
    mdl.Message = "i am a modal"
    mdl.YesButton.NormalCase = True
    mdl.OverlayBGColorIntensity("transparent", "")
    mdl.Show
    Log("show")
End Sub
'
Private Sub mdl_Yes_Click (e As BANanoEvent)
    Log("yes")
    mdl.Hide
End Sub
 
Upvote 0

Gianni M

Well-Known Member
Licensed User
Longtime User
[solved] ??!!??!!
B4X:
'Static code module
Sub Process_Globals
    Public page As SDUIPage
    Private mdl As SDUIModal
End Sub
'
Private Sub mdl_Yes_Click (e As BANanoEvent)
    Log("yes")
    mdl.Hide
End Sub
'
Public Sub check (name As String) 'here name of parent module
    mdl.Initialize(Me, "mdl", "mdl")
    mdl.ParentID = name
    mdl.TitleCaption = "Anagrafica Azienda"
    mdl.TitleVisible = True
    'mdl.Width = "900px"
    mdl.YesCaption = "Sì"
    mdl.YesVisible = True
    mdl.NoCaption = "No"
    mdl.NoVisible = True
    mdl.CancelCaption = ""
    mdl.CancelVisible = False
    mdl.CloseAble = True
    mdl.Glass = False
    mdl.AddToParent(name, mdl.CustProps)
    mdl.Form.Clear
    mdl.Show
End Sub
 
Upvote 0
Top