B4J Question b4xtable SearchField updated for 1st record

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?
 

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?
 

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.
 

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?
 

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:
B4X:
For Each row() As String In Data
 Dim NewRow(5) As String
 NewRow(0) = row(0)
 ...
 NewData.Add(NewRow)
Next
B4XTable1.SetData(NewData)
 

ykucuk

Well-Known Member
Licensed User
could you check what's wrong with my row?

My Columns

B4X:
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
B4X:
For Each colResults As Map In Results

Dim row(8) As 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
 

Erel

Administrator
Staff member
Licensed User
I don't see how I can help you with the information you provided.
 

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
 

Attachments

Last edited:

Erel

Administrator
Staff member
Licensed User
I'm sorry but you keep ignoring my requests. I cannot further help you.
 
Top