Android Question Totally Confused by 'Custom View' in CLV

james_sgp

Active Member
Licensed User
Longtime User
I have sent the last day reading and trying to get/set text into a AS_textfieldadvanced custom view I have in a xCLV. I have read the "b4x-how-to-get-custom-view-here-from-clv-or-any-other-container" post over and over...searched the forum and looked at code. But I really can not get my head around how to do this.

I`ve attached a simple program, with a CLV cotaining panels with AS_textfieldadvanced custom views and labels; to show I can get the values from stand views, but not the custom view.


Any help, greatly appreciated before I go crazy (and change everythin back to using standard views...hahaha). I apologies on behalf of my stupidity


James
 

Attachments

  • test1.zip
    12.2 KB · Views: 80

Alexander Stolte

Expert
Licensed User
Longtime User
You have added the following layout to the CustomListView:

And that's how you have to handle it:
B4X:
    For index = 0 To CustomListView1.Size - 1
        
        Dim Panel1 As B4XView = CustomListView1.GetPanel(index).GetView(0)
        Dim textField1 As AS_TextFieldAdvanced = Panel1.GetView(0).Tag
        Log(textField1.TextField.text)
        
    Next

If you call CustomListView1.GetPanel(index) then you dont have the first item from the layout, you get the base panel from the layout.
The panel on which you loaded the layout when you added it.
 

Attachments

  • test1.zip
    6.5 KB · Views: 85
Upvote 1
Cookies are required to use this site. You must accept them to continue using the site. Learn more…