iOS Question do not work event of TabView (iUI8 lib)

Lakhtin_V

Active Member
Licensed User
Longtime User
It is not clear what you need to specify in the procedure tabview - tabview name or string of tag? In the examples, the string of tag and the name of the object are often written identically, this is even more confusing for beginners. Maybe there is a rule to write them identically?
B4X:
    TabView.Initialize("TabView",False)
     ....
     Sub TabView_SelectedChanged( i As Int, Cel As TableCell)
now not work
 

klaus

Expert
Licensed User
Longtime User
I suppose that your example code is referring the TableView object, which means that you have somewhere:
Private TabView As TableView.

There are no written rules for the naming.
In TabView.Initialize("TabView",False), the first parameter is the EventName given as a String, which is the generic name for the event routines of the view.
You can give it any name you want, but I use always the name of the view for the EventName, doing this I know which view the event routines belong to.
An exception is, when one event routine is called by different views of the same type, then I use a kind of generic name.
In that case you need the Sender object which holds the view that raised the event. And usual I use the Tag property to differentiate the sender views.
In your above example, if you had defined
TabView.Initialize("BlaBla",False),
then the event routine must have been
Sub BlaBla_SelectedChanged( i As Int, Cel As TableCell).
For the Tag property you can assign it any object, independant of the subject above.
 
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
Thanks for the detailed explanation, in this issue I found a mistake ... sory.
Previously, I confused the situation with the processing of events barbatonn
B4X:
Page1.Initialize("BlaBla")
.....
Private Sub Page1_BarButtonClick(Tag As String)
it is my work code
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…