Building my first basic form

Building my first basic form

  

I am trying to get a very basic thing working in Outsystems.

I have managed to get a form working that when I submit the page evokes a screen action on the page with the form. The action updates variables on the page using MyFormData.MyVariable.

I am now trying to test submitting the form to a another page and using the submitted data (without submitting the form data to a database).

I have pointed the submission of the form on the button to the new web screen. I have created the new web screen and have added input parameters designed to accept the form submission values. I have created an action to attempt to get each  input parameter to equal the form fields submitted, bu it will not allow me to use MyFormData.MyVariable.

 What am I doing wrong?


Cheers

Hamish

Hi,


first of all, did you do the online courses?

What you are describing is shown in the course to start with Outsystems. After all, entering data is the core of web-applications :)

second, if you have a problem always show some images and preferably an oml so we can check better what you are doing and where it can be improved.


I did the whole web developer course, however I have found that it is missing many really basic examples. 

For example, when it comes to all the end to end training on forms all examples assume you are submitting forms to a database, and the majority of examples start with creating 'editing' forms. What I am trying to do is get a good understanding of form submission and logic, prior to doing anything with database storage of the data. I would have thought the creation of a basic submission form would be a five minute job, however without prior knowledge of the system it isn't. 

On the second point...here are some images:

I have a form page called TestFormPage.


The OK button:



The TestFormSubmission page defined a local variable and runs an action. The action:



The assignment:




I was then hoping to use MyVar1 and learn how to manipulate it on the secodn screen.


Hamish

And a screen shot of the form page:


Hamish Price wrote:

I did the whole web developer course, however I have found that it is missing many really basic examples. 

For example, when it comes to all the end to end training on forms all examples assume you are submitting forms to a database, and the majority of examples start with creating 'editing' forms. What I am trying to do is get a good understanding of form submission and logic, prior to doing anything with database storage of the data. I would have thought the creation of a basic submission form would be a five minute job, however without prior knowledge of the system it isn't. 

On the second point...here are some images:

I have a form page called TestFormPage.


The OK button:



The TestFormSubmission page defined a local variable and runs an action. The action:



The assignment:




I was then hoping to use MyVar1 and learn how to manipulate it on the secodn screen.


Hamish


Hamish, your "Ok" button has destination to the new screen but you don't save the fields. The second page doesn't know your "MyFormData" because it belongs to "TestFormPage".

You need to save it on DB or pass it as input parameter to "TestFormSubmission".

Btw the "Ok" Action and  "Action1" are't executed since you didn't assign them in the respective forms.

What you have in "Action1" should be in Preparation action in "TestFormSubmission".

Or you can assign the destination of the "Ok" button to your "Ok" action and in there replace the "end" with the Destination widget and set the "TestFormSubmission" as the destination and pass the values as input parameters.

And, as J said, this is explained on online courses. I think you should do them again and, without being disrespectful, pay a little more attention to it.


Abílio Matos

Solution

I see,


I fail to see why you even want to achieve that construction?

a submit of a form you are going to the server anyways, so why not stay in your original page.

parse the form (which you then can access)

and do a server redirect to the 2nd page, and pass the form as individual parameters or a session variable or (which is the default way, store it in the database :P )


Solution

I think the reason I am getting confused is because the lessons all assume the default way, which is to store it all in the database. In some cases form submissions just don;t need storing in the database.

Your approach of staying on the same page makes sense, which I have already working. I understand that I can store them as session variables and know how to do that. 

However, I am really unsure to how I pass individual parameters on the server redirect.

I have managed to get it working by doing the following, but I am unsure to how it works:



The piece I am unsure on is as follows. Am I correct in thinking that this states to redirect to the second page and make available all the form field submissions?

Cheers

Hamish

Hello Hamish


If someone answer your question, mark it as correct. That will help others to know that your question have been answered and find answers to similar questions.


TIA


Hi Hamish,

I would say it's easier to grasp this if you understand the basic difference between methods:

  1. Submit - is http Post. If you have an Action as its destination, you can manipulate something and then either stay on same page (leaving with "End" node) or redirect (use "Destination" widget instead)
  2. Navigate - is http Get. You can use session variables as J mentioned to pass data.
  3. Ajax Submit - allows to refresh only some elements on the screen.

Also, every screen can have a "Preparation" action that will run before loading the screen, allowing you to fetch data from DB and/or manipulate it (could be session vars).

Thank you guys. Have now built a multi-page form using session variables.

Cheers

Hamish