B4J Question [ABMaterial] Modal and combo bug

yiankos1

Well-Known Member
Licensed User
Longtime User
Hello,

On mobile devices when i scroll right the document in order to click a button from ABMTable and show a modal, then dropdown from combo is not shown correctly:
1738266347097.png

If i scroll document right just to see the green button then combo shows correctly. On all other dimensions shows correctly.

B4X:
Sub BuildSubscriptionModalSheet As ABMModalSheet
    Dim myModal As ABMModalSheet
    myModal.Initialize(page, "subscriptionModal", True, ABM.MODALSHEET_TYPE_NORMAL, "")
    myModal.Header.UseTheme("modalheader")
    myModal.Content.UseTheme("modalcontent")
    myModal.Footer.UseTheme("modalfooter")
    myModal.Size = ABM.MODALSHEET_SIZE_NORMAL
    myModal.IsDismissible = True
   
   
    myModal.Header.AddRowsM2(1,True,0,0,0,0,"").AddCells12(1,"center")
    myModal.Header.BuildGrid
   
    ' add paragraph
    Private lbl1 As ABMLabel
    lbl1.Initialize(page,"lbl1","Επεξεργασία συνδρομής",ABM.SIZE_H5,False,"lblwhite")
    myModal.Header.Cellr(0,1).AddComponent(lbl1)
   
    ' create the grid for the content
    myModal.Content.AddRowsM2(1,True,0,0,0,0,"").AddCellsOS(1,0,0,0,12,12,12,"")'.AddCellsOS(1,0,0,0,2,2,1,"center")'.AddCells12(2,"")'.AddCellsOS(2,0,0,0,12,12,6,"")
    myModal.Content.AddRowsM2(1,True,0,0,0,0,"").AddCellsOS(2,0,0,0,12,12,6,"")
    myModal.Content.AddRowsM2(2,True,0,0,0,0,"").AddCells12(1,"")
    myModal.Content.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
   
    Dim comboSubscriptions As ABMCombo
    comboSubscriptions.Initialize(page, "comboSubscriptions", "Επιλέξτε τύπο συνδρομής:", 300, "combo")
'    comboSubscriptions.InitializeWithSize(page,"comboSubscriptions", "Επιλέξτε τύπο συνδρομής:", 300,0,0,0,500,500,500,"combo")
    comboSubscriptions.IconName = "mdi-maps-local-atm"
    comboSubscriptions.WrongMessage = "Υποχρεωτική επιλογή τύπου συνδρομής"
    myModal.Content.Cellr(0,1).AddComponent(comboSubscriptions)
   
'    Dim btnEditSubs As ABMButton
'    btnEditSubs.InitializeFloating(page, "btnEditSubs", "mdi-editor-mode-edit", "adduser")
'    myModal.Content.Cellr(0,2).AddComponent(btnEditSubs)
   
    Dim etStart As ABMInput
    etStart.Initialize(page, "etStart", ABM.INPUT_DATE, "Ημερομηνία έναρξης συνδρομής", False, "searchuser")
    etStart.PlaceHolderText ="{NBSP}"
    etStart.Iconname = "mdi-notification-event-note"
    etStart.WrongMessage = "Υποχρεωτικό πεδίο"
    etStart.Text=DateTime.Date(DateTime.now)
    myModal.Content.Cellr(1,1).AddComponent(etStart)
   
    Dim etEnd As ABMInput
    etEnd.Initialize(page, "etEnd", ABM.INPUT_DATE, "Ημερομηνία λήξης συνδρομής", False, "searchuser")
    etEnd.PlaceHolderText ="{NBSP}"
    etEnd.Iconname = "mdi-notification-event-note"
'    etEnd.SetTooltip("Η ημερομηνία λήξης συνδρομής καθορίζεται αυτομάτα απο τον τύπο συνδρομής. Το πεδίο δεν είναι υποχρεωτικό να συμπληρωθεί.",ABM.TOOLTIP_RIGHT,0)
    myModal.Content.Cellr(0,2).AddComponent(etEnd)
   
    Private lblEnd As ABMLabel
    lblEnd.Initialize(page,"lblEnd","*Η ημερομηνία λήξης συνδρομής καθορίζεται αυτομάτα απο τον τύπο συνδρομής. Το πεδίο {B}{C:#FB8C00}δεν είναι υποχρεωτικό{/C}{/B} να συμπληρωθεί",ABM.SIZE_SMALL,True,"whitelbl")
    myModal.Content.Cellr(0,2).AddComponent(lblEnd)
   
    Dim etInfo As ABMInput
    etInfo.Initialize(page, "etInfo", ABM.INPUT_NUMBER, "Σημειώσεις", True, "searchuser")
    etInfo.Iconname = "mdi-action-speaker-notes"
    myModal.Content.Cellr(1,1).AddComponent(etInfo)
   
    Private lblLastAppointment As ABMLabel
    lblLastAppointment.Initialize(page,"lblLastAppointment","",ABM.SIZE_PARAGRAPH,True,"whitelbl")
    lblLastAppointment.IconName = "mdi-action-announcemen"
    lblLastAppointment.IconAlign = ABM.ICONALIGN_LEFT
    myModal.Content.Cellr(1,1).AddComponent(lblLastAppointment)

   
    ' create the grid for the footer
    ' we add a row without the default 20px padding so we need to use AddRowsM().


    myModal.Footer.AddRowsM2(1,True,0,0,0,0,"").AddCellsOS(1,0,0,6,6,6,3,"center").AddCellsOS(1,0,0,0,6,6,3,"center")
    myModal.Footer.BuildGrid ' IMPORTANT!

   
    ' create the buttons for the footer
    Dim btnAddClose As ABMButton
    btnAddClose.InitializeFlat(page, "btnSubClose", "", "", "ΚΛΕΙΣΙΜΟ", "adduser")
    myModal.Footer.Cellr(0,1).AddComponent(btnAddClose)
   
    ' create the buttons for the footer
    Dim btnAddSave As ABMButton
    btnAddSave.InitializeFlat(page, "btnSubSave", "", "", "ΑΠΟΘΗΚΕΥΣΗ", "action")
    myModal.Footer.Cellr(0,2).AddComponent(btnAddSave)

    Return myModal
End Sub

Sub buildCombo
   
    Private m As ABMModalSheet = page.ModalSheet("subscriptionModal")
    Private c As ABMCombo = m.Content.Component("comboSubscriptions")
   
    Private sql As SQL = DBM.GetSQL
    Try
        Private rs As ResultSet = sql.ExecQuery2("SELECT * from subscriptions WHERE id_gym = ? ORDER BY period ASC",Array(ws.Session.GetAttribute("id_gym")))
        Do While rs.NextRow
            c.AddItem(rs.GetString("id"), rs.GetString("name"), BuildSimpleItem(rs.GetString("id"), "", rs.GetString("name")))
        Loop
       
        rs.Close
       
        c.Refresh
    Catch
        page.ShowToast("buildcombo","toastorange",LastException.Message,2000,False)
        Log(LastException)
    End Try
    DBM.CloseSQL(sql)

End Sub
 
Last edited:
Top