GPAS 14, Sencha ExtJS Code Changes

In version 14 of PUM, the code generator has changes for the Sencha ExtJS development. Enum.js The code generator in previous versions produced a syntax error in the enumeration definition file (e.g. Enum.js) by leaving out a “,”. I fixed this now. PumProxy.js Somehow over the years I introduced a silent error in the code…

In version 14 of PUM, the code generator has changes for the Sencha ExtJS development.

Enum.js

The code generator in previous versions produced a syntax error in the enumeration definition file (e.g. Enum.js) by leaving out a “,”. I fixed this now.

PumProxy.js

Somehow over the years I introduced a silent error in the code generation for the store structures in ExtJS. When a store wants to read the data from the Gemstone/S database and got an error (e.g. session is not valid any more), the call failed, but no error message was display.

The handling is done in the proxy class (PUMProxy.js or PumProxy-template.js) and I rewrite the exception handler in that class to handle it better and to display the message if needed.

Api,js

Also the Ajax-request handling had been rewritten. Due to the fact, that API errors are now delivered via 4xx or 5xx return codes, this had to be done to get useful error messages.

The logic is now working as expected. Look at the function “SendRequest” at Api.js.

So, a simple API call structure should be done in this way:

// Set the parameter for the APi call
aES3APIParCustomerAndLanguageList
   .setElectionKeyField(record.getKeyField());

// DO the API call
es.Api.CustomerAndLanguageList(aES3APIParCustomerAndLanguageList)

// and handle both cases of result ways ...
  .then(aES3APIResCustomerAndLanguageList => {
    if (aES3APIResCustomerAndLanguageList.getSuccessField()) {
      // do the stuff in the successfull way
    } else {
       // Here is the path, where the APi was ok, but an error has been
       // signaled. Here a simple MessageBox is shown
       es.Api.HandlePUMAjaxErrorResult( 
         msgTitle, 
         null, 
         null, 
         aES3APIResCustomerAndLanguageList);
    }
   },
   resp => 
     es.Api.HandlePUMAjaxErrorResult( 
       msgTitle, 
       resp.response, 
       resp.options, 
       resp.result))
  .done();

So, that’s for the Javascript side in release 14

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.