E Enthousiastic Member Licensed User Longtime User Aug 4, 2025 #1 Hello , I want to create my own custom view that contains the TableView Class ( https://www.b4x.com/android/forum/threads/class-tableview-supports-tables-of-any-size.19254/#content ). For example its name is "MyCustomView". How can I call the click event from this new module with a command ? I need to re-declare the events in the new module at the beginning as " #Event: CellClick(col As Int, row As Int) " ? Many thanks Enthousiastic
Hello , I want to create my own custom view that contains the TableView Class ( https://www.b4x.com/android/forum/threads/class-tableview-supports-tables-of-any-size.19254/#content ). For example its name is "MyCustomView". How can I call the click event from this new module with a command ? I need to re-declare the events in the new module at the beginning as " #Event: CellClick(col As Int, row As Int) " ? Many thanks Enthousiastic
LucaMs Expert Licensed User Longtime User Aug 4, 2025 #2 In your MyCustomView class you have a TableView, for example: B4X: Private MyTableView As Table MyTableView.Initialize(Me, "MyTable", 5) Create the TableView events in your class, for example: B4X: Private Sub MyTable_CellClick(RowIndex As Int, ColIndex As Int) If xui.SubExists(mCallBack, mEventName & "_CellClick", 0) Then CallSubDelayed3(mCallBack, mEventName & "CellClick", RowIndex, ColIndex) End If End Sub [Note: not tested] Upvote 0
In your MyCustomView class you have a TableView, for example: B4X: Private MyTableView As Table MyTableView.Initialize(Me, "MyTable", 5) Create the TableView events in your class, for example: B4X: Private Sub MyTable_CellClick(RowIndex As Int, ColIndex As Int) If xui.SubExists(mCallBack, mEventName & "_CellClick", 0) Then CallSubDelayed3(mCallBack, mEventName & "CellClick", RowIndex, ColIndex) End If End Sub [Note: not tested]
DonManfred Expert Licensed User Longtime User Aug 5, 2025 #3 Enthousiastic said: How can I call the click event from this new module with a command ? Click to expand... You can´t as you can not set the SENDER by code. You can however create a method that can be called.But remember that that you can´t use the SENDER here. Upvote 0
Enthousiastic said: How can I call the click event from this new module with a command ? Click to expand... You can´t as you can not set the SENDER by code. You can however create a method that can be called.But remember that that you can´t use the SENDER here.
E Enthousiastic Member Licensed User Longtime User Aug 5, 2025 #4 Thank you for your direct response. I suppose the rest events is probably done the same way. ( CellLongClick , HeaderClick , HeaderLongClick , ScrollChanged , ShowRow ). You really are an incredible forum. Upvote 0
Thank you for your direct response. I suppose the rest events is probably done the same way. ( CellLongClick , HeaderClick , HeaderLongClick , ScrollChanged , ShowRow ). You really are an incredible forum.