Jump to content

Multiple HtmlFrames on one Form, Each Frame contains unique JS Code, Calling UniSession.AddJS gets confused between Frames ?


Recommended Posts

Posted

TopHtmlFrame contains <img id='01'
TopHtmlFrame contains script markTop

LeftHtmlFrame contains <img id='01'
LeftHtmlFrame contains script markLeft

 

UniSession.AddJS(markTop("01"); works as expected 

UniSession.AddJS(markLeft("01"); ACCESSES TopHtmlFrame <img id='01'

 

I have tried
UniSession.AddJS('markLeft("01")');

I have tried
UniSession.AddJS('fMain.LeftHTMLFrame.JSName.markLeft("01")');

I have tried
LeftHTMLFrame.JSInterface.JSCode('markLeft("01")');

 

I have tried
                '      function markLeft(id) '+
                '      { '+
                '        var img = document.getElementById(id); '+
                '        if (!img) {return null} '+
                '        img.style.border = "3px solid red"; '+
                '      } '+

I have tried
                '      function markLeft(id) '+
                '      { '+
                '        var img = sender.document.getElementById(id); '+
                '        if (!img) {return null} '+
                '        img.style.border = "3px solid red"; '+
                '      } '+

I have tried
                '      function markLeft(id) '+
                '      { '+
                '        var img = fMain.LeftHTMLFrame.JSName.document.getElementById(id); '+
                '        if (!img) {return null} '+
                '        img.style.border = "3px solid red"; '+
                '      } '+

Please advise - thanks in advance

 

Posted

Hello, 

this topics maybe will help to You: 

 

And try this:

 

  '      function markLeft(id) '+
'      { '+
'        var img = document.getElementById(' + YouFrame.JSid + '); '+
'        if (!img) {return null} '+
'        img.style.border = "3px solid red"; '+
'      } '+

Posted

Thanks for the id info Sherzod.

Note to Sherzod, HtmlFrame Ext Ajax Event AfterRender ONLY FIRES ONCE (I believe it should fire after every EndUpdate).

Posted
1 hour ago, andyhill said:

HtmlFrame Ext Ajax Event AfterRender ONLY FIRES ONCE

Yes, correct. 

1 hour ago, andyhill said:

I believe it should fire after every EndUpdate

No. 

Posted

IrigSoft, I had already coded my work around (unique id's across ALL HtmlFrames [I foolishly believed they were unique frames/js]) but definitely will review your suggestion over time - thank you.

Posted
58 minutes ago, andyhill said:

IrigSoft, I had already coded my work around (unique id's across ALL HtmlFrames [I foolishly believed they were unique frames/js]) but definitely will review your suggestion over time - thank you.

Thank You.

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...