H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jun 30, 2020 #1 I have clv containing labels inside another clv. clv --clv ----label1 ----label2 ----label3 ----label4 How can I retrieve label1,2,3,4 values triggered by label click event? * clv means customlistview
I have clv containing labels inside another clv. clv --clv ----label1 ----label2 ----label3 ----label4 How can I retrieve label1,2,3,4 values triggered by label click event? * clv means customlistview
Erel B4X founder Staff member Licensed User Longtime User Jun 30, 2020 #2 CLVs shouldn't be nested unless you are using CLVNested: https://www.b4x.com/android/forum/threads/107742/#content The standard way to get a custom view from the layout tree: [B4X] How to get <custom view here> from <CLV or any other container> However this will not work with CLV as it was implemented before this convention. You can do it yourself: B4X: pnl.LoadLayout(...) CLV.AsView.Tag = CLV This will allow you to get the CLV from the tag with something like: B4X: Dim clv As CustomListView = CLV1.GetPanel(x).GetView(0).Tag Upvote 0
CLVs shouldn't be nested unless you are using CLVNested: https://www.b4x.com/android/forum/threads/107742/#content The standard way to get a custom view from the layout tree: [B4X] How to get <custom view here> from <CLV or any other container> However this will not work with CLV as it was implemented before this convention. You can do it yourself: B4X: pnl.LoadLayout(...) CLV.AsView.Tag = CLV This will allow you to get the CLV from the tag with something like: B4X: Dim clv As CustomListView = CLV1.GetPanel(x).GetView(0).Tag
H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jun 30, 2020 #3 I added it simply & successfully clv inside clv, but the problem was how can I obtain labels inside! Erel said: CLVs shouldn't be nested unless you are using CLVNested: https://www.b4x.com/android/forum/threads/107742/#content Click to expand... I can't change clv to nestedclv because my project is large & already written, also it will be broken if changed! Erel said: This will allow you to get the CLV from the tag with something like: B4X: Dim clv As CustomListView = CLV1.GetPanel(x).GetView(0).Tag Click to expand... tested, not worked! Any suggestion please .. Upvote 0
I added it simply & successfully clv inside clv, but the problem was how can I obtain labels inside! Erel said: CLVs shouldn't be nested unless you are using CLVNested: https://www.b4x.com/android/forum/threads/107742/#content Click to expand... I can't change clv to nestedclv because my project is large & already written, also it will be broken if changed! Erel said: This will allow you to get the CLV from the tag with something like: B4X: Dim clv As CustomListView = CLV1.GetPanel(x).GetView(0).Tag Click to expand... tested, not worked! Any suggestion please ..
H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jun 30, 2020 #4 The sample code is attached Attachments clvinclv.zip 11.7 KB · Views: 325 Upvote 0
H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jul 1, 2020 #5 I have trying to use clvnested, the problem is that I want to add it inside tabstrip page, what parent view should be? B4X: nested.Initialize(??????) Upvote 0
I have trying to use clvnested, the problem is that I want to add it inside tabstrip page, what parent view should be? B4X: nested.Initialize(??????)
Erel B4X founder Staff member Licensed User Longtime User Jul 1, 2020 #6 B4X: CustomListView1.Add(pnl, CustomListViewchild) Dim clv As CustomListView = CustomListView1.GetValue(0) clv.GetPanel(0).GetView(0).GetView(0).Text = "aaa" Upvote 0
B4X: CustomListView1.Add(pnl, CustomListViewchild) Dim clv As CustomListView = CustomListView1.GetValue(0) clv.GetPanel(0).GetView(0).GetView(0).Text = "aaa"
H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jul 1, 2020 #7 Erel said: B4X: CustomListView1.Add(pnl, CustomListViewchild) Dim clv As CustomListView = CustomListView1.GetValue(0) clv.GetPanel(0).GetView(0).GetView(0).Text = "aaa" Click to expand... Can you implement it inside Label1_Click event "in example clvinclv.zip above" , to get the text of clicked label, please. I tried & failed! Upvote 0
Erel said: B4X: CustomListView1.Add(pnl, CustomListViewchild) Dim clv As CustomListView = CustomListView1.GetValue(0) clv.GetPanel(0).GetView(0).GetView(0).Text = "aaa" Click to expand... Can you implement it inside Label1_Click event "in example clvinclv.zip above" , to get the text of clicked label, please. I tried & failed!
Erel B4X founder Staff member Licensed User Longtime User Jul 1, 2020 #8 B4X: Dim lbl As B4XView = Sender Log(lbl.Text) Upvote 0
H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jul 1, 2020 #9 Erel said: B4X: Dim lbl As B4XView = Sender Log(lbl.Text) Click to expand... Great idea & my problem is solved by this trick and by using tag property. I know this trick is not related to clv inside clv, but it solved the problem. Thank you Upvote 0
Erel said: B4X: Dim lbl As B4XView = Sender Log(lbl.Text) Click to expand... Great idea & my problem is solved by this trick and by using tag property. I know this trick is not related to clv inside clv, but it solved the problem. Thank you