<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic create a qml object using javascript in ArcGIS AppStudio Questions</title>
    <link>https://community.esri.com/t5/arcgis-appstudio-questions/create-a-qml-object-using-javascript/m-p/1015489#M3735</link>
    <description>&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;i want to create qml object of the below code. can anyone help&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NetworkRequest {
    id: networkRequest
    url: "http://appstudio.arcgis.com/images/index/introview.jpg"
    responsePath: fileFolder.path +"/appstudio.jpg"

    property url imagePath: responsePath

   onReadyStateChanged: {
        console.log("Ready state"+readyState);
        if (readyState == NetworkRequest.DONE) {
        image.source = internal.folderUrl+"/appstudio.jpg";
       }
    }
   //onProgressChanged: console.log("progress:", progress)
    onError: {
        console.log(errorText + ", " + errorCode)
        //On failure, don't use the local copy
        image.source = ""
    }
}&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 11 Jan 2021 11:38:43 GMT</pubDate>
    <dc:creator>rsharma</dc:creator>
    <dc:date>2021-01-11T11:38:43Z</dc:date>
    <item>
      <title>create a qml object using javascript</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/create-a-qml-object-using-javascript/m-p/1015489#M3735</link>
      <description>&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;i want to create qml object of the below code. can anyone help&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NetworkRequest {
    id: networkRequest
    url: "http://appstudio.arcgis.com/images/index/introview.jpg"
    responsePath: fileFolder.path +"/appstudio.jpg"

    property url imagePath: responsePath

   onReadyStateChanged: {
        console.log("Ready state"+readyState);
        if (readyState == NetworkRequest.DONE) {
        image.source = internal.folderUrl+"/appstudio.jpg";
       }
    }
   //onProgressChanged: console.log("progress:", progress)
    onError: {
        console.log(errorText + ", " + errorCode)
        //On failure, don't use the local copy
        image.source = ""
    }
}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 Jan 2021 11:38:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/create-a-qml-object-using-javascript/m-p/1015489#M3735</guid>
      <dc:creator>rsharma</dc:creator>
      <dc:date>2021-01-11T11:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: create a qml object using javascript</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/create-a-qml-object-using-javascript/m-p/1015793#M3737</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/222605"&gt;@rsharma&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you mean creating QML objects dynamically? Take a look at this,&amp;nbsp;&lt;A href="https://doc.qt.io/qt-5/qtqml-javascript-dynamicobjectcreation.html" target="_blank"&gt;https://doc.qt.io/qt-5/qtqml-javascript-dynamicobjectcreation.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Erwin&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 23:29:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/create-a-qml-object-using-javascript/m-p/1015793#M3737</guid>
      <dc:creator>ErwinSoekianto</dc:creator>
      <dc:date>2021-01-11T23:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: create a qml object using javascript</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/create-a-qml-object-using-javascript/m-p/1015816#M3738</link>
      <description>&lt;P&gt;Just for your reference.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var newObj = Qt.createQmlObject("import QtQuick 2.12;import ArcGIS.AppFramework 1.0; NetworkRequest{id:networkRequest}", root, "");
newObj.onReadyStateChanged.connect(function f(){
    console.log("Ready state:" + newObj.readyState)
    if (newObj.readyState === NetworkRequest.DONE){
        console.log("done")
    }
})
newObj.url = "http://appstudio.arcgis.com/images/index/introview.jpg"
newObj.send();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 02:28:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/create-a-qml-object-using-javascript/m-p/1015816#M3738</guid>
      <dc:creator>SeanKim</dc:creator>
      <dc:date>2021-01-12T02:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: create a qml object using javascript</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/create-a-qml-object-using-javascript/m-p/1016291#M3744</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/20256"&gt;@SeanKim&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i check for newtworkrequest done, it always give me the error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; if (newObj.readyState === NetworkRequest.DONE){
        console.log("done")
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ReferenceError: NetworkRequest is not defined&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;so i tried like this way&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(newObj.readyState===4){
            console.log("done");
            DB.insertMediaDetails(dev_href_fname,ref_no,ref_type);
            console.log("done inserting");
            return dev_href_fname;
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;calling fnc DB.insertMediaDetails(dev_href_fname,ref_no,ref_type);&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;but it always return&amp;nbsp; fron this cond before readystate become 4 and return undefined&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 10:36:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/create-a-qml-object-using-javascript/m-p/1016291#M3744</guid>
      <dc:creator>rsharma</dc:creator>
      <dc:date>2021-01-13T10:36:53Z</dc:date>
    </item>
  </channel>
</rss>

