B4J Question [ABMaterial] populate a combo box dynamically

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hi
I need to load the data of one combo dynamically after selecting a cell of another compo. I managed to intercept the event of the first combo and to populate the second, but it remains empty.
where am I wrong.

See image and code.

1
1588572101652.png


after select parent combo
1588572504198.png


B4J:
Private Sub parent_Clicked(itemId As String)
    
    Dim inp As ABMModalSheet = page.ModalSheet("inp")
    Dim module As ABMCombo =  inp.Content.Component("module")
    module.Clear
    
    ' add items
    Dim aListModules As List  = File.ReadList(File.DirApp, "modules.txt")
    
    Log("items = " & aListModules.Size)
    
    For i = 0 To aListModules.Size -1
        Dim arow As String =aListModules.get(i)
        Dim sep As String= arow.IndexOf("=")
        Dim aKey As String = arow.SubString2(0, sep)
        Dim aval As String = arow.SubString(sep+1)
        
        If aKey = itemId Then
            Log(aval)
            module.AddItem(aval  , aval, BuildSimpleItem("S" & (i+1), "mdi-action-dashboard", "{NBSP}{NBSP}" & aval ))
        End If
    Next
    
    
End Sub

in debug mode the code it ok.

Why?
thank



Thansk
 
Top