The sample code is incorrect in that it does not include the return value declarations for onTextEntered and onCancel so it does not comple.
Also, the return values are no explained. What does the system do with the return value? Why is there a return value?
https://developer.garmin.com/connect-iq/api-docs/Toybox/WatchUi/TextPicker.html
https://developer.garmin.com/connect-iq/api-docs/Toybox/WatchUi/TextPickerDelegate.html