B4J Tutorial [BANanoWebix] Creating Multi-Page Apps - Part 5

Discussion in 'B4J Tutorials' started by Mashiane, Jul 24, 2019.

  1. Mashiane

    Mashiane Expert Licensed User


    Download BANanoWebix Things

    Copy the 1.Libraries contents to your external b4j libraries folder. The project source code for this lesson is in BANanoWebixMultiPage

    Part 5 here closes this tutorial. This encompasses everything we have learned from Part 1 to Part 4 and some more.

    1. We create the backend for the clients table
    2. We create the front end for the clients table
    3. We add badges to indicate the number of clients we have everytime that changes
    4. We add print functionality so that we can print the grid.
    5. We load the combo boxes based on data stored in other tables.

    1. We create the backend BANanoSQL table for the clients we want to create...

    Dim newTable As Map = CreateMap()

    'initialize the helper class
        Dim alaSQL As BANanoAlaSQL
    'generate the create table sql
        Dim rs As AlaSQLResultSet = alaSQL.CreateTable("clients", newTable, "id")
    'execute the create table command
        rs.Result = ourclients.ExecuteWait(rs.query, rs.args)
    2. In modClients, we define code to add the clients page to the multi-view and we add this page to the master project.

    Sub AddToMultiView(pg As WixPage, mv As WixMultiView)
    Page = pg
    Dim dt1 As WixDataTable = CreateClientsDT
    Dim frm1 As WixForm = CreateClientForm
    Dim a As WixElement
    Dim r1 As WixElement
        Dim r2 As WixElement
    End Sub
    3. In the toolbar we have added, we have added a print button, this activates the printer and we are able to print the data-table.

    Sub printclients_click
    Dim wp As WixPrint
    "BANanoWebix Multi-Page App")
    End Sub
    This toolbar also shows an icon that has an updating badge. To update the badge, we get the total number of client records in the table and then update the badge..

    Dim tc As Int = rs.result.size
    Page.SetBadge("totalclients", tc)
    4. In edit mode and when a new client is being added, we refresh the positions and the cities combo boxes with records from the respective tables.

    Sub RefreshOptions
    Dim alasql As BANanoAlaSQL
    Dim rs As AlaSQLResultSet = alasql.SelectAll("positions"Array("id","value"), Array("value"))
        rs.Result = ourclients.ExecuteWait(rs.query, rs.args)
    Page.SetOptions("position", rs.result)
    Dim rs As AlaSQLResultSet = alasql.SelectAll("cities"Array("id","value"), Array("value"))
        rs.Result = ourclients.ExecuteWait(rs.query, rs.args)
    Page.SetOptions("city", rs.result)
    End Sub
    The rest of the crud functionality has been greatly discussed in Part 4.

    swamisantosh and joulongleu like this.
  2. swamisantosh

    swamisantosh Member Licensed User

    Excellent Work, can you provide are guide how to print selected column in the grid,
    Last edited: Jul 24, 2019
    Mashiane and joulongleu like this.
  3. Mashiane

    Mashiane Expert Licensed User

    I need to go back to the webix documentation and see if that is possible with time permitting...
  4. Mashiane

    Mashiane Expert Licensed User

    This is not possible!
    joulongleu likes this.
  5. Mashiane

    Mashiane Expert Licensed User

    joulongleu likes this.
  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