Android Question pass array in poststring

Chris Guanzon

Active Member
Licensed User
How to pass an array to postring? I have an xcustomlistview and I want to add the items in a poststring using okhttputils.

This is the string I'm going to use (I just added the string with array only):

B4X:
'APIConnection is httpjob

APIConnection.PostString($"${URL}${Path}"$, $"dependants=${this is where the array should be place}"$)

In my xcustomlistview, I have 5 textboxes in each row. How can I do this? And how to concatenate smart string? because the string I am going to use is too long. I want to cut it without using a new line.
 
Last edited:

cklester

Well-Known Member
Licensed User
Have you already got a way to parse the array on the other end? You might want to consider using JSON format to transfer that data.
 
Upvote 0

cklester

Well-Known Member
Licensed User
Well, a textbox will just be something like:

B4X:
    dim theText as String = myTextbox.Text

Do a search for JSON formatter and parser. I think that will make your life real easy.
 
Upvote 0

Chris Guanzon

Active Member
Licensed User
Well, a textbox will just be something like:

B4X:
    dim theText as String = myTextbox.Text

Do a search for JSON formatter and parser. I think that will make your life real easy.

what I meant is, how can I get the text in each textboxes (b4xfloattextfield) inside the customlistview's rows.
 
Upvote 0

cklester

Well-Known Member
Licensed User
Do a search for CustomListView (and maybe CLVSelections). There is complete information on both of those on this web site and forum, as well as comprehensive examples.

In part, you will do something like this:

B4X:
Sub clv_Categories_ItemClick (Index As Int, Value As Object)
    Dim ctl As String = clv_Categories.GetPanel(Index).GetView(0).Text

There is probably a better way to do it, but I'm in the beginning stages and refactoring comes later. šŸ˜
 
Upvote 0

Chris Guanzon

Active Member
Licensed User
Do a search for CustomListView (and maybe CLVSelections). There is complete information on both of those on this web site and forum, as well as comprehensive examples.

In part, you will do something like this:

B4X:
Sub clv_Categories_ItemClick (Index As Int, Value As Object)
    Dim ctl As String = clv_Categories.GetPanel(Index).GetView(0).Text

There is probably a better way to do it, but I'm in the beginning stages and refactoring comes later. šŸ˜

thanks, I found the solution here https://www.b4x.com/android/forum/threads/request-uri-too-long.66292/
and here https://www.b4x.com/android/forum/t...-here-from-clv-or-any-other-container.117992/
 
Upvote 0
Top