Menu

BarButton bkBack OnClick

justapps
2013-09-03
2013-09-03
  • justapps

    justapps - 2013-09-03

    If you enter code in the OnClick of a BarButton of ButtonType bkBack, the code is not executed. I am figuring that this is by design but where would I enter code if I want it to be executed when the button is clicked?

     
  • Babak Yaghoobi

    Babak Yaghoobi - 2013-09-03

    Hi justapps

    The Back button is a iOS fixed button and we can't override click event on,
    If you want have a back button with click event use ButtonType = bkLeft.

    Regards

     
  • justapps

    justapps - 2013-09-03

    Thanks. That is a good way to work around it but the style is different. I am curious though how the back style button works in the Apple Notes app. Click the + to add a new note. Type something on the next screen. If you click the back button it appears that code has executed because you see the new note in the TableView. Are they doing something in a different event?

     
  • Fenistil

    Fenistil - 2013-09-03

    You can use the NavigationController.OnShowViewController event to do something on PageChange.

    Babak, just a note: It would be great if you can expand this event to have a parameter, the previous page that was displayed.

    So it would be:

    OnShowViewController = procedure( Sender: TObject; PreviousPage: TDPFNavigationControllerPage ) of object;
    

    With that we can solve problems like justapps' in a simple way, just check the PreviousPage and call the proper refresh, save or reload function.

    Thanks

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.