B4J Tutorial [BANanoWebix] Lesson 28 Suggestions

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

  1. Mashiane

    Mashiane Expert Licensed User


    There comes a time when you want suggestions on text, combos etc. The WixSuggest elements comes in handy, you feed it a list of data and map it to a control and wala, when keypressing on the element / selecting, a list of suggestions is available...

    Lesson28 Suggest.gif

    Here we create a form, add a textbox and a button and then link the suggestions.

    Dim sugg As WixSuggest
    'add to page
    We create the form, textbox and button and add those to the form. We also link the added button to a click event to return all form elements using .GetValues(formName).

    For .GetValues to work, all form elements in question should have a 'name' property.

    'create a form
        Dim form1 As WixForm
    'create a textbox
        Dim txt As WixTextBox = form1.Form.CreateTextBox("").SetName("country").SetLabel("Country").SetValue("Belarus").SetSuggest("suggest1")
    'create a callback
        Dim cb As BANanoObject = BANano.CallBack(Me, "clickit"Null)
    'create a button
        Dim btn As WixButton = form1.Form.CreateButton("").SetValue("Submit data").SetClick(cb)
        'add elements to form rows
    'add form to page
    'add to page
    We will be adding more of these .Create??? to the WixElement class to make it easier to add components.


    Get BANanoWebix
    joulongleu likes this.
  2. Mashiane

    Mashiane Expert Licensed User

    On the button click, we get the form values and message them out...

    Sub clickit
    'get the form data
        Dim formd As Map = pg.GetValues("form1")
    'display it
    End Sub
    One can use the form values to save to a db etc.
    joulongleu likes this.
  3. Mashiane

    Mashiane Expert Licensed User


    In this instance, we have defined a toolbar and added it to R2 of the page. We then added a richselect component on the toolbar and they ran .SetSuggest for the rich-select using the previously defined Suggest element.

    'create a toolbar
        Dim t As WixToolBar
        Dim rs As WixRichSelect
    'add to toolbar
        'add toolbar to page
    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