Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Working with own Component in Smartclient 10.1

    Hi there,

    I'm testing the new 10.1 ans it seems there is a issue while creating our own component. I'm using SmartClient_v101p_2015-12-13_Pro.
    I'm getting this error:
    Code:
    *17:12:04.074:XRP2[E0]:WARN:Log:TypeError: iframeElem is null
    Stack from error.stack:
        ._assignRectToHandle()
        ._setHandleRect()
        .__adjustOverflow()
        ._adjustOverflow()
        .adjustOverflow()
        ._completeChildOverflow()
        .layoutChildren()
        .drawChildren()
        .draw()
        .layoutChildren()
        .drawChildren()
        .draw()
        .layoutChildren()
        .drawChildren()
        .draw()
        .layoutChildren()
        .drawChildren()
        .draw()
        .layoutChildren()
        .reflowNow()
        .reflow/<()
        .runTeas()
        ._clearThread()
        ._fireXMLCallback()
        .sendXmlHttpRequest/loadFunc()
    This does happen at this line : "iframeElem.setAttribute("width", this.getInnerContentWidth());" (Line 64676 in ISC_Core.js)
    Code:
    _data_page_spaceAttrName: "data-isc-page-space",
    _assignRectToHandle : function (left,top,width,height,styleHandle) {
        if (this.containsIFrame()) {
            var iframeElem = this._getURLHandle();
    
            iframeElem.setAttribute("width", this.getInnerContentWidth());
            iframeElem.setAttribute("height", this.getInnerContentHeight());
        }
    The same application code was running fine with Smartclient 10.0.
    I'm generating a AceEditor-Class which is defined as subclass of HTMLFlow. Do I have to change something, or is this a framework-issue itself?
    Code:
    isc.defineClass("AceEditor","HTMLFlow").addProperties({
    Best Regards

    #2
    We this partial information, all we know is that the iframe that the HTMLFlow normally automatically creates is unexpectedly missing. This could be because your code to integrate with Ace wiped it out - you could take a look at the DOM and see if this is the case, and if it is, try to modify your code, as it looks like it must have been relying on details of the rendered DOM (which is considered internal and subject to change without notice).

    If that doesn't help, a runnable test case is always the sure-fire way for us to be able to tell you if there's a bug, and fix it if there is.

    Comment


      #3
      Thanks for the response.

      With Smartclient 10.0. theAceEditor is loaded and is displaying the preset value.
      With Smartclient 10.1 I get this error:
      Code:
      WARN:Log:TypeError: _6 is null
      Stack from error.stack:
          Canvas._assignRectToHandle()
          Canvas._setHandleRect()
          Canvas.._adjustOverflow()
          Canvas._adjustOverflow()
          Canvas.adjustOverflow()
          Canvas._completeHTMLInit()
          Canvas.draw()
          Class.invokeSuper()
          Class.Super()
          HTMLFlow.draw()
          Class.invokeSuper()
          Class.Super()
          .draw()
          [c]Class.init()
          Class.completeCreation()
          [c]Class.create()
          unnamed() @ 2015-12-15_AceEditorError.html:21:1
      I'm able to reproduce this with this files:
      Code:
      isc.AceEditor.create({
          "ID" : "aceEditor",
          "hideUsingDisplayNone" : false,
          "contentsType" : "page",
          "contentsURL" : "2015-12-15-AceEditorTemplate.html",
          "value" : "asdasd",
          "editorWordWrap" : true,
          "editorTheme" : "chrome",
          "editorMode" : "xml",
          "width": 600,
          "height": 300,
      });
      2015-12-15-AceEditorTemplate.html:
      Code:
      <!DOCTYPE html>
      <html lang="de">
          <head>
              <meta charset="UTF-8">
              <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
              <title>AceEditor</title>
              <script src="/ace-editor/ace.js" type="text/javascript" charset="utf-8"></script>
              
              <style type="text/css" media="screen">
              body {
                  overflow: hidden;
              }
              #editor {
                  margin: 0;
                  position: absolute;
                  top: 0;
                  bottom: 0;
                  left: 0;
                  right: 0;
              }
              </style>
          </head>
          <body>
              <pre id="editor"></pre>
              <script>
                  var editor = ace.edit("editor");
                  window.parent[window.callbackId]();
              </script>
          </body>
      </html>

      I cannot nail it down other than there might were some changes in the calling structure of smartclient between 10.0 and 10.1.
      Do you have any hint how can I fix this? It's quite hard to debug isomoprhic without understanding the complete calling-structure.

      Best Regards
      Last edited by SimonF; 16 Dec 2015, 07:08. Reason: removed ace-editor component

      Comment


        #4
        Well, the problem is pretty straightforward, and we don't really see how this could have worked in any version of our software: you are using an HTMLFlow and using the contentsType:"page", which normally causes the HTMLFlow to generate an iframe in getInnerHTML(), which it then manages. But you've also overridden getInnerHTML(), which destroys the functionality of the HTMLFlow that you enabled with contentsType:"page" - it no longer generates the iframe. So the consequence of course is that the HTMLFlow tries to find the iframe it normally renders into the page, and it's not there.

        Do one or the other: either tell the HTMLFlow to create an iframe for you, or make your own.

        Comment


          #5
          Thanks, I was able to fix it.

          Comment

          Working...
          X