AddHandler/RemoveHandler MobileTableCustomCell Questions

Hi

I want to send a button action in a custom cell to the parent screen and I am using AddHandler to do so (in the RowData method).

Since the cells can be reused, is there a problem trying to apply AddHandler more than once (and catching the error using “Try”)? Or is the re a better approach I should use?

Also, can anyone suggest how to RemoveHandler afterwards?

Thanks for any help

Chris

I’m usually using delegates in custom table cells to call a method on the parent screen.

Thanks very much Christoph. It sounds like I should be doing this but I actually don’t know how to do it :face_with_open_eyes_and_hand_over_mouth: Any chance you’d have a link or example that would help me understand how’s it’s implemented? - Thanks again!

Hi Chris,

this is a quick example. You can use delegates with or without parameters. This example project has both.

It took me a while to understand the concept of delegates but I now have all the data processings on the MobileScreens and none of it on the custom table cells any more. Good luck :blush:

https://www.amazon.de/clouddrive/share/UraHmmgJIkCm8CrACCmR0v11XxjfTA5Qf1xldo3jhKl

2 Likes

Terrific! I really appreciate you taking the time to do this for me Christoph :slight_smile: I haven’t used delegates in this way at all before. I’m programming in Xojo since it was called RealBASIC and I’m still a newbie! :roll_eyes: Thanks again!

1 Like