FastCards Posted March 30, 2016 Posted March 30, 2016 I've got the Google Charts API thing working (thanks to the poster who posted the sample code, I will post my code when it's all working) Basically, I build the HTML in Delphi code (which I know inside out) then pass that HTML to a UniURLFrame and it displays fine. All is good with the world. However, if I want to re-draw the chart because the user has selected different options, it doesn't work. If I assign new HTML to the UniURLFrame it doesn't draw and produces errors. Without going into detail, these errors are caused because I have already loaded things and created things in the Javascript HTMl the first time round. My question is this: is this the right way to do this sort of thing (i.e. assign HTML to a UniURLFrame) or is there a better way to do it? If this was in Windows development, you would clear what had gone before, then change the HTML then call a refresh method or the like to load in the new HTML. I know this isn't how JavaScript works but any pointers would be gratefully received. Thanks and all the best to all in the Unigui community :-) Andy Quote
Sherzod Posted March 31, 2016 Posted March 31, 2016 Hi, Maybe you should use UniHTMLFrame ?! Best regards. Quote
FastCards Posted March 31, 2016 Author Posted March 31, 2016 UniHTMLFrame didn't work. But... I looked at the sample code again (thanks to forum member fcarvalho4) and discovered that if you replace the text in the HTML property of UniURLFrame with new text, it doesn't work. If instead you replace the bits of text that you want to change, it does work. So, basically, this doesn't work UniURLFrame1.HTML=NewText But this does UniURLFrame1.HTML.Text := StringReplace(UniURLFrame1.HTML.Text,TheOldText,TheNewText,[rfReplaceAll]); Happy days... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.