Opening a view and getting data from it


John Clarke
I have a question regarding views.  If I have two views (lets call them View A and View B) and View A opens View B How can View A get values from the data entry boxes on View B when the user presses the close button ?How can I get View B to completely cover View A when it opens ? 

DecSoft

Hello John,

Supose we have an Input1 control in View B. Then, even from View A, we can get the value of that control in the variable [Input1.Value].

On the other hand, I supose that you are showing View B with the ShowDialog action. If so, certainly the View B don't fit all the screen (this is how dialogs or modal views works), however, the user can't reach the View A until the View B are opened.

However, if you wanted that the View B occupy the space of the View A, then you can / must use actions like ShowView and ReplaceView, instead of the ShowDialog action.



John Clarke

I have a number of questions :

1. How can I show a view using pure Javascript?

2. have just tried something. In my first view I have a button, the code for that button is

In my second view I have another button. The code for this is :

The AlertBox function isn't working when I press the button on the first view (It only works when I comment out the ShowView "View2").


DecSoft

Hello John,

About the first question, if you need to use pure Javascript to shown a view, you can do in this way:

About your second question, you describe the expected result. When we shown another view, the DOM of the previously one is removed, and, therefore, actions like AlertBox can't work like you expected.

Depend on what you want to do, you can do one or other thing. For example, if you try with the Alert action, you can see that, in this case, the alert is shown as you expected. But may you can also take other approach... depend on what you wanted...



Tinn Aphopchung
I think,if use variable to store data before view change can resolve this problem too.

DecSoft

Hello to all,

I think, if use variable to store data before view change can resolve this problem too.

The fact is that... what is the problem? :-) Because I think this is not a problem, but, the expected behaviour. Supose you want to alert the user before change to another view... well... you can do it... for example, you can use an MessageBox, and, only if the user press the Ok button (for example), you proceed with the view change, and, not in other case.

But I am only place here an "possible scenario"... and an possible "approach"... depend on what we wanted we can do one thing or another, but, the "AlertBox" problem described above is the expected behaviour... not really a problem to be solved, but something that works like expected.


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.