B4J Question [ABMaterial] Dismissed ModalSheet blocking webapp

amminf

Active Member
Licensed User
Longtime User
Dismissed ModalSheet blocking webapp running on tablet.
Trying close dismissed modalsheet then close modalsheet but blocking webapp and page remains black... does not obtain focus.

ABMaterial v2.17
Android 6.0.1 on Samsung Galaxy Tab
 

mindful

Active Member
Licensed User
Hi amminf. For someone to help you with your problem you need to post relevant code (creation of the modal sheet, closing the modal sheet, etc.) I have a dissmissable modal sheet and it works correctly on all devices (as it closes an the black overlay is gone) so you need to provide more information about your problem.
 
Upvote 0

amminf

Active Member
Licensed User
Longtime User
mindful,

Thks for your answer.

My sample, real code:

B4X:
Sub buildMuestraFoto() As ABMModalSheet
    Dim sheet As ABMModalSheet
    sheet.Initialize(page, "SheetMuestraFoto", False, False, "")
    sheet.IsDismissible = True
  
    sheet.Content.AddRows(15,True, "").AddCells12(1,"")
    sheet.Content.BuildGrid
  
    Dim image As ABMImage
    image.Initialize(page, "img1", "", 1)
    image.IsResponsive=True
    image.IsMaterialBoxed=True
    sheet.Content.Cell(2,1).AddComponent(image)  
  

    Return sheet
End Sub

Sub MuestraFoto(cFileFull As String)

       
        Dim sheet As ABMModalSheet
        sheet = page.ModalSheet("SheetMuestraFoto")
        Dim image As ABMImage = sheet.Content.Component("img1")
      
        image.Source = cFileFull
      
        image.Refresh
    
         
        page.ShowModalSheet("SheetMuestraFoto")  
   

End Sub
 
Upvote 0

amminf

Active Member
Licensed User
Longtime User
"Where do you call the buildMuestraFoto() method? It should be in BuildPage(), not ConnectPage()."
In BuildPage


Buildpage() code. Calling buildMuestraFoto()
B4X:
' Ver tb. 1: LoadTableDocumentos
' Ver tb. 2: LoadArticulosTable
public Sub BuildPage()
    ' initialize the theme
    BuildTheme
   
  
    ' initialize this page using our theme
    page.InitializeWithTheme(Name, "/ws/" & AppName & "/" & Name, False, ABMShared.SessionMaxInactiveIntervalSeconds, theme)
    page.ShowLoader=True

    ' SPECIAL ONE, we're going to add chips later for the zip attachments, but not in the build
    ' however, we want all javascript code and css code to be loaded.
    ' Note: in case you add chips in BuildPage() this is done automatically by ABMaterial   
'    page.NeedsChips = True    
'    page.PageTitle = "ABMFeedback"
'    page.PageDescription = "Feedback App for the ABMaterial Framework for B4J"   
    page.PageTitle = "Pedidos"
    page.PageDescription = "Consulta de Pedidos"   
    page.PageHTMLName = "index.html"
    page.PageKeywords = ""
    page.PageSiteMapPriority = ""
    page.PageSiteMapFrequency = ABM.SITEMAP_FREQ_YEARLY
   
   
    'page.DisableBackButton = True
    page.ShowConnectedIndicator = True
       
  
       

    ABMShared.BuildNavigationBar(page, "Consulta de Pedidos", "../images/logo.png", "Cases", "", "")
       
    ' create the page grid
    page.AddRowsM(2,True,0,0, "").AddCells12(1,"")   
    page.AddRows(1,True, "").AddCellsOS(1,0,0,0,6,6,8,"").AddCellsOS(1,0,0,0,4,4,2,"").AddCellsOSMP(1,0,0,0,2,2,1,14,0,0,0,"")
    page.AddRows(4,True, "").AddCells12(1,"")   
    page.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
   
    ' add a modal sheet template to enter user information
    'page.AddModalSheetTemplate(BuildInputSheet)
   
    Log("antes carga 1")
    page.AddModalSheetTemplate(BuildEdicionCabDoc(True))
    If ABMShared.lDocumentoConFolder = False Then  '// AMM Al 01/08/2016
        Log("antes carga 2")
        page.AddModalSheetTemplate(BuildEdicionCabDoc(False))   
    End If
    Log("fin carga")
    page.AddModalSheetTemplate(BuildEdicionArticulo)
   
       
    ' add a modal sheet template for a yes no msgbox
    page.AddModalSheetTemplate(BuildMsgBoxYesNo)
    ' add a modal sheet template for a  msgbox
    page.AddModalSheetTemplate(BuildMsgBox)
   
   
   
    page.AddModalSheetTemplate(BuildBusca)
    page.AddModalSheetTemplate(BuildFrmCliArt)
   
    page.AddModalSheetTemplate(buildMuestraFoto)
   
    page.AddModalSheetTemplate( ABMShared.BuildVisorPdf(page) )
   
    #Region comun_todas_paginas_1
   
        page.AddModalSheetTemplate( ABMShared.BuildSelectorClientes(page) )   
       
    #end region
   
   
   
    ' add paragraph   
    'page.CellR(1,1).AddComponent(ABMShared.BuildParagraphBQ(page,"par1","Before submitting a new case, please check if it is not in the Feedback already!") )
   
    page.CellR(1,1).AddComponent(ABMShared.BuildParagraphBQ(page,"par1","Pulse sobre la cabecera de las columnas para ordenar ascendente / descendentemente") )


    'If ABMShared.lAplClienteDirecto = False Then
    If True Then
        Dim searchCase As ABMInput
        ''searchCase.Initialize(page, "searchCase", ABM.INPUT_TEXT, "Search case", False, "lightblue")
        'searchCase.Initialize(page, "searchCase", ABM.INPUT_TEXT, "Búsqueda por nombre de cliente", False, "lightblue")
        searchCase.Initialize(page, "searchCase", ABM.INPUT_TEXT, "Referencia", False, "lightblue")
       
        page.CellR(1,1).AddComponent(searchCase)   
    Else
        ' Pongo un label por poner algo para el grid de de la pagina
        Dim xsearchCase As ABMLabel
        xsearchCase.Initialize(page, "xid", ".", ABM.SIZE_H6, True, "")
        page.CellR(1,1).AddComponent(xsearchCase)       
    End If
   
   
    Dim casestatussearch As ABMCombo
    'casestatussearch.Initialize(page, "casestatussearch", "Status", 650 , "lightblue")   
    casestatussearch.Initialize(page, "casestatussearch", "Estado", 650 , "lightblue")   
   
    ' add items
    ''casestatussearch.AddItem("statsearchmycases", "My cases", BuildSimpleItem("SSTMC", "mdi-action-account-box", "{NBSP}{NBSP}My cases"))


    casestatussearch.AddItem("statsearch0", "Grabado"    , BuildSimpleItem("SST0", "mdi-image-filter-1", "{NBSP}{NBSP}Grabado"    ))
    casestatussearch.AddItem("statsearch1", "Gestionado" , BuildSimpleItem("SST2", "mdi-image-filter-2", "{NBSP}{NBSP}Gestionado" ))
    casestatussearch.AddItem("statsearch2", "Preparación", BuildSimpleItem("SST3", "mdi-image-filter-3", "{NBSP}{NBSP}Preparación"))
    casestatussearch.AddItem("statsearch3", "Preparado"  , BuildSimpleItem("SST1", "mdi-image-filter-4", "{NBSP}{NBSP}Preparado"  ))   
    casestatussearch.AddItem("statsearch4", "Enviado"    , BuildSimpleItem("SST4", "mdi-image-filter-5", "{NBSP}{NBSP}Enviado  "  ))


    casestatussearch.SetActiveItemId("statsearch")
   
   
   
   
    page.CellR(0,2).AddComponent(casestatussearch)
   
   
    Dim lBotonBuscar As Boolean = True '''''''''''''''''''''''''''''''''''''''''''''''False   ' Ahora busca al pulsar en el combo
   
    If lBotonBuscar Then
        Dim btnSearch As ABMButton
        btnSearch.InitializeFloating(page, "btnSearch", "mdi-action-search", "")
        page.CellR(0,3).AddComponent(btnSearch)
    End If
   
       
    If lTableScrollableCabDoc = False Then
        Dim pagination As ABMPagination
        pagination.Initialize(page, "pagination", 10, True, True, "")
        pagination.SetTotalNumberOfPages(20)
       
        page.CellR(1,1).AddComponent(pagination)
    End If
   
    ' create a table
    Dim tblCases As ABMTable
    If lTableScrollableCabDoc = False Then
        tblCases.IsResponsive = True
    End If
   
   
   
   
    If lTableScrollableCabDoc = False Then
        tblCases.Initialize(page, "tblCabDoc", True, True, True, "tbltheme")
    End If
    Dim lstWidths As List
   
    'tblCases.
   
    Dim lMostrarObservaciones As Boolean = ABMShared.lModoDistribuidor = False
    Dim cLeyeObservac As String = "Observaciones"
    Dim nSizeObservac As Int   
    Dim nSum As Int = 0
   
    If ABMShared.lAplClienteDirecto = False Then
        ' Esto de aqui abajo no sirve: cuando sea distribuidor SIEMPRE sera SI cliente directo.
        nSizeObservac      = 20  '30
        If lMostrarObservaciones = False Then
            cLeyeObservac = ""
            nSizeObservac = 0
            nSum          = 100
        End If
        ' 08/09/16. A este le falta borrador y factura
      
        tblCases.SetHeaders(         Array As String ("ID" , "Referencia", "Estado"    , ""           , "Nº Pedido", "Borrador", "Fecha Pedido"    , "Cód. Centro"     , "Nombre Centro"    , "Nombre Comercial", "Total Pedido", cLeyeObservac  , "Editar"   , "Impri."  ,  "Borrar", "Factura"  ))                   
        tblCases.SetHeaderThemes(    Array As String ("bg" , "bg"        , "bg"        , "bg"         , "bg"       , "bgc2"    , "bg"              , "bg"              , "bg"              , "bg"              , "bg"          , "bg"           ,"bgc"       , "bgc"     ,  "bgc"   , "bgc"      ))
        tblCases.SetHeaderHeights(   Array As Int    (0    , 0           , 0           , 0            , 0          , 48        , 0                 , 0                 , 0                 , 0                 , 0             , 0              , 48         , 48        ,  48      , 48         ))
        ' Modificar tb. TableDocumentos_1
        ' Modificar tb. AQUI_5
        tblCases.SetColumnVisible(   Array As Boolean(False, True        , True        , True         , True       , True      , True              , True              , True              , True              , True          , True           , True       , True      ,  True    , True       ))
        tblCases.SetColumnSortable(  Array As Boolean(False, True        , True        , True         , True       , False     , True              , True              , True              , True              , True          , False          ,False       , False     ,  False   , False      ))
        tblCases.SetColumnDataFields(Array As String (""   , "speped"    , "staped"    , ""           ,  "numped"  , "brrped"  , "fecped"          , "cliped"          , "nclped"          , "estped"          , "totped"      , "ob1ped"       ,""          , ""        ,  ""      , "numfacped"))
       
        lstWidths =                  Array As Int    (0    , 100          , 50          , 90          , 80         , 70        , 110               , 100               , 200               , 200                , 140          , nSizeObservac  ,60          , 60        ,  60      , 60          )   
    Else
       
       
        nSizeObservac      = 350
        If lMostrarObservaciones = False Then
            cLeyeObservac = ""
            nSizeObservac = 0   
            nSum          = 10 ' 60
        End If
       
       
        Dim nMargen As Int = 0 ''''200  ' Para que salga bien cuando ABMShared.lAplClienteDirecto = False pq aqui parece se reserva el espacio (carga estatica)
       
       
        tblCases.SetHeaders(         Array As String ("ID" , "Referencia", "Estado"    , ""    , "Nº Pedido", "Borrador" , "Fecha Pedido"                                            , "Total Pedido", cLeyeObservac  , "Editar"   , "Imprimir", "Borrar", "Factura"  ))
        tblCases.SetHeaderThemes(    Array As String ("bg" , "bg"        , "bg"        , "bg"  , "bg"       , "bgc2"     , "bg"                                                      , "bg"          , "bg"           ,"bgc"       , "bgc"     , "bgc"   , "bgc"      ))
        tblCases.SetHeaderHeights(   Array As Int    (0    , 0           , 0           , 0     , 0          , 48         , 0                                                         , 0             , 0              , 48         , 48        , 48      , 48         ))
        ' Modificar tb. TableDocumentos_1
        ' Modificar tb. AQUI_5
        tblCases.SetColumnVisible(   Array As Boolean(False, True        , True        , True  , True       , True       , True                                                      , True          , True           , True       , True      , True    , True       ))
        tblCases.SetColumnSortable(  Array As Boolean(False, True        , True        , True  , True       , False      , True                                                      , True          , False          ,False       , False     , False   , False      ))
        tblCases.SetColumnDataFields(Array As String (""   , "speped"    , "staped"    , ""    , "numped"   , "brrped"   , "fecped"                                                  ,"totped"       , "ob1ped"       ,""          , ""        , ""      , "numfacped"))
       
        lstWidths =                  Array As Int    (0    , 100          , 60          , 100  , 150+ nSum  , 100        , 150+ nSum                                                 , 150+ nSum     , nSizeObservac  ,150         , 150       , 150     , 150+ nMargen         )   
    End If
   
    If lTableScrollableCabDoc Then
       
       
        tblCases.InitializeScrollable(page, "tblCabDoc", True, True, True, lstWidths, "tbltheme")
       
       
        'tblCases.Initialize(page, "tblCabDoc", True, True, True, "tbltheme")
    End If
       
    tblCases.SetFooter("Total número de pedidos: 0", 10,"bg")


    If lTableScrollableCabDoc Then
       
        ''page.Cell(5,1).SetFixedHeight(360)
        page.CellR(1,1).SetFixedHeight(650)           ' Ver SetFixedHeight_1
       


       
       
        page.Cell(page.CurrentRow, 1).AddComponent(tblCases)
    Else
        page.CellR(1,1).AddComponent(tblCases)
    End If
   
    'If ABMShared.lAplClienteDirecto    Then ' AMM Al 20/10/16
        ' create the action button
        Dim AddCaseBtn As ABMActionButton
        AddCaseBtn.Initialize(page, "btnAddDocumento", "mdi-content-add", "bigblue", "")
        AddCaseBtn.MainButton.Size = ABM.BUTTONSIZE_LARGE
       
        ' add to page
        page.AddActionButton(AddCaseBtn)   
    'End If
End Sub


Initialize Method. Calling BuildPage()
B4X:
Public Sub Initialize
    ' build the local structure IMPORTANT!
   
    BuildPage
End Sub
 
Upvote 0

amminf

Active Member
Licensed User
Longtime User
Trying now on Smartphone Android 4.4.2

Stock browser: modelsheet is closed ok
Chrome: hang app (fail)

When fail, it call to Page_ModalSheetDismissed(). Last text in log is SheetMuestraFoto
 
Upvote 0

amminf

Active Member
Licensed User
Longtime User
In summary:

Trying close dismissed modalsheet:

Smartphone Android 4.4.2:
Stock browser: modelsheet is closed ok
Chrome: fail

Android 6.0.1 on Samsung Galaxy Tab
Stock browser: fail
Chrome: fail
 
Upvote 0
Top