Android Question [SOLVED] xCustomListView - All list getting the .text in the textbox

Ertan

Active Member
Licensed User
Hi, I searched the forum but couldn't find a solution.
There is one xCustomListView, includes Textbox and Label.

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("Ex_Layout")
   
End Sub

Private Sub CreateItem(Mecet As String) As Panel
   
    Dim p As Panel
    p.Initialize("")
    p.Tag = "Tag"  ' add the tag to the Panel to find the right panel later

    Root.AddView(p,0, 0, 100%x,63dip)
    p.LoadLayout("Ex_Customview")
   
    Mecet_Text.Text = Mecet
   
    p.RemoveView
   
    Return p
End Sub

Private Sub Mecet_Add_Click
    CustomList.Add(CreateItem(MecetAracSayisi),ID)
End Sub

1650463791789.png

I add as many views as I want by clicking the Mecet_Add_Click button.
Naturally, more than one textbox is created in xCustomListView.

When I press any button on the layout except xCustomListView, I need to get all the "textbox.text" in this textbox.
How can I do that?
Thank you.

1650465018563.png


I want it to be like this, when Button1_Click, I want to get all the textbox data in the CustomList.
 
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
You need to get the text edit via the button you click:
B4X:
Private Sub Mecet_Add_Click
    Dim Mecet_Add as B4XView = Sender
    Dim YourTextBox as B4XView = Mecet_Add.Parent.GetView(0) 'put the layout index of your textbox here
    log(YourTextBox.text)
    CustomList.Add(CreateItem(MecetAracSayisi),ID)
End Sub
 
Upvote 0

Ertan

Active Member
Licensed User
So to understand, you add 20 times your layout with text edits to the xCLV?

Then you press the button at the bottom and want to have every text that is in the 20 items?
Yes, there is a button in the top right. When I press that button, it adds a textbox and label to the customlistview (label is unimportant) (I pressed it 20 items)

When I press Button1 at the bottom, I want to get textbox.text data in customlistview. (I'll take the item in 20 textboxes)
 
Upvote 0

Ertan

Active Member
Licensed User
It didn't work, I am preparing a sample project. It will be better on it.
Then my answer is correct:
B4X:
    For i = 0 To CustomListView1.Size -1
        Log(CustomListView1.GetPanel(i).GetView(0).Text) 'Put the index from the text edit in your layout to get the text
    Next
 
Upvote 0

Ertan

Active Member
Licensed User
Then my answer is correct:
B4X:
    For i = 0 To CustomListView1.Size -1
        Log(CustomListView1.GetPanel(i).GetView(0).Text) 'Put the index from the text edit in your layout to get the text
    Next
I have attached a sample project.
I tested it and the Textbox index number appears to be 0.

I want to get the textbox.text value of clv as much as I add it when pressing the bottom button.
Many thanks again.
 

Attachments

  • xclvtest.zip
    11.7 KB · Views: 75
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I want to get the textbox.text value of clv as much as I add it when pressing the bottom button.
I thought that Alexander gave you the list of labels text in his project. But, based on your question, if you want the list of all the edittext that were entered in the xCLV, you can use something like this:
B4X:
Private Sub Button1_Click
    For i = 0 To CustomList.Size -1
        Dim p As B4XView = CustomList.GetPanel(i)
        Log(p.GetView(0).GetView(0).Text)
    Next
End Sub
 
Upvote 0
Top