Question How can write Server script in Progress

Hi,
Can anyone tell how can Can I replace the get_users.php Or save_user.php by Progress code. any on line documentation / KBs / Live example will do.

TIA
-Philip-

<div id="toolbar">
<a href="javascript:void(0)" class="easyui-linkbutton"
iconCls="icon-add" plain="true"
onclick="javascript:$('#dg').edatagrid('addRow')">Add</a>
<a href="javascript:void(0)" class="easyui-linkbutton"
iconCls="icon-remove" plain="true"
onclick="javascript:$('#dg').edatagrid('destroyRow')">Delete</a>
<a href="javascript:void(0)" class="easyui-linkbutton"
iconCls="icon-save" plain="true"
onclick="javascript:$('#dg').edatagrid('saveRow')">Save</a>
<a href="javascript:void(0)" class="easyui-linkbutton"
iconCls="icon-undo" plain="true"
onclick="javascript:$('#dg').edatagrid('cancelRow')">Cancel</a>
</div>
<script type="text/javascript">
$(function(){
$('#dg').edatagrid({
url: 'get_users.php',
saveUrl: 'save_user.php',
updateUrl: 'update_user.php',
destroyUrl: 'destroy_user.php'
});
});
</script>
 

Stefan

Well-Known Member
0. include code in code tags please
1. call WebSpeed
2. call Web Services Adapter
3. call REST Adapter

Using jQuery with Web Services is very easy. Here is my quick hack at calling our Web Service to show data in a datagrid:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <title></title>
      <!-- DataTables CSS -->
      <link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css">
   </head>
   <body>
      <!-- jQuery -->
      <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js"></script>
      <!-- DataTables -->
      <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script>
      <script>
         $(document).ready(function(){
            strRequest = '<?xml version="1.0" encoding="utf-8"?>';
            strRequest = strRequest + '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:com.exact.efe:mcomp:mcomp">';
            strRequest = strRequest + "<soapenv:Header/><soapenv:Body>";
            strRequest = strRequest + "<urn:search>";
            // user object for user JQUERY
            strRequest = strRequest + "<urn:pi_csecurity_data>secret</urn:pi_csecurity_data>";
            strRequest = strRequest + '<urn:pi_dscontext6>';
            strRequest = strRequest + '<urn:itmpMcomp adm_nr="621">';
            strRequest = strRequest + '</urn:itmpMcomp>';
            strRequest = strRequest + "</urn:pi_dscontext6>";
            strRequest = strRequest + "</urn:search>";
            strRequest = strRequest + "</soapenv:Body></soapenv:Envelope>";
            $.ajax({
               type: "POST",
               url: "http://myserver/wsa/wsa",
               headers: {"SOAPAction": '""'},
               contentType: "text/xml; charset=utf-8",
               dataType: "xml",
               data: strRequest,
               success: function(xml) {
                  $(xml).find('otmpMcomp').each(function(){
                     var Col0 = $(this).attr('main_comp_code');
                     var Col1 = $(this).find('description').text();
                     var Col2 = $(this).find('entity_state_text').text();
                     $('<tr></tr>').html('<td>'+Col0+'</td><td>'+Col1+'</td><td>'+Col2+'</td>').appendTo('#search');
                  });
                  $('#search').dataTable();
               },
               fail: function(xml) {
                  alert('failed');
               }
            });
         });
      </script>
      <table id="search">
         <thead>
            <tr>
               <th>Main classification</th>
               <th>Description</th>
               <th>State</th>
            </tr>
         </thead>
      </table>
   </body>
</html>
 
Last edited:
Top