B4J Question Cross platform Editable B4XTable (with data from sql query

Discussion in 'B4J Questions' started by afields, Jul 3, 2019.

  1. afields

    afields Member Licensed User

    hello to all. [ S O L V E D ]
    i'm using that very good tool not with data from a csv file but from a sql query.
    what i think that i must do:
    if i want to use those buttons ( like those Erel had used edit; copy; delete) in the first column of the b4xtable then my sql must have an extra field in that place like in
    original sql :
    Code:
    select abr_discip, tem,n_seq from tur_discip where concat(ano,turma)=?
    and sql for use in b4x editable table :
    Code:
    select "  " as empti, abr_discip, tem,n_seq from tur_discip where concat(ano,turma)=?
    .
    now it works as expected.
    but when i click edit's button in a table's line and the form open ( created first with formbuilder) i've got no data in the fields of the form like if it was a new insert and not an edit!
    Thank you
     
    Last edited: Jul 4, 2019
  2. Erel

    Erel Administrator Staff Member Licensed User

    The relevant code is in btnEdit_Click:
    Code:
    Dim Item As Map = B4XTable1.GetRow(RowId)
       ShowDialog(Item, RowId)
    The data that should be displayed is the Item map. The column names (ids) must much the preferences dialog keys. Otherwise they will not be set.
     
  3. afields

    afields Member Licensed User

    Thank you. Now it works like expeted!
     
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