Android Tutorial [B4X] B4XTable - Adding custom navigation buttons

Discussion in 'Tutorials & Examples' started by Erel, Feb 6, 2019.

Thread Status:
Not open for further replies.
  1. Erel

    Erel Administrator Staff Member Licensed User

    Depends on B4XTable v1.01+

    [​IMG]

    It is very simple to add your own navigation features.

    Code:
    Code:
    Sub btnNext_Click
       B4XTable1.CurrentPage = B4XTable1.CurrentPage + 
    1
    End Sub

    Sub btnPrev_Click
       B4XTable1.CurrentPage = B4XTable1.CurrentPage - 
    1
    End Sub

    Sub B4XTable1_DataUpdated
       btnNext.Enabled = B4XTable1.lblNext.Tag
       btnPrev.Enabled = B4XTable1.lblBack.Tag
    End Sub
    When the data is updated we check the state of lblNext and lblBack. The state is stored in the tag property.

    Related example with swipe gestures: https://www.b4x.com/android/forum/threads/tablepanel-adds-swipe-navigation-to-b4xtable.104628/
     

    Attached Files:

    Last edited: Apr 8, 2019
    koaunglay, Rusty, Cain Soft and 6 others like this.
  2. incendio

    incendio Well-Known Member Licensed User

    Error :
    1. File not found b4xinputtemplate.bal
    2. Unknown type b4xtablecolumn

    Library b4xTable 1.02
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    incendio likes this.
  4. Gabino A. de la Gala

    Gabino A. de la Gala Active Member Licensed User

    Are there any way to scroll between pages by gestures?

    I am thinking to use a scroll bar or something similar.

    Thanks.
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    B4XTable is based on a horizontal xCustomListView. It is not vertically scrollable.

    You can make all columns frozen and use GestureRecognizer to detect swipes.
     
    Gabino A. de la Gala likes this.
  6. Alexis Martial

    Alexis Martial Member Licensed User

    Hi Erel,

    I tried above suggestion, creating a GestureRecognizer.
    Issue is the GestureRecognizer does not get the event when I associate him with B4XTable.mBase, probably since each item in the table is in front.
    And if I associate the GestureRecognizer to the parent Panel/Activity, he also got the event only if started from outside the B4XTable area.

    Can give one more clue ? ;-)

    Thanks in advance
     
  7. Erel

    Erel Administrator Staff Member Licensed User

Thread Status:
Not open for further replies.
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