Reloading HTML_AREA on the fly

Questions, tips and tricks and techniques for scripting in Servoy

Reloading HTML_AREA on the fly

Postby nathan.king » Mon May 12, 2014 11:16 am

This is a question for web client. I'm passing in data to a variable dynamically to be shown through charts in a HTML_AREA. Trouble is that the HTML_AREA doesn't refresh when the data changes (or sometimes even when it's loaded for the first time) so it just remains blank. Manually refreshing the page will show the charts, but I'd like to force a refresh. Anyone know how I might achieve this?
Nathan King

Strategic Corrosion Management
http://www.stratcorrman.com
nathan.king
 
Posts: 12
Joined: Thu Oct 03, 2013 10:49 am
Location: Northumberland, United Kingdom

Re: Reloading HTML_AREA on the fly

Postby sovanm » Mon May 12, 2014 11:23 am

I have faced a similar situation while showing chart. What I have done is refreshed the page using the web client utils plugin.

Code: Select all
plugins.WebClientUtils.executeClientSideJS('location.reload();');


It is doing the reload, showing the charts..

But, It will be nice if we can refresh the HTML AREA after modifying the HTML of that element.

Please share your thoughts.

Thanks,
sovanm
 
Posts: 99
Joined: Fri Oct 28, 2011 1:55 pm
Location: Bhubaneswar, India

Re: Reloading HTML_AREA on the fly

Postby nathan.king » Mon May 12, 2014 11:26 am

Thanks Sovan, that worked perfectly! It would be very nice if we would refresh the html area after modifying the html, but that code will do just fine until we can get that kind of functionality.

Thanks again :)
Nathan King

Strategic Corrosion Management
http://www.stratcorrman.com
nathan.king
 
Posts: 12
Joined: Thu Oct 03, 2013 10:49 am
Location: Northumberland, United Kingdom

Re: Reloading HTML_AREA on the fly

Postby poyel » Wed May 14, 2014 11:58 am

If you want to avoid the refresh of the page (you can have problem with dataprovider value, ...) you can create a callback that refresh only the html area insted of the entire page or much better you can execute the javascript code that create the chart directly with the web_client_utils.
Marco Alessio Milazzo
- freelance programmer -
Web Developer
Servoy
poyel
 
Posts: 49
Joined: Wed Aug 31, 2011 4:35 pm


Return to Methods

Who is online

Users browsing this forum: No registered users and 3 guests