Wizard funtionality with local database for Visibility of containers doesnt work

Wizard funtionality with local database for Visibility of containers doesnt work

  

I try to implement a wizard on an app. For this I use 3 block elements for each wizard step. These blocks are in several containers. This containers are visible if a stepnumber have the value (1 until 3).

Each block contain a button for handle the client and server actions and increase the stepnumber at last. Because of the block element have no access to a locale variable of the screen I use a local database for a step number.

If the actions are done by clicking the button in the first block I increase the stepnumber in the aggregate and call the server-update method of the local database. Source is the current agregate with the increased stepnumber.

Increaseing the stepnumber in the aggregate is ok. But the stepnumber in the locale database is not updatted to visible the next container two..

When finish the action with loading the actual screen, the first block is displayed again. In the debugger I see that the stepnumber is 1. Not 2.  When finish the action with an end step, nothing is happen.

What is false? On which moments the containers know the current value of the stepnumber for deciding to visible or hidden the container?

Sorry when I have a mistake. I hope somebody can help me.


Kind regards 

Jens Lindner

Solution

Hi Jens,

I don´t know if I understand your scenario. But I will try to help you.  

Is only the local variable stepnumber you need pass to your blocks? If yes, you could do that including stepnumber as input parameter for those blocks, and set the OnParametersChange handler on each block to do the respective actions on them according the right step.

This is the first step. After that, you could create inside your block an event named IncreaseStep, for instance and when you click the button inside your block, you call this event.

In the parent where you call your blocks you can create a client side action, that increased your stepnumber local variable and set it as the handler for that event have you created for each blocks. 

So each block trigger the event internally and the parent will run the handler to increase stepnumber. As stepnumber is a input parameter for those blocks, they will run respectives parameterschange  handlers.

In this case will don´t need to keep a local storage neither call server actions.


Best regards

Fabio



Solution

Thank you Fabio for your quick reply. I think this could help me. I will try to adjust this in my app and give you a feedback.

@João: I use the Wizard from the Mobile Patterns from SILK UI Mobile.

Thank you :)

Hello Fabio,


I have reconstructed your solution proposal. And it works perfect. So I save also unnecessary local database or server actions.

Thanks a lot.

Kind regards Jens