kkelchev Posted May 7, 2018 Share Posted May 7, 2018 Hi to allMy case is very simple.I have runtime filled TUniHTMLMemo ( it is the same with DBHTMLMemo with text replacement inside OnGetText on DataSet Object) in some cases in this HTML I need to create button(s) that will execute ajaxRequest back to server.But IE and other browsers report with error like "ajaxRequest is NOT defined"I tested same code with simple onclick="alert('bla-bla');" and it work fine. What is necessary to be done to be possible standard UniGUI ajaxRequest call to be executed Thanks Kamen Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 7, 2018 Share Posted May 7, 2018 Hi, Can you make a simple testcase? Quote Link to comment Share on other sites More sharing options...
kkelchev Posted May 7, 2018 Author Share Posted May 7, 2018 ThanksThat is content of DB field coming from database; <div align="right"><font size="4px"><b>006181</b> - ДАВИД xxxxx <br>Лекуваме : <font color="blue"><b> пулпит 65</b></font> Лекар <b>Д-р Ахмед</b><br><font size="2px">Код диагноза:<B> #INSSETBTN# </B>, DiagID:12623</font></div>#INSSETBTN# - on appserver is replaced and contents of TUniDBHTMLMemo become this:#INSSETBTN# => <button onclick="ajaxRequest(O47F,'SET_OLD_DIAG_DCID', {});">за уторчнение</button><div align="right"><font size="4px"><b>006181</b> - ДАВИД xxxxx <br>Лекуваме : <font color="blue"><b> пулпит 65</b></font> Лекар <b>Д-р Ахмед</b><br><font size="2px">Код диагноза:<B> <button onclick="ajaxRequest(O47F,'SET_OLD_DIAG_DCID', {});">за уторчнение</button> </B>, DiagID:12623</font></div>Please find attached picture of IE behavior. Quote Link to comment Share on other sites More sharing options...
kkelchev Posted May 7, 2018 Author Share Posted May 7, 2018 If I replace (just for test)ajaxRequest(O47F,'SET_OLD_DIAG_DCID', {});With alert('bla-bla-bla');IT Works Fine Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 7, 2018 Share Posted May 7, 2018 Try this: window.ajaxRequest instead of ajaxRequest Quote Link to comment Share on other sites More sharing options...
kkelchev Posted May 7, 2018 Author Share Posted May 7, 2018 ajaxRequest is fine now , Browser knows what is ajaxRequestBut now I see thisSCRIPT5009: 'O302' is undefined ...... when press button (ajaxRequest(O302 ,'SET_OLD_DIAG_DCID', {}) 'O302' is JSName of my TUniDBHTMLMemoSo what is right way to specify valid target object that will receive the Ajax request. Quote Link to comment Share on other sites More sharing options...
kkelchev Posted May 7, 2018 Author Share Posted May 7, 2018 How could I specify form(owner) of control(in this case TUniDBHTMLMemo) to receive Ajax call Quote Link to comment Share on other sites More sharing options...
kkelchev Posted May 7, 2018 Author Share Posted May 7, 2018 SORRY I DID mistakeProblem with Control name is still persistsCould I try with windows.O302 ? Quote Link to comment Share on other sites More sharing options...
kkelchev Posted May 7, 2018 Author Share Posted May 7, 2018 IT it not Fine , I Did mistake. Browser dose not known JSName of control. Quote Link to comment Share on other sites More sharing options...
kkelchev Posted May 7, 2018 Author Share Posted May 7, 2018 Also: <button onclick="window.ajaxRequest(document.getElementsByName('O302'),'SET_OLD_DIAG_DCID', {});">за уторчнение</button> SCRIPT438: Object doesn't support property or method 'ajaxRequest' What could I do ? Quote Link to comment Share on other sites More sharing options...
kkelchev Posted May 7, 2018 Author Share Posted May 7, 2018 Pls , suggest me any working solution Quote Link to comment Share on other sites More sharing options...
kkelchev Posted May 7, 2018 Author Share Posted May 7, 2018 At the end I found appropriate solution. JUST replace TUniDBHTMLMemo With TUniHTMLFrame Now events and Ajax calls work perfect. Thanks for your time. Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted May 7, 2018 Share Posted May 7, 2018 For UniDBHTMLMemo the solution is <button onclick="window.parent.ajaxRequest(window.parent.Ext.get(window.parent.document.getElementById('O1B_id')).component,'SET_OLD_DIAG_DCID', {});">за уторчнение</button> Quote Link to comment Share on other sites More sharing options...
kkelchev Posted May 7, 2018 Author Share Posted May 7, 2018 You are great THANKS 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.