B b4auser1 Well-Known Member Licensed User Longtime User Jan 21, 2014 #1 Is it possible to tell Reflector, which module holds the Sub, to be called after setting it in the SetOnClickListener ?
Is it possible to tell Reflector, which module holds the Sub, to be called after setting it in the SetOnClickListener ?
Erel B4X founder Staff member Licensed User Longtime User Jan 22, 2014 #2 Yes. This is the expected parameter: http://www.b4x.com/android/forum/threads/setonclicklistener.36951/ Upvote 0
Yes. This is the expected parameter: http://www.b4x.com/android/forum/threads/setonclicklistener.36951/
corwin42 Expert Licensed User Longtime User Jan 22, 2014 #3 Erel said: Yes. This is the expected parameter: http://www.b4x.com/android/forum/threads/setonclicklistener.36951/ Click to expand... The link seems to be wrong (links to this thread) Upvote 0
Erel said: Yes. This is the expected parameter: http://www.b4x.com/android/forum/threads/setonclicklistener.36951/ Click to expand... The link seems to be wrong (links to this thread)
Erel B4X founder Staff member Licensed User Longtime User Jan 22, 2014 #4 Oops. The descriptions can be seen here: http://www.b4x.com/search?query=Reflector.SetOnClickListener Upvote 0
Oops. The descriptions can be seen here: http://www.b4x.com/search?query=Reflector.SetOnClickListener
B b4auser1 Well-Known Member Licensed User Longtime User Jan 22, 2014 #5 Reflector.SetOnClickListener (sub As String) - has only one parameter sub As String. How to pass the name of module where the Sub is located ? Now As I can see the Sub has to be in the same module where SetOnClickListener (sub As String) is called. Upvote 0
Reflector.SetOnClickListener (sub As String) - has only one parameter sub As String. How to pass the name of module where the Sub is located ? Now As I can see the Sub has to be in the same module where SetOnClickListener (sub As String) is called.
stevel05 Expert Licensed User Longtime User Jan 22, 2014 #6 If you are using a class then the initialize sub would capture the module then you can use CallSub(module,sub) to redirect it. Upvote 0
If you are using a class then the initialize sub would capture the module then you can use CallSub(module,sub) to redirect it.
B b4auser1 Well-Known Member Licensed User Longtime User Jan 22, 2014 #7 stevel05, yes I used this approach, but wanted to know if it's possible to do the same directly with Reflector Code: Copy Dim r As Reflector r.Target = a_AB_btn r.SetOnClickListener("AB_btn_Click") Private Sub AB_btn_Click(ViewTag As Object) If SubExists (Module, ViewTag) Then CallSub(Module, ViewTag) End If End Sub Upvote 0
stevel05, yes I used this approach, but wanted to know if it's possible to do the same directly with Reflector Code: Copy Dim r As Reflector r.Target = a_AB_btn r.SetOnClickListener("AB_btn_Click") Private Sub AB_btn_Click(ViewTag As Object) If SubExists (Module, ViewTag) Then CallSub(Module, ViewTag) End If End Sub
stevel05 Expert Licensed User Longtime User Jan 23, 2014 #8 No, but the upside is there are times that you may want to pre-process the data or do something else such as hiding a view, before passing it to the module that calls it. Upvote 0
No, but the upside is there are times that you may want to pre-process the data or do something else such as hiding a view, before passing it to the module that calls it.