Lahrach Hakim Posted March 7, 2014 Share Posted March 7, 2014 Hi, I have try using the UniURLFrame, the click event does not work, I have only put alert('XXXX'); but nothing it comes. Thank's for helping. Hakim Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 7, 2014 Administrators Share Posted March 7, 2014 TUniURLFrame does not publish the Click event. Quote Link to comment Share on other sites More sharing options...
Lahrach Hakim Posted March 7, 2014 Author Share Posted March 7, 2014 Hi, Thank's for ypur express reply. UniUrlframe ClientEvts ExtEvts Click (java script). If not, is there is way to communicate with uniUrlFrame Thank's Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 7, 2014 Administrators Share Posted March 7, 2014 ClientEvents click is there because it is inherited from base control. It doesn't work in urlframe. What sort of communication? Quote Link to comment Share on other sites More sharing options...
Lahrach Hakim Posted March 7, 2014 Author Share Posted March 7, 2014 Hi, I have build web page with menu application, I want to capture each choice from menu and execute module reagarding each sub menu. Thank"s Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 7, 2014 Administrators Share Posted March 7, 2014 As far as I know it is not possible. Quote Link to comment Share on other sites More sharing options...
Lahrach Hakim Posted March 7, 2014 Author Share Posted March 7, 2014 yes I have adopt way to create event in javascript, have you idea how to get event in uniurlframe. Thank's Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 7, 2014 Administrators Share Posted March 7, 2014 urlframe is an HTML element which is totally isolated from its owner. There are techniques to communicate between an and its owner. Search web for your answer. Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted March 8, 2014 Share Posted March 8, 2014 Dear hakim, as i said yesterday, you will create function and this function will call ajaxevent. Like that : For example it is menu html: MenuHTML:='<div id=\"block_navigation\"><ul class=\"navigation\"><li> '+ '<a href=\"#\" onclick=\"MyFunction(''111'');return false;\">Home</a></li>'+ '<li><a class=\"block_navigation_submenu\" href=\"#\">Sliders <span class=\"span_main_links\">+</span></a>'+ '<ul><li><a href=\"#\" onclick=\"MyFunction(''112'');return false;\">Level 1 </a></li><li><a href=\"#\">Level 1 </a></li></ul>'+ '</ul></div>'; This İs function for ajaxevent var data:TStringList; begin data:=TStringList.Create; data.Clear; data.Add('$(document).ready(function(){ '); data.Add(' window.MyFunction = function MyFunction(a) { '); data.Add(Format('ajaxRequest(%s, "Menuclicked", ["menuid="+a]);', [TForm(MyForm).Name+'.'+TUniHTMLFrame(self).Name]) ); data.Add('}'); data.Add('});'); UniSession.AddJS(data.Text); FreeAndNil(data); end; Quote Link to comment Share on other sites More sharing options...
david600320@hotmail.com Posted June 11, 2014 Share Posted June 11, 2014 Hi !! I am very happy to meet uniGUI what is realy nice web developing framework !! > I am newbie in Javascript and uniGui . thanks for your sharing !!> Delphi XE2 , uniGui 0.93.1.1000 > I have a scenario to make an mobile app using JQuery mobile in uniURLFrame of uniGui . ( JQ menu in index.html -> menu click -> check it on javascript (ajaxrequest) -> contol in mainForm -> creating html for body -> show ) * it works well in uniHTMLFrame as scenario . the reason why i prefer to use uniURLFrame . 1. uniURLFrame is faster than uniHTMLFrame without blinking when changing screen . 2. uniURLFrame can be used/put on the same form but uniHTMLFrame only one even same project . > As you know , we can't call any event from javascript in uniURLFrame .> Farshad says that There are techniques to communicate between an <iframe> and its owner. Search web for your answer. BTW , i don't know how to do that . Q1. Is it possible to get event from javasript on using uniURLFrame ? Q2. Can it (Hayri's code) be applied uniURLFrame to get event ? data.Clear; data.Add('$(document).ready(function(){ '); data.Add(' window.MyFunction = function MyFunction(a) { '); data.Add(Format('ajaxRequest(%s, "Menuclicked", ["menuid="+a]);', [TForm(MyForm).Name+'.'+TUniHTMLFrame(self).Name]) ); data.Add('}'); data.Add('});'); UniSession.AddJS(data.Text); Q3. can i use many uniHTMLFrame in a Form ? ( uniURLFrame can ) thanks for helps !! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 11, 2014 Share Posted June 11, 2014 Q3. can i use many uniHTMLFrame in a Form ? ( uniURLFrame can ) Hi David. you can, for example, look example C: \ Program Files \ FMSoft \ Framework \ uniGUI \ Demos \ Basic jQuery Quote Link to comment Share on other sites More sharing options...
david600320@hotmail.com Posted June 11, 2014 Share Posted June 11, 2014 Thanks for your kind reply !! Q3 . solved ( I forgot about the demo - thanks-) BTW , do u have any idear about Q1 ? Sincerly . Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 11, 2014 Share Posted June 11, 2014 Q1. Is it possible to get event from javasript on using uniURLFrame ? I think it depends on what you open in uniURLFrame. If you yourself generate a script, I think you can... can you give an example script? Quote Link to comment Share on other sites More sharing options...
david600320@hotmail.com Posted June 11, 2014 Share Posted June 11, 2014 thanks , * case 1 : Using uniHTMLFrame ----- it works well * case 2 : Using uniURLFrame ----- it dosen't work . ( I need ur helps ) -- How can i solve this problem ? 1. index.html (it's loaded in uniURLFrame ) <!doctype html> <html> <head> <title>My Page</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.1/jquery.mobile-1.2.1.min.css" /> <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script src="http://code.jquery.com/mobile/1.2.1/jquery.mobile-1.2.1.min.js"></script> </head> <body> <div id="home" data-role="page"> <div data-role="header" data-theme="c"> <h1> Test </h1> <a href=# data-icon="home" class="ui-btn-left" onclick="goMenu(0);">Login</a> </div><!-- /header --> <div data-role="content"> <ul data-role="listview" data-inset="true" data-filter="false"> <li data-role="list-divider">Menu</li> <li><a href="#" onclick="goMenu(1000);">menu_1000</a></li> <li><a href="#" onclick="goMenu(2000);">menu_2000</a></li> </ul> </div><!-- /content --> <div data-role="footer" data-position="fixed" data-theme="c"> <h4>JQuery mobile Test </h4> </div><!-- /footer --> </body> </html> <script type="text/javascript"> function goMenu(menu_id) { // not fire any event in MainForm ajaxRequest( MainForm.mainURLFrame , "goMenu", ['menu_id='+menu_id]); // Everybody } </script> 2. To get AjaxEvent in MainForm procedure TMainForm.mainURLFrameAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); var menu_id : integer ; data_id : integer ; search_key : String ; begin if EventName='goMenu' then begin menu_id := StrToInt(Params.Values['menu_id']) ; mainmenu( menu_id ); // go to any function end ; end ; Quote Link to comment Share on other sites More sharing options...
ganzqgy Posted June 11, 2014 Share Posted June 11, 2014 top.Mainform Quote Link to comment Share on other sites More sharing options...
david600320@hotmail.com Posted June 11, 2014 Share Posted June 11, 2014 Thanks ganzqgy , BTW , please explain more . I changed from ajaxRequest( MainForm.mainURLFrame , "goMenu", ['menu_id='+menu_id]); to ajaxRequest( top.MainForm, "goMenu", ['menu_id='+menu_id]); and changed from procedure TMainForm.mainURLFrameAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); to procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin showMessage( EventName ) ; end; but it dosen't work . Quote Link to comment Share on other sites More sharing options...
ganzqgy Posted June 11, 2014 Share Posted June 11, 2014 top.ajaxRequest( top.MainForm.mainURLFrame , "goMenu", ['menu_id='+menu_id]); Quote Link to comment Share on other sites More sharing options...
david600320@hotmail.com Posted June 12, 2014 Share Posted June 12, 2014 Thanks a lot , ganzqgy It's solved coz of Nice framework and nice experts !! Thanks again . Quote Link to comment Share on other sites More sharing options...
ganzqgy Posted June 12, 2014 Share Posted June 12, 2014 UniSession.JSCode('name_'+MainForm.UniURLFrame1.name+'_'+MainForm.UniURLFrame1.JSName+'.myinput4.innerHTML="..."'); MainForm.UniURLFrame1.iframe.contentWindow.document.getElementById("中文").innerHTML="..."; MainForm.UniURLFrame1.iframe.contentWindow.fun(1,1,22,62);//functionMainForm.UniURLFrame1.iframe.contentWindow.vvv = '';//var vvv Quote Link to comment Share on other sites More sharing options...
david600320@hotmail.com Posted June 12, 2014 Share Posted June 12, 2014 Thanks a lot , ganzqgy with your kind helps, I can understand how to get elements and function even vars from content of html . Tonight , I will try those what you support. thanks again , good luck !! Quote Link to comment Share on other sites More sharing options...
david600320@hotmail.com Posted June 13, 2014 Share Posted June 13, 2014 Hi ganzqgy > your codes are very useful . so I could understand how to send/set something into uniURLFrmae.html . < your code > UniSession.JSCode('name_'+MainForm.UniURLFrame1.name+'_'+MainForm.UniURLFrame1.JSName+'.myinput4.innerHTML="..."'); MainForm.UniURLFrame1.iframe.contentWindow.document.getElementById("中文").innerHTML="..."; MainForm.UniURLFrame1.iframe.contentWindow.fun(1,1,22,62);//functionMainForm.UniURLFrame1.iframe.contentWindow.vvv = '';//var vvv Q. BTW , Can i get any values from innerHTML or innerTEXT into uniGui again ? to be like below . ex) MainForm.uniEdit1.Text := someGetfunc ( MainForm.UniURLFrame1.iframe.contentWindow.document.getElementById("中文").innerHTML ) ; many thanks for specially Delphi Developer and ganzqgy !! Quote Link to comment Share on other sites More sharing options...
ganzqgy Posted June 13, 2014 Share Posted June 13, 2014 js: MainForm.UniEdit1.setValue(MainForm.UniURLFrame1.iframe.contentWindow.document.getElementById("中文").innerHTML); Quote Link to comment Share on other sites More sharing options...
david600320@hotmail.com Posted June 13, 2014 Share Posted June 13, 2014 Thanks ganzqgy , works fine !! , With your helps , I can be able to finish my testcase for using JQuery mobile in uniURLFrame . Have a nice day and God bless you !! Quote Link to comment Share on other sites More sharing options...
mehmet07 Posted July 15, 2015 Share Posted July 15, 2015 i try this top.ajaxRequest( top.MainForm.mainURLFrame , "goMenu", ['menu_id='+menu_id]); but i can not working Quote Link to comment Share on other sites More sharing options...
mehmet07 Posted July 27, 2015 Share Posted July 27, 2015 hi, function click(sender, e, eOpts) { MainForm.UniMemo1.setValue(MainForm.mainURLFrame.iframe.contentWindow.document.getElementById("dyukle").innerHTML); } i try this. but not get value. i add uniUrlFrame html properties ( (<textarea name="dyukle" id='dyukle' rows="10" cols="50">fff</textarea) ) and this code working. but i use load uniUrlFrame with php page( mainURLFrame.url:='http://localhost/test/index.php';) after not working. index.php is have <textarea name="dyukle" id='dyukle' rows="10" cols="50">fff</textarea> sorry my english is bad. 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.