Announcement

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

    Queuing

    I am thinking to implement Queuing into my project. I am not using JSPs nor SC back-end. My back-end is ASP + SQL Server. Can I still do Queuing? If yes, what would server code be?

    Thanks

    #2
    Hi Mark,

    Using the queuing interfaces as such (eg RPCManager.startQueue()) is not possible without the SmartClient Java Server, however, you can achieve similar functionality manually.

    Wherever you would otherwise call saveData() (on a form) or saveAllEdits() (on grids), instead store off changes (by calling form.getValues() or grid.getEditValues()) in an ordinary JavaScript Array.

    Then, come up with a format for how you want to transmit the changes to the server. For example, you could xmlSerialize the changes and use rpcManager.sendRequest() to POST the resulting XML to the server.

    Comment


      #3
      But I was thinking more for an initial pulling of data for all bound controls. Saving is not a problem, it takes no time, or a short one, but the inital load takes some time.

      Comment


        #4
        Hi Mark,

        You could do pseudo-queuing for loading initial data as well. In outline:

        1. Load all the data as one big XML file in one HTTP turnaround via loadXML.

        2. Use DataSource.recordsFromXML to extract each distinct dataset via recordXPath

        3. Manually create ResultSets for each loaded dataset, passing the records as resultSet.initialData

        Comment


          #5
          Here what I am doing. Can't get it work. Select does not have any data to show.
          Could you please help?
          Code:
          function populateDS (xmlDoc, xmlText)
          {
          	debugger;
          	var abc = Locationcodea.recordsFromXML(xmlDoc, isc.XMLTools.selectNodes(xmlDoc, "//locationcodesa"));
          	form1.getField("itemName").setValueMap(abc.getValueMap("id", "description"));
          }
          isc.XMLTools.loadXML("injuries/forms/injuries.asp?requesttype=send&datarequest=xml&methodexecute=mtestqueuing", "populateDS(xmlDoc, xmlText)");
          isc.DataSource.create({
          	ID:"Locationcodea",
          	dataFormat:"xml",
          	recordXPath:"//locationcodesa",
                  fields:[
                  {name:"description"}
              ]
           });
          
          isc.DynamicForm.create({
              ID: "form1",
              width: 200,
              numCols: 1,
              fields : [{
                  name: "itemName", title: "Item Name", type: "select",
                  pickListWidth: 250
              }]

          Comment


            #6
            Ok, I got it working. Posting a workable code in case anyone wants to use same idea:
            Code:
            <HTML><HEAD>
            	<SCRIPT>var isomorphicDir="common/isomorphic/";</SCRIPT>
                <SCRIPT SRC=common/isomorphic/system/modules/ISC_Core.js></SCRIPT>
                <SCRIPT SRC=common/isomorphic/system/modules/ISC_Foundation.js></SCRIPT>
                <SCRIPT SRC=common/isomorphic/system/modules/ISC_Containers.js></SCRIPT>
                <SCRIPT SRC=common/isomorphic/system/modules/ISC_Grids.js></SCRIPT>
                <SCRIPT SRC=common/isomorphic/system/modules/ISC_Forms.js></SCRIPT>
                <SCRIPT SRC=common/isomorphic/system/modules/ISC_DataBinding.js></SCRIPT>
                <SCRIPT SRC=common/isomorphic/skins/SmartClient/load_skin.js></SCRIPT>
                <SCRIPT SRC=common/isomorphic/login/reloginFlow.js></SCRIPT>
            </HEAD>
            <BODY>
            <SCRIPT>
            function populateDS (xmlDoc, xmlText)
            {
            	abc = Locationcodea.recordsFromXML(isc.XMLTools.selectNodes(xmlDoc, "//locationcodesa"));
            	isc.ResultSet.create({
            	ID: "xyz",
                    dataSource : "Locationcodea",
            	initialData : abc
                    });
            	form1.getField("itemName").setValueMap(xyz.getValueMap("id", "description"));
            
            }
            isc.XMLTools.loadXML("injuries/forms/injuries.asp?requesttype=send&datarequest=xml&methodexecute=mtestqueuing", "populateDS(xmlDoc, xmlText)");
            isc.DataSource.create({
            	ID:"Locationcodea",
            	dataFormat:"xml",
            	recordXPath:"//locationcodesa",
                    fields:[
            	{name:"id"},
                    {name:"description"}
                ]
             });
            
            isc.DynamicForm.create({
                ID: "form1",
                width: 200,
                numCols: 1,
                fields : [{
                    name: "itemName", title: "Item Name", editorType: "comboBox",
                    pickListWidth: 250
                }]
            });
            </SCRIPT>
            </body>
            </html>

            Comment

            Working...
            X