Kindly help with an idea on how to refresh a container
Application Type
Traditional Web

I have Amount in my App and from this amount, Tax is calculated automatically.

I want a situation whereby if the user type in the amount, then the application will automatically display the tax on the same page. My problem is how to make the application to display the tax on the same page.

See example below:

Amount 30,000 (the user will type the amount in)

Tax ? (how to make the application to display the tax is the problem)


Please, kindly help. Thanks

Hi Harrison,

  • in the screen create 2 variables
  • in the UI create 2 inputs, one inside a container
  • InputAmount needs a screen action OnChange
  • On OnAmountChange, calculate your tax and refresh ContainerTax


Please, could you kindly make it easy for me by putting the OML of the above explanation here as a guide. Thanks alot

Thanks Jose. The guide and oml worked as required. But there is an issue. I discovered that the amount is not saved in the list page. Could you kindly suggest how i can resolve this problem please.

Where do you want to save it? In a list or in the database?

Thanks Jose. I deeply appreciate your help.

I want to save the Amount in the database as normal in the aggregate, 

just the way list page and detail page work normally.

 When I click save, i want the amount to be saved in the database so i can show it normally in the list screen.

Thanks again

This is very basic programming in Outsystems. You should spend some time learning with the courses and documentation.

To save in the database, create an entity with the attributes you need to save (Amount, Tax).

Then create a button in the screen to save the data. Also you need

When you click that button, a new screen action will be created. In that screen action, create a variable with the data type of the entity you have created.

Assign the values from the UI to that variable you have created, then call the CreateOrUpdate action from the entity you have created with the entity variable assigned to it.

Regards

I have an entity. See below:

I also already created list and detail screens. Adjustment to detail screen was done with your assistance (Tax, Amount variable and onAmountChange) See below:

I realized that input Amount  destination is OnAmountChange. See below:

When I click save button, the amount is not saved. 

Other things  works as required on the screen displaying the Tax, VAT and Stamp Duty  figures when the amount is inputted. 

But when save button is clicked, the Amount is not saved. Is it because of the destination. Please assist me. Could you kindly help me adjust the OML you sent earlier so I can follow easily. Thanks

Hi Harrison, There are many ways to display the value on the same screen.

But in Your case, the easiest way is that you should create a web block and pass input and and calculate inside the block pass the value in Event and then handle the calculated value in Screen handler and display onto the screen. Every time once you change value, the web block, OnParameterChanged will call and it will reflect the  refreshed calculated value to the screen using event.

Hope it will help you.


Dileep 

Thank, but could kindly give me a guide on how to do this, please.

Hi Harrison,

  • in the screen create 2 variables
  • in the UI create 2 inputs, one inside a container
  • InputAmount needs a screen action OnChange
  • On OnAmountChange, calculate your tax and refresh ContainerTax


Please, could you kindly make it easy for me by putting the OML of the above explanation here as a guide. Thanks alot

Thanks Jose. The guide and oml worked as required. But there is an issue. I discovered that the amount is not saved in the list page. Could you kindly suggest how i can resolve this problem please.

Where do you want to save it? In a list or in the database?

Thanks Jose. I deeply appreciate your help.

I want to save the Amount in the database as normal in the aggregate, 

just the way list page and detail page work normally.

 When I click save, i want the amount to be saved in the database so i can show it normally in the list screen.

Thanks again

This is very basic programming in Outsystems. You should spend some time learning with the courses and documentation.

To save in the database, create an entity with the attributes you need to save (Amount, Tax).

Then create a button in the screen to save the data. Also you need

When you click that button, a new screen action will be created. In that screen action, create a variable with the data type of the entity you have created.

Assign the values from the UI to that variable you have created, then call the CreateOrUpdate action from the entity you have created with the entity variable assigned to it.

Regards

I have an entity. See below:

I also already created list and detail screens. Adjustment to detail screen was done with your assistance (Tax, Amount variable and onAmountChange) See below:

I realized that input Amount  destination is OnAmountChange. See below:

When I click save button, the amount is not saved. 

Other things  works as required on the screen displaying the Tax, VAT and Stamp Duty  figures when the amount is inputted. 

But when save button is clicked, the Amount is not saved. Is it because of the destination. Please assist me. Could you kindly help me adjust the OML you sent earlier so I can follow easily. Thanks

here

Example.oml

I decided to add another entity attribute to hold the amount. It is saving. Thanks
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.