UI Widgets

Options

Hi,

I'm playing around with UI widgets that I found at KC.

In general I get the working but sometimes I receive error:

The browser refused to make the server call. Check that CORS is enabled on the server. The console and network panels from the browser debugging tools may show more information.

I'm running the following code:

<script src="http://83.142.96.202/imgcsd2/csui/csui.js"></script>

csui.onReady(function () { new csui.FolderBrowserWidget({ placeholder: "#browser", connection: { url: "http://83.142.96.202/csdev2/llisapi.dll/api/v1/", supportPath: "http://83.142.96.202/imgcsd2/"} }).display(); });

What is it about? How to solve it

Thanks

Uldis

Tagged:

Comments

  • Hi Uldis,

    This forum supports developers who wish to create applications with AppWorks. I will forward your query regarding Content Server UI Widgets to the correct people.

    Best wishes,

    Werner

  • Ferdinand Prantl
    Ferdinand Prantl E Community Moderator
    Options

    This error is usually caused by a misconfigured CS. The web browser "preflight" the AJAX requests to the REST API, but your web server blocked it. For example, you turned on WebDAV for the /csdev2 virtual directory. Another reason could be that you have a firewall or an unreliable network, which closes the TCP connection without returning any HTTP status code.

    In such cases, the browser makes the request fail without any error code (from security reasons). The application cannot tell you the real cause and you have to look at the browser "log" (console) to learn what happened. What errors do you see at the browser console? (You will find it in the browser developer tools.)

    A minor fix - the supportPath should contain just the URL path of the virtual directory pointing to the <csinstdir>/support; not the absolute URL:

    new csui.FolderBrowserWidget({
      placeholder: "#browser",
      connection: {
        url: "http://83.142.96.202/csdev2/llisapi.dll/api/v1",
        supportPath: "/imgcsd2"
      }
    }).display();
    
  • Hi Uldis,

    could you please let me know how did you resolve this issue..because i am also facing the same issue.

    Thanks, Naveen.

  • Ferdinand Prantl
    Ferdinand Prantl E Community Moderator
    Options

    Naveenkumar, you should open your web browser console at first. You'll find the actual error message displayed there. (The browser doesn't disclose it to the web page, that's why the error message is so general.) You'll see if the API URL was wrong or if the CORS headers were wrong.

    One of often encountered issues is WebDAV turned on for the virtual folder with the CGI executable/ISAPI filter. Check if is turned off in your web server configuration. (The WebDAV support should be enabled only for the /livelinkdav virtual folder.)