MOGSY Posted December 21, 2020 Share Posted December 21, 2020 Hi self.Parent.Broadcast(aParam); There is method to broadcast message to parent of a Frame. Has anyone have an example of how to use it and receive the message at parent. Thank you Regards. Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted December 21, 2020 Share Posted December 21, 2020 4 hours ago, MOGSY said: Hi self.Parent.Broadcast(aParam); There is method to broadcast message to parent of a Frame. Has anyone have an example of how to use it and receive the message at parent. Thank you Regards. Hi, instead BroadCast please use "window.parent.postMessage" in iFrame. Use below code in uniGUI to receive posted message. procedure TMainForm.UniFormCreate(Sender: TObject); begin UniSession.AddJS('function receiveMessage(event){'+ ' ajaxRequest('+WebForm.JSName+', "Message", event.data);'+ '}'+ 'window.addEventListener("message", receiveMessage, false);'); end; procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName='Message' then begin end; end; Quote Link to comment Share on other sites More sharing options...
MOGSY Posted December 21, 2020 Author Share Posted December 21, 2020 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.