How to refresh html component

This forum contains topics that were moved from Get Satisfaction
David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

How to refresh html component

Post by David wyatt »

Hi,

i have a html component that i need to refresh on a button click. i set this event

Appery("html_comp").html("refresh");

but it justs changes html component to the word refresh

thanks

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to refresh html component

Post by Kateryna Grynko »

Hi David,

Method codehtml/code replaces a component content that is why all you see is 'refresh'.

What is stored in your HTML component that you want to refresh?

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

How to refresh html component

Post by David wyatt »

Hi,
it's a javscript graph generated by inputs from the app, so I need it to refresh every time new data is inputted.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to refresh html component

Post by Kateryna Grynko »

Hi David,

What library do you use to build graph? It should have its own method to refresh after adding data.

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

How to refresh html component

Post by David wyatt »

It's plotted directly from JavaScript on canvas and doesn't use a library afraid.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How to refresh html component

Post by Evgene Karachevtsev »

Hello David,

Html component doesn't have opportunity to restart, only insert inside new html code of, for example, your updated graphics.

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

How to refresh html component

Post by David wyatt »

How would I insert new code, as I was thinking I could keep a copy of the code I need and continely insert it to refresh the variables?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How to refresh html component

Post by Evgene Karachevtsev »

David,

Could you please share your project with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a, tell us its name and steps to reproduce the issue with graphic? http://devcenter.appery.io/documentat...

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

How to refresh html component

Post by David wyatt »

Hi,

thank you for your help.
ive shared the app, its called xappy. i need the html component to refresh when you press the refresh button. ive tried to use
Appery("xappy_html").html("") with the contents of my html component in it so that it replaces it with the same script as before (that way it appears to refresh). But as the script is multiple lines it keeps failing. hope that makes sense

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How to refresh html component

Post by Evgene Karachevtsev »

David,

In html component you should have only the canvas tag, all js code please put in a separate file and wrap it in a function.
Everything else delete. When clicking call a function that will work and will update canvas.

Post Reply