B4J Question b4xtable SearchField updated for 1st record

Discussion in 'B4J Questions' started by ykucuk, Jul 24, 2019.

  1. ykucuk

    ykucuk Well-Known Member Licensed User

    Hi,

    When i try searchfield on b4xtable just 1st row updated by the result and get the attached error.

    Screen Shot 2019-07-24 at 22.22.18.png

    is it a bug ?
    Screen Shot 2019-07-24 at 22.19.40.png
    I tried with my app and b4xtable example app. same result.

    Any help?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Please post the error message as text.

    What are the steps to reproduce? Are you running one of the examples?
     
  3. ykucuk

    ykucuk Well-Known Member Licensed User

    Hi Erel,

    I found out that it's caused by the custom button on the row cell.

    I added source code. Could you check, please ?
     

    Attached Files:

  4. Erel

    Erel Administrator Staff Member Licensed User

    The number of items in each row must match the number of columns. You need to go over the loaded data and copy it to an array with 5 elements.
     
  5. ykucuk

    ykucuk Well-Known Member Licensed User

    hi Erel,
    I'm not an expert. Could you send me an example or any tutorial because I really don't have an idea what to do?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Load the data.
    Create a new list.
    Go over each item in the original list and copy the items to a new array with 5 elements:
    Code:
    For Each row() As String In Data
     
    Dim NewRow(5As String
     NewRow(
    0) = row(0)
     ...
     NewData.Add(NewRow)
    Next
    B4XTable1.SetData(NewData)
     
  7. ykucuk

    ykucuk Well-Known Member Licensed User

    could you check what's wrong with my row?

    My Columns

    Code:
    SelectedColumn = B4XTable.AddColumn("Selected", B4XTable.COLUMN_TYPE_TEXT)
    NumberColumn = B4XTable.AddColumn(
    "HotelID", B4XTable.COLUMN_TYPE_TEXT)
    B4XTable.AddColumn(
    "Name", B4XTable.COLUMN_TYPE_TEXT)
    NumberColumn = B4XTable.AddColumn(
    "Rating", B4XTable.COLUMN_TYPE_TEXT)
    NumberColumn = B4XTable.AddColumn(
    "City", B4XTable.COLUMN_TYPE_TEXT)
    NumberColumn = B4XTable.AddColumn(
    "Phone", B4XTable.COLUMN_TYPE_TEXT)
    B4XTable.AddColumn(
    "PropertyType", B4XTable.COLUMN_TYPE_TEXT)
    ActionColumn = B4XTable.AddColumn(
    "Action", B4XTable.COLUMN_TYPE_TEXT)

    My rows
    Code:
    For Each colResults As Map In Results

    Dim row(8As Object

    row(
    0)=""

    row(
    1)=colResults.Get("HotelID")

    row(
    2) = colResults.Get("Name")

    row(
    3) = colResults.Get("Rating")

    row(
    4) = colResults.Get("Image")

    row(
    5) = colResults.Get("Phone1")

    row(
    6) = colResults.Get("PropertyType")

    row(
    7) = ""


    Data.Add(row)


    Next
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    I don't see how I can help you with the information you provided.
     
  9. ykucuk

    ykucuk Well-Known Member Licensed User

    I found what's the problem. it gives that error only cell value have "," inside and not come from a string variable.

    Could you check row with one cell inside "Istanbul, Ankara" and try a search on B4XTable. ?

    that's doesn't work. value came from JSON parser and included "," char
    doesntwork.png

    it works. the value set for a string variable

    works.png

    Value Column: PropertyType
     

    Attached Files:

    Last edited: Jul 25, 2019
  10. Erel

    Erel Administrator Staff Member Licensed User

    I'm sorry but you keep ignoring my requests. I cannot further help you.
     
  11. ykucuk

    ykucuk Well-Known Member Licensed User

    ok.
     
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