Code to refresh the form not working

Questions and answers for designing and implementing forms in Servoy

Code to refresh the form not working

Postby ahurtado » Fri Jul 25, 2008 6:58 pm

I use this sentese for refresh my form,

but this not refresh

application.updateUI();


how can I solve this

Thank's!!
User avatar
ahurtado
 
Posts: 43
Joined: Fri Jul 18, 2008 8:19 pm
Location: Valencia, Venezuela

Postby Joas » Fri Jul 25, 2008 11:53 pm

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?
Joas de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL

Postby IT2Be » Sat Jul 26, 2008 12:49 am

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...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

application.updateUI ()

Postby ahurtado » Wed Jul 30, 2008 9:29 am

IT2Be wrote:
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
User avatar
ahurtado
 
Posts: 43
Joined: Fri Jul 18, 2008 8:19 pm
Location: Valencia, Venezuela

Re: application.updateUI ()

Postby Joas » Wed Jul 30, 2008 10:01 am

ahurtado wrote: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?
Joas de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL

Re: application.updateUI ()

Postby ahurtado » Fri Aug 01, 2008 11:32 am

Joas wrote:
ahurtado wrote: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
User avatar
ahurtado
 
Posts: 43
Joined: Fri Jul 18, 2008 8:19 pm
Location: Valencia, Venezuela

Re: Code to refresh the form not working

Postby hareendra » Fri Jun 06, 2014 10:18 am

how do you "change the text manually"?
hareendra
 
Posts: 98
Joined: Wed Sep 17, 2008 11:41 am


Return to Forms

Who is online

Users browsing this forum: No registered users and 8 guests

cron