Announcement

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

    Unexpected IDACall when calling setContentsURL without parameters

    Hi there,
    We are hosting the smartclient-js on cloudfront and have seen a lot of 404 errors for IDACall url.

    After a while searching for it we do know where this is come from. When calling setContentsURL on a HtmlPane it creates an Ajax request to IDACall which does is not there, so a 404 is the result.

    In the docs both parameters of the method setContentsURL are optional, but this does result in the IDACall.
    https://www.smartclient.com/smartcli...setContentsURL

    Setting contentsType to "page" removes the IDACall, but the docs are not referencing to this.
    In the HTMLPane we are setting either a pdf-document or a centered-dummy text.

    This happens in all browsers and with the latest valid build (SmartClient_v111p_2017-08-29_Pro).

    Code:
    isc.Button.create({
        "ID": "theButton",
        "top": 0,
        "left": 0,
        "width": 150,
        "click": function () {
            thePane.setContentsURL();
            thePane.setContents("<div style=\"display: table; height:100%; width:100%; text-align: center;\">\t<span style=\"display: table-cell; vertical-align: middle; font-weight:bold\">no content shown<\/span><\/div>");
        },
        "title": "click me for IDACall 404",
    })
    isc.HTMLPane.create({
        "ID": "thePane",
        "top": "50",
        "backgroundColor": "#FFDDFF",
        "width": "300",
        "height": "100",       
        "contents": "<div style=\"display: table; height:100%; width:100%; text-align: center;\">\t<span style=\"display: table-cell; vertical-align: middle; font-weight:bold\">no content shown<\/span><\/div>"
    })
    Best regards

    #2
    Per documentation calling setContentsURL() with no parameters causes a refresh against the previously set URL, if any. In your test case you never set the URL. Why is your code calling it that way?

    Comment


      #3
      If hthe HTMLPane hast the contentsType page, setting new content does not work by default, calling setContentsURL() with no parameters does enable the possibility to set the contents correctly.
      I think we only should call setContentsURL() when the contentsType is "page", then it would all work as expected. By now we are also calling setContentsURL() if the contentsType is not "page"

      This should be the right fix for not getting an unknown IDACall.

      For further explanation:

      Code:
      isc.Button.create({
      "ID": "theButton",
      "top": 0,
      "left": 0,
      "width": 150,
      "click": function () {
      thePane.setContentsURL();
      },
      "title": "non IDACall 404",
      });isc.Button.create({
      "ID": "theButton1",
      "top": 0,
      "left": 160,
      "width": 150,
      "click": function () {
      thePane.setContentsURL("http://che.org.il/wp-content/uploads/2016/12/pdf-sample.pdf");
      },
      "title": "set PDF",
      });
      isc.Button.create({
      "ID": "theButton2",
      "top": 0,
      "left": 320,
      "width": 150,
      "click": function () {
      thePane.setContents("<div style=\"display: table; height:100%; width:100%; text-align: center;\">\t<span style=\"display: table-cell; vertical-align: middle; font-weight:bold\">no content shown<\/span><\/div>");
      },
      "title": "Set text",
      });
      isc.Button.create({
      "ID": "theButton3",
      "top": 30,
      "left": 320,
      "width": 150,
      "click": function () {
      thePane.setContentsURL();
      thePane.setContents("<div style=\"display: table; height:100%; width:100%; text-align: center;\">\t<span style=\"display: table-cell; vertical-align: middle; font-weight:bold\">no content shown<\/span><\/div>");
      },
      "title": "Set text & setContentsUrl",
      })
      
      isc.HTMLPane.create({
      "ID": "thePane",
      "top": "100",
      "backgroundColor": "#FFDDFF",
      "width": "300",
      "height": "100",
      "contentsType":"page",
      "contents": "<div style=\"display: table; height:100%; width:100%; text-align: center;\">\t<span style=\"display: table-cell; vertical-align: middle; font-weight:bold\">no content shown<\/span><\/div>"
      });
      Best regards

      Comment

      Working...
      X