How to call a back button event?

back button

Well, I am not talking about this. This is useful when the user manually presses the back button.

I want something that helps me to call a back button event.

Reason: I have two screens. Screen one has some dynamic blocks that get set On-screen initialisation event. after clicking the dynamic block, I get to screen 2. Now for some reason, say, screen 2 has no data available then I want to go back to screen 1 automatically.

But If I use to open another screen to go back to Screen 1, then Screen 1 initialises and takes time to Re - set the dynamic blocks.

I can skip this, if I manually press the back button, then I get the Screen1, as it was set before going to screen2.

It saves time.

So please guide me for this.

Do let me know if there any alternate solution to skip the initialization of screen when we use this block. controls_openAnotherScreen

Thank you. :slight_smile:

Using Only 1 Screen.
And Having Arrangements as Virtual Screen.
And Switching between Visibility of different Arrangements / Virtual Screens.

1 Like

If you don’t close your Screen1 before switching to Screen2, you can just close Screen2 and you will fall back to Screen1.

4 Likes

In your case you can do when dynamic block click, call only OpenScreen2 only instead of CloseScreen1

Yes. I am not closing screen1.

I am just looking for something so that I can call back button press event.

On Screen2 initalize: if “no data available” close Screen2.

1 Like

Of course use if then else block along with Back Button press.

Then You Should Use The Close Screen Block…

1 Like

Thank you for your interest. But you are not getting what I have asked for. I dont want to use “Back Pressed” for manual back button touch event.

I want some kind of automation to call this back pressed block.

component_method
Something like this. So that I can directly call back press.

Can You Show Your Blocks! :slightly_smiling_face:

Someone will help you.

Then I think you should use two vertical arrangements(VA) representing two screens, Screen1 and Screen2 respectively.
After this when the app initializes for the first time, make Screen1 VA visible and create whatever dynamic block you want.

Then on the click of that dynamic block(as you said in op), do following things :point_down:

  1. Just hide the Screen1 VA and make Screen 2 VA visible where you are displaying the data.

  2. Now with the help of if....then statement, first check if Screen2 VA is visible. If true, then under the then condition check if your data is available.
    If the data is available do whatever you want further, else if data not available then just hide Screen2 VA, and make Screen1 VA visible.

In this way the screen initialization event will not be triggered and will not consume/take :point_down:

Note:- I have not tried this and is provided just to help you. Do let me know what the status is after you apply this method

1 Like