p.abend Posted July 10, 2012 Posted July 10, 2012 Hello Everybody! I want to execute Functions or change Variables of by UniGUI Application which is in WebMode out of the loaded HTML Content in my UniURLFrame. Is this possible? A little example which should explain what i am searching for: "myForm" is my UniGUI Form "myURLFrame" is my URLFrame COmponent an my UniGUI Form the loaded content... <a href="javascript:Ext.myForm.Caption='A little Test from Web'">Change Caption</a> Can you help me? Quote
p.abend Posted July 18, 2012 Author Posted July 18, 2012 Hey Guys! I really need your help. Please please please.. i need an Idea! It´s enough if i can call a function or procedure of my Delphi UniGUI Project out of the loaded content in the UniGUI URLFrame. I hope, somebody has an Idea! Thanks a lot! Patrik Quote
Administrators Farshad Mohajeri Posted July 18, 2012 Administrators Posted July 18, 2012 an can not access its parent DOM for security reasons. You need to use a TUniHTMLFrame instead. Quote
p.abend Posted July 18, 2012 Author Posted July 18, 2012 OK, If I use the HTMLFrame, how can i access?.. Quote
p.abend Posted July 19, 2012 Author Posted July 19, 2012 There is no help for my question in the framework, so i ask here, and i want to get an answer. I also will pay for UniGUI if it left beta status. This is the best framework i ever seen. Please.. help me.. Quote
Administrators Farshad Mohajeri Posted July 19, 2012 Administrators Posted July 19, 2012 See one of our client demos which shows how to access uniGUI objects from JavaScript code. Quote
p.abend Posted July 19, 2012 Author Posted July 19, 2012 I tried MainForm.UniButton1.click(); but it doesn't work. Than i tried to call a procedure from Main.pas names "SayHello" like this way MainForm.SayHello(); but it also doesn't work Whats wrong in my code? Quote
Administrators Farshad Mohajeri Posted July 20, 2012 Administrators Posted July 20, 2012 You can't call Pascal methods from JavaScript code! Buttons and other objects are Ext JS objects and you need to review Ext JS API reference to see methods and properties available at runtime. http://docs.sencha.com/ext-js/3-4/ Quote
Ronak Posted July 24, 2012 Posted July 24, 2012 if I have to have call delphi method then I can try something like... Demo Attached. // HTML CODE in UniHtmlFrame <!DOCTYPE html> <html> <head> <script type="text/javascript"> function myFunction() { var bool1= MainForm.UniCheckBox1.getValue(); if (bool1) { MainForm.UniCheckBox1.setValue('0'); } else { MainForm.UniCheckBox1.setValue('1'); } } </script> </head> <body> <input type="button" onclick="myFunction()" value="Click me" /> </body> </html> *************** procedure TMainForm.UniCheckBox1Click(Sender: TObject); begin ShowMessage('UniCheckBox1Click'); end; *************** methods.rar 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.