allenchow Posted July 12, 2017 Share Posted July 12, 2017 When I try to switch with 2 buttons : 1 set URL to UniURLFRAME1 and 1 set HTML content into it But I can only load URL , but cannot show HTML content , unless I show HTML content first . But after switch to URL again, I cannot show HTML again . Please help ! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 12, 2017 Share Posted July 12, 2017 Hi, Can you make a testcase please? Best regards, Quote Link to comment Share on other sites More sharing options...
allenchow Posted July 14, 2017 Author Share Posted July 14, 2017 Try this. test.rar Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 14, 2017 Share Posted July 14, 2017 HI, Sorry, how to use your testcase?! Best regards, Quote Link to comment Share on other sites More sharing options...
allenchow Posted July 14, 2017 Author Share Posted July 14, 2017 Just click URL button first and then HTML button again and agin Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 14, 2017 Share Posted July 14, 2017 Just click URL button first and then HTML button again and agin It seems you missed these buttons in your test case. Quote Link to comment Share on other sites More sharing options...
allenchow Posted July 14, 2017 Author Share Posted July 14, 2017 sorry, try this test.rar Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 14, 2017 Share Posted July 14, 2017 Hi, I think you need to change the logic. After set the "URL" you must "clear" URL (UniURLFrame1.URL := '';) if you want to use UniURLFrame1.HTML.Text, and handle it in OnFrameLoaded event, Can you try it?! Best regards, Quote Link to comment Share on other sites More sharing options...
allenchow Posted July 15, 2017 Author Share Posted July 15, 2017 Actually I have used UniURLFrame1.URL := ''; but the result is the same. What should I do inside OnFrameLoaded ? Also there's an error as attachment when I click HTML after clicking URL Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 15, 2017 Share Posted July 15, 2017 Hi, Actually I have used UniURLFrame1.URL := ''; but the result is the same. What should I do inside OnFrameLoaded ? Also there's an error as attachment when I click HTML after clicking URL Well, for example like this: public { Public declarations } isHTML: Boolean; HTMLstr: string; end; procedure TMainForm.UniButton1Click(Sender: TObject); begin isHTML := True; HTMLstr := '<html><body>Test ! </body></html>'; UniURLFrame1.URL := ''; //UniURLFrame1.HTML.Text := '<html><body>Test ! </body></html>'; end; procedure TMainForm.UniButton2Click(Sender: TObject); begin isHTML := False; UniURLFrame1.URL := 'http://www.xyz.com'; end; procedure TMainForm.UniURLFrame1FrameLoaded(Sender: TObject); begin if (isHTML) and (HTMLstr<>'') then begin isHTML := False; UniURLFrame1.HTML.Text := HTMLstr; end; end; Best regards, Quote Link to comment Share on other sites More sharing options...
allenchow Posted July 17, 2017 Author Share Posted July 17, 2017 It works ! Thanks ! Quote Link to comment Share on other sites More sharing options...
skafy Posted August 22, 2017 Share Posted August 22, 2017 Thank you. Quote Link to comment Share on other sites More sharing options...
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.