B Brad Henderson Member Licensed User May 21, 2019 #1 I am new to B4A but am loving it so far. I'm stuck on trying to find which scrollview has issued the cell_click event. I have 5 scrollviews(with 3 columns) and when any item in any of the scrollviews is clicked I assign a label to the sender. While label.text gives me the contents of that cell I can't find a way to get the name of the scrollview that was clicked. Any help is greatly appreciated Brad
I am new to B4A but am loving it so far. I'm stuck on trying to find which scrollview has issued the cell_click event. I have 5 scrollviews(with 3 columns) and when any item in any of the scrollviews is clicked I assign a label to the sender. While label.text gives me the contents of that cell I can't find a way to get the name of the scrollview that was clicked. Any help is greatly appreciated Brad
S sorex Expert Licensed User Longtime User May 21, 2019 #2 you should enter a value in the tag element of the scrollview. then in your label click event you could try something like Code: Dim l As Label=Sender log(l.Parent.Tag) as it is a scrollview you might need to add the tag value to the inner panel. you'll need to test that so it might be this if added to the scrollview itself Code: l.Parent.Parent.Tag Last edited: May 21, 2019 Upvote 0
you should enter a value in the tag element of the scrollview. then in your label click event you could try something like Code: Dim l As Label=Sender log(l.Parent.Tag) as it is a scrollview you might need to add the tag value to the inner panel. you'll need to test that so it might be this if added to the scrollview itself Code: l.Parent.Parent.Tag
Erel B4X founder Staff member Licensed User Longtime User May 21, 2019 #4 Tip: you should probably use xCustomListView instead of ScrollView. Upvote 0
B Brad Henderson Member Licensed User May 22, 2019 #5 Thanks Erel I will have another look at xCustomListView. As an aside I am trying to adapt the TableExample that places a table in a panel within the scrollview. Almost at where I want it, but just can't find a way to determine from which table/panel/scrollview the cell_click event was initiated. Upvote 0
Thanks Erel I will have another look at xCustomListView. As an aside I am trying to adapt the TableExample that places a table in a panel within the scrollview. Almost at where I want it, but just can't find a way to determine from which table/panel/scrollview the cell_click event was initiated.
B Brad Henderson Member Licensed User May 22, 2019 #6 Erel, What I am trying to achieve is to display a week of appointments for customers showing 5 separate "views" for each day. Each day will need to be scrollable to fit onto the tablet with landscape view. When these 5 days of appointments are displayed I want to click/tap on one particular entry/customer and start a new activity displaying that customers details. This data is coming from a sqlite database. Do you think the xCustomlistView is the appropriate resource for this? Thanks again Brad Upvote 0
Erel, What I am trying to achieve is to display a week of appointments for customers showing 5 separate "views" for each day. Each day will need to be scrollable to fit onto the tablet with landscape view. When these 5 days of appointments are displayed I want to click/tap on one particular entry/customer and start a new activity displaying that customers details. This data is coming from a sqlite database. Do you think the xCustomlistView is the appropriate resource for this? Thanks again Brad
Erel B4X founder Staff member Licensed User Longtime User May 22, 2019 #7 I'm not sure that I understand the required layout. Do you need it to be scrollable both horizontally and vertically? If so then search for ScrollView2D. Upvote 0
I'm not sure that I understand the required layout. Do you need it to be scrollable both horizontally and vertically? If so then search for ScrollView2D.
B Brad Henderson Member Licensed User May 22, 2019 #8 Thanks Erel Just need to scroll vertical on each of the five views. Will look into scrollview2D and xCustomListView Upvote 0
Thanks Erel Just need to scroll vertical on each of the five views. Will look into scrollview2D and xCustomListView