Hi All,

I notice a issue when i'm running i'm application either through running it locally or after deploying.

Issue is if i perform any action after that if i do browser refresh then its performing same action again on each browser refresh 

Why this is happening to me ?

am i missing anything?

Thanks in advance 

After doing a submit action and you refresh the browser, it submit the last performed action.

Yeah but how to avoid it ?

Can you do an Ajax Submit?

no i cannot do ajax submit 

If can add this script to the end of your page:

"<script>
if ( window.history.replaceState ) {
  window.history.replaceState( null, null, window.location.href );
}
</script>"


Add this to an expression with escape content set to NO.

I recently started working on out systems. I’m not sure where exactly I need to use JavaScript 

could you please help me ?

Drag an expression to the end of the screen (the last thing you have on the content screen).
Paste that code, and on expression properties you can set escape content to Yes/No. See pic bellow.


Why you can't use Ajax Submit instead of Submit action?

You can also run that JavaScript at the end of you Submit action, without the script tags.


Hi Gandeev,

The best option for this would be to do the "Ajax Submit" method with the above. 

This is because if you use the "Submit" method the browser will render the page again and will then run "Preparation".

EFreitas wrote:

Drag an expression to the end of the screen (the last thing you have on the content screen).
Paste that code, and on expression properties you can set escape content to Yes/No. See pic bellow.


Why you can't use Ajax Submit instead of Submit action?

Hi,

Actually I have a screen where I’m using 4 different tabs and each tab will show each status of a record (open ,rejected .approved).

so now i have some inline operation to change the status  of the record.If I perform those operations with ajax submit it’s not refreshing the content and record still shown on the same tab but if I do normal submit action than it refreshes the current tab and record will be no longer seen on the current tab

so this is the reason why I’m not using ajax submit 

You can use Ajax Submit. You only need to refresh the query queres you are getting the data and use any Ajax Refresh to refresh the tabs.

Use any Ajax Submit instead of a Submit.


Did you try the JavaScript ?

EFreitas wrote:

You can use Ajax Submit. You only need to refresh the query queres you are getting the data and use any Ajax Refresh to refresh the tabs.

Use any Ajax Submit instead of a Submit.


Did you try the JavaScript ?

Hi Efreitas,

Yes,I do used javascript and it worked quite well but with submit action.

I tired with ajax submit then it was not working as my requirement :(


The JavaScript is to be used only with the Submit. So your initial question is answered.


Your problem now is how to use Ajax Submit.

1. You need to give a name to the widget where the status is show. You can give a name to the tabs widget. This element will be refresh at the end and will show the new data.

2. Inside the action and before the End, you need to refresh the query (using refresh data) and then need to refresh the elements in the screen (using Ajax Refresh and selecting the widgets that you want to be refresh. This elements need to be named).

EFreitas wrote:

The JavaScript is to be used only with the Submit. So your initial question is answered.


Your problem now is how to use Ajax Submit.

1. You need to give a name to the widget where the status is show. You can give a name to the tabs widget. This element will be refresh at the end and will show the new data.

2. Inside the action and before the End, you need to refresh the query (using refresh data) and then need to refresh the elements in the screen (using Ajax Refresh and selecting the widgets that you want to be refresh. This elements need to be named).

Hello,

I tired the way you mentioned but no luck it didn't work :(


Hi Gandeev,

as EFreitas mention above solution is fine.

instead of TabName refresh you should refresh to part(container )where data is populate.


Thanks

Rahul Sahu

Rahul Sahu wrote:

Hi Gandeev,

as EFreitas mention above solution is fine.

instead of TabName refresh you should refresh to part(container )where data is populate.


Thanks

Rahul Sahu

Hi Rahul 

I even tired with tab content part also it didn’t work 

1)when I did for tab header then it didn’t refreshed 

2)when I did for tab content then very weird thing happened,It didn’t loaded the tab content itself ??.It was blank content page with tab header 


Gandeev b wrote:

Rahul Sahu wrote:

Hi Gandeev,

as EFreitas mention above solution is fine.

instead of TabName refresh you should refresh to part(container )where data is populate.


Thanks

Rahul Sahu

Hi Rahul 

I even tired with tab content part also it didn’t work 

1)when I did for tab header then it didn’t refreshed 

2)when I did for tab content then very weird thing happened,It didn’t loaded the tab content itself ??.It was blank content page with tab header 



can you provide sample oml or some images of you code.

Hi Gandeev,

please look this oml i hope  it will help you.

https://rahul-sahu.outsystemscloud.com/TestTabContent/DataTabs.aspx?_ts=637083197372458952


Thanks

Rahul Sahu

Rahul Sahu wrote:

Hi Gandeev,

please look this oml i hope  it will help you.

https://rahul-sahu.outsystemscloud.com/TestTabContent/DataTabs.aspx?_ts=637083197372458952


Thanks

Rahul Sahu

Ah... You did this in web block everything separately but i did in web screen and all tabs in one screen  


EFreitas wrote:

If can add this script to the end of your page:

"<script>
if ( window.history.replaceState ) {
  window.history.replaceState( null, null, window.location.href );
}
</script>"


Add this to an expression with escape content set to NO.

Thanks a tonne. very helpful! 


Ashima Pahwa wrote:

EFreitas wrote:

If can add this script to the end of your page:

"<script>
if ( window.history.replaceState ) {
  window.history.replaceState( null, null, window.location.href );
}
</script>"


Add this to an expression with escape content set to NO.

Thanks a tonne. very helpful! 


You're welcome!!


Gandeev b wrote:

Rahul Sahu wrote:

Hi Gandeev,

please look this oml i hope  it will help you.

https://rahul-sahu.outsystemscloud.com/TestTabContent/DataTabs.aspx?_ts=637083197372458952


Thanks

Rahul Sahu

Ah... You did this in web block everything separately but i did in web screen and all tabs in one screen  


Hello Gandeev b,

Please test it in the following screen: https://emanuelfreitas.outsystemscloud.com/AjaxRefreshTab/Tabs.aspx

Everything is in the same screen. I also attached the oml file so you can see one way of doing it. You can publish in your personal environment.


Best regards,

EFreitas wrote:

Gandeev b wrote:

Rahul Sahu wrote:

Hi Gandeev,

please look this oml i hope  it will help you.

https://rahul-sahu.outsystemscloud.com/TestTabContent/DataTabs.aspx?_ts=637083197372458952


Thanks

Rahul Sahu

Ah... You did this in web block everything separately but i did in web screen and all tabs in one screen  


Hello Gandeev b,

Please test it in the following screen: https://emanuelfreitas.outsystemscloud.com/AjaxRefreshTab/Tabs.aspx

Everything is in the same screen. I also attached the oml file so you can see one way of doing it. You can publish in your personal environment.


Best regards,

Hello 

Thanks for your input it really helpfull :)

However the solution you provided has an issue 

Your logic :


Works fine with one role but in my scenario i need to show some tabs  to some users  according to user role

so in my case its not able to recognize any filter actions everything got vanished on using if condition and i'm not able to assign those filter list values to the local variables   :(


Solution

You need to put the assign inside the branch. It means, instead of having one assign, you will have multiples.

See the following pic:

Solution