Jump to content

Recommended Posts

Posted

When using a TUniURLFrame in FireFox and calling the following code to trap an ESCAPE key press,

urlFrame.JSInterface.JSCode(#1'.iframe.contentDocument.addEventListener("keydown", function(e){ajaxRequest('+ Self.WebForm.JSForm.JSName +', "keydown", ["key="+e.keyCode])});')

FireFox throws the attached Ajax error. The error does not show in other browsers.

How do I work around this problem?

--
Frederick
(UniGUI Complete - Professional Edition 1.95.0.1577)
 

firefoxbankrec.png

Posted
5 minutes ago, Frederick said:

urlFrame.JSInterface.JSCode(#1'.iframe.contentDocument.addEventListener("keydown", function(e){ajaxRequest('+ Self.WebForm.JSForm.JSName +', "keydown", ["key="+e.keyCode])});')

Hello,

Just to clarify — where exactly are you assigning this code?

I’d recommend assigning this code inside the OnFrameLoaded event of TUniURLFrame. This way, you ensure the iframe content is fully accessible, and you won’t run into the null reference issue.

Posted
2 hours ago, Frederick said:

Where do I set the defer setting?

urlFrame.JSInterface.JSCode(
  'Ext.defer(function(){' +
    '#1.iframe.contentDocument.addEventListener("keydown", function(e){' +
      'ajaxRequest(' + Self.WebForm.JSForm.JSName + ', "keydown", ["key="+e.keyCode]);' +
    '});' +
  '}, 300);'
);

 

Posted
4 hours ago, Farshad Mohajeri said:

defer is a JS method to delay calling of code.

Is it possible to use defer on Form.OnCreate event ?

I want to slow down execution of javascript until all element are created .

Posted
5 hours ago, Sherzod said:
urlFrame.JSInterface.JSCode(
  'Ext.defer(function(){' +
    '#1.iframe.contentDocument.addEventListener("keydown", function(e){' +
      'ajaxRequest(' + Self.WebForm.JSForm.JSName + ', "keydown", ["key="+e.keyCode]);' +
    '});' +
  '}, 300);'
);

 

Thanks for the code but, I am now getting the following error in Firefox. If it is not Firefox, I get the second error.

firefoxbankrec2.png

firefoxbankrec3.png

Posted
urlFrame.JSInterface.JSCode(
  'Ext.defer(function(){'#1'.iframe.contentDocument.addEventListener("keydown", function(e){' +
      'ajaxRequest(' + Self.WebForm.JSForm.JSName + ', "keydown", ["key="+e.keyCode]);' +
    '});' +
  '}, 300);'
);

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...