Chips can be used to represent small blocks of information. They are most commonly used either for contacts or for tags.
Dad
Mom
// create the chips Dim ch1 As ABMChip ch1.Initialize(page, "ch1", "Dad", False, "") page.Cell(2,1).AddComponent(ch1) Dim ch2 As ABMChip ch2.Initialize(page, "ch2", "Mom", False, "") page.Cell(2,1).AddComponent(ch2)
Chips can have a little prefix image representing some kind of contact chip.


// create the chips Dim ch3 As ABMChip ch3.Initialize(page, "ch3", "Dad", False, "") ch3.Image = "../images/dad.jpg" page.Cell(5,1).AddComponent(ch3) Dim ch4 As ABMChip ch4.Initialize(page, "ch4", "Mom", False, "") ch4.Image = "../images/mom.jpg" page.Cell(5,1).AddComponent(ch4)
To create chips that can be closed, just set the 'CanBeClosed' parameter = true in the Initialize method. Brother and Sister are chips that can be closed.




// create the chips // This time As Array so we can Catch the events in one method. // good practice Is using giving the 'Array' components just the numeric part of the ID. // That way you can use the Event Name As you would any other event. // e.g. here: 'mycheck' is the ArrayName, and '5', '6', '7', '8' are the IDs. // Now we can use mycheck_Clicked() And use the target To get our individual component Dim ch5 As ABMChip ch5.Initialize(page, "5", "Dad", False, "") ch5.Image = "../images/dad.jpg" page.Cell(8,1).AddArrayComponent(ch5, "mycheck") Dim ch6 As ABMChip ch6.Initialize(page, "6", "Mom", False, "") ch6.Image = "../images/mom.jpg" page.Cell(8,1).AddArrayComponent(ch6, "mycheck") Dim ch7 As ABMChip ch7.Initialize(page, "7", "Brother", True, "") ch7.Image = "../images/brother.jpg" page.Cell(8,1).AddArrayComponent(ch7, "mycheck") Dim ch8 As ABMChip ch8.Initialize(page, "8", "Sister", True, "") ch8.Image = "../images/sister.jpg" page.Cell(8,1).AddArrayComponent(ch8, "mycheck")
When the user clicks on a chip, the Clicked() event is raised. When the close button is clicked, the Closed() event is raised.
Sub mycheck_Clicked(Target As String) Dim chip As ABMChip = page.Component(8,1, Target) Dim title As String = chip.Text Dim myTexts, myReturns As List myTexts.Initialize myReturns.Initialize myToastId = myToastId + 1 page.ShowToast("toast" & myToastId, "toastgreen", "Clicked " & title, 5000, myTexts, myReturns) End Sub Sub mycheck_Closed(Target As String) Dim chip As ABMChip = page.Component(8,1, Target) Dim title As String = chip.Text Dim myTexts, myReturns As List myTexts.Initialize myReturns.Initialize myToastId = myToastId + 1 page.ShowToast("toast" & myToastId, "toastgreen", "Closed " & title, 5000, myTexts, myReturns) End Sub