# Code to refresh the form not working

**URL:** <https://forum.servoy.com/t/code-to-refresh-the-form-not-working/9359>\
**Category:** Classic Servoy\
**Created:** [July 25, 2008, 4:58pm UTC](https://forum.servoy.com/t/code-to-refresh-the-form-not-working/9359 "2008-07-25T16:58:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahurtado](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@ahurtado](https://forum.servoy.com/u/ahurtado)\
**Post date:** [July 25, 2008, 4:58pm UTC](https://forum.servoy.com/t/code-to-refresh-the-form-not-working/9359/1 "2008-07-25T16:58:28Z")

</div>

I use this sentese for refresh my form,

but this not refresh

application.updateUI();

how can I solve this

Thank’s!!

---

<div class="post-metadata">

**Author:** ![Joas](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/joas/32/5095_2.png) [@Joas](https://forum.servoy.com/u/Joas)\
**Post date:** [July 25, 2008, 9:53pm UTC](https://forum.servoy.com/t/code-to-refresh-the-form-not-working/9359/2 "2008-07-25T21:53:45Z")

</div>

Can you explain a little bit more about what you’re trying to do? What do you mean with “refreshing a form”?

Servoy automatically updates the UI, just not when you’re still running a script. If you want to update the UI in the middle of a script you can use application.updateUI(), but this is only useful if your script takes a long time to finish.

Is this how you use it? What exactly is going wrong when you do that?

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [July 25, 2008, 10:49pm UTC](https://forum.servoy.com/t/code-to-refresh-the-form-not-working/9359/3 "2008-07-25T22:49:52Z")

</div>

> If you want to update the UI in the middle of a script you can use application.updateUI(), but this is only useful if your script takes a long time to finish.

And when the task is ‘heavy’ application.updateUI() might not give the result you expect…

---

<div class="post-metadata">

**Author:** ![ahurtado](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@ahurtado](https://forum.servoy.com/u/ahurtado)\
**Post date:** [July 30, 2008, 7:29am UTC](https://forum.servoy.com/t/code-to-refresh-the-form-not-working/9359/4 "2008-07-30T07:29:13Z")

</div>

> IT2Be:
> 
> > If you want to update the UI in the middle of a script you can use application.updateUI(), but this is only useful if your script takes a long time to finish.
> 
> And when the task is ‘heavy’ application.updateUI() might not give the result you expect…

the task is not heavy, I have a form to login where the user chooses the language of preference, to choose one of these, the labels should change to the language selected for this and I application.updateUI () being upgraded so that the Form

---

<div class="post-metadata">

**Author:** ![Joas](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/joas/32/5095_2.png) [@Joas](https://forum.servoy.com/u/Joas)\
**Post date:** [July 30, 2008, 8:01am UTC](https://forum.servoy.com/t/code-to-refresh-the-form-not-working/9359/5 "2008-07-30T08:01:32Z")

</div>

> ahurtado:  
> the task is not heavy, I have a form to login where the user chooses the language of preference, to choose one of these, the labels should change to the language selected for this and I application.updateUI () being upgraded so that the Form

You don’t need to call application.updateUI() for that, you should see the changes directly if your method is finished.

Do you use i18n? Because changing the locale doesn’t affect the text of labels on forms that are already cached, in that case you have to change that text manually. Can you post your code here?

---

<div class="post-metadata">

**Author:** ![ahurtado](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@ahurtado](https://forum.servoy.com/u/ahurtado)\
**Post date:** [August 1, 2008, 9:32am UTC](https://forum.servoy.com/t/code-to-refresh-the-form-not-working/9359/6 "2008-08-01T09:32:49Z")

</div>

> Joas:
> 
> > ahurtado:  
> > the task is not heavy, I have a form to login where the user chooses the language of preference, to choose one of these, the labels should change to the language selected for this and I application.updateUI () being upgraded so that the Form
> 
> You don’t need to call application.updateUI() for that, you should see the changes directly if your method is finished.
> 
> Do you use i18n? Because changing the locale doesn’t affect the text of labels on forms that are already cached, in that case you have to change that text manually. Can you post your code here?

Yes, i use i18n, my code is

function setLanguage()  
{  
var \_button = application.getMethodTriggerElementName()  
var \_language = utils.stringReplace(\_button, ‘\_des’, ‘’)  
globals.svy\_sec\_setUserProperty(‘nav\_language’,\_language);  
lang = \_language  
i18n.setLocale(lang, i18n.getCurrentCountry())  
setFlags()  
application.updateUI()  
}

i refresh the form after selecting the leguage

---

<div class="post-metadata">

**Author:** ![hareendra](https://avatars.discourse-cdn.com/v4/letter/h/77aa72/32.png) [@hareendra](https://forum.servoy.com/u/hareendra)\
**Post date:** [June 6, 2014, 8:18am UTC](https://forum.servoy.com/t/code-to-refresh-the-form-not-working/9359/7 "2014-06-06T08:18:37Z")

</div>

how do you “change the text manually”?
