B4J Tutorial [BANanoWebix] Lesson 10 Lists

Discussion in 'B4J Tutorials' started by Mashiane, Jun 25, 2019.

  1. Mashiane

    Mashiane Expert Licensed User

    Ola

    Lesson10_List.gif

    Here we demonstrate how we can have a list with a pager linked to it and we animate the list.

    First we create a pager element and give it a unique id with the size to show being 10 records. We add this to our page..

    Code:
    Private pgr As WixPager
        pgr.Initialize(
    "moviepager").SetAnimate(True).SetSize(10)
        R2.AddColumnsItem(pgr.Item)
    We use the dummy data generator we saw in UOENow to generate about 50 records and add these to the list.

    Code:
    'lets create dummy data
        Dim dummy As UOENowData
        dummy.Initialize
        
    Dim structure As Map = CreateMap()
        structure.Put(
    "id""id")
        structure.Put(
    "rank""id")
        structure.Put(
    "title""name")
        structure.Put(
    "year""year")
        
    Dim big_film_set As List = dummy.GetRecordsWithStructure(structure, 50)
        
    '
        Dim fList As WixList
        fList.Initialize(
    "fList").SetWidth(500).SetHeight(360).SetBorderLess(False)
        fList.SetTemplate(
    "#rank#. #title# (#year#)").SetSelect(True)
        fList.SetScroll(
    False).SetPager("moviepager").SetData(big_film_set)
        
    '
        R3.AddColumnsItem(fList.item)
    We have provided the template for our data to be rank, title and year. We enable selection because we want to trap each select call to the item selected. Then we set the pager to link the pager to the list giving that the pager name.

    We add the list to our page.
     
    joulongleu and Johan Schoeman like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice