Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Let us consider an example where details of two Contra Account numbers need to be displayed in the Sweep Structure List widget with offline data on the mobile app. The details of the contra accounts such as, contra account number, control account number, currency, sweep amount, sweep frequency, sweep type, etc. along with the Widget ID needs to be in beforeDataLoad.

For this example, the beforeDataLoad structure would be as follows:

Code Block
languagejs
CWEH.registerHandler('WGT_STRUC_LIST','beforeDataLoad', 
function (widgetId,paramss,netState,callback)
{

...


   var params=

...


   {
      "response":

...

 
      {
         "data":

...

 
         {
            "ALL_RECORDS":

...

 
            [{
                "AMOUNT": "5,000.00",

...


                "CONTRA_ACC_CCY": "USD",

...


                "CONTRA_ACC_NO": "4324617483242",

...


                "CONTROL_ACC_CCY": "USD",

...


                "CONTROL_ACC_NO": "4324964324643",

...


                "EXEC_FREQ": "Daily",

...


                "INSTR_END_DATE": "10/15/2015",

...


                "INSTR_ID": "2.0",

...


                "INSTR_START_DATE": "04/15/2014",

...


                "NEXT_EXEC_DATE": "09/30/2014",

...


                "STATUS": "Suspend",

...


                "STR_ID": "10021.0",

...


                "STR_NAME": "ZFS A CORP",

...


                "STR_TYPE": "Cross Currency Sweep",

...


                "SWEEP_TYPE": "Zero Balance"

...


             },
             {
                "AMOUNT": "25,000.00",

...


                "CONTRA_ACC_CCY": "USD",

...


                "CONTRA_ACC_NO": "7397862340148",

...


                "CONTROL_ACC_CCY": "USD",

...


                "CONTROL_ACC_NO": "103456623751",

...


                "EXEC_FREQ": "Daily",

...


                "INSTR_END_DATE": "01/24/2015",

...


                "INSTR_ID": "1.0",

...


                "INSTR_START_DATE": "01/25/2014",

...


                "NEXT_EXEC_DATE": "10/04/2014",

...


                "STATUS": "Active",

...


                "STR_ID": "10532.0",

...


                "STR_NAME": "GSD A CORP",

...


                "STR_TYPE": "Cross Border Sweep",

...


                "SWEEP_TYPE": "Range Balance"

...


             }],

            'ADDITIONAL_DATA':

...


            {
               'MODIFIED_COLUMN_NAMES':

...


               {
                  CURRENCY: "Currency"
               }
            }
         },

         syncMode:true,
         cancelLoad:false,
         dataMerge:true,
         uniqueColumn: "ACCOUNT_NO"
      }
   };
   callback.apply(this,[params]);

...


});

...

 

CWEH.registerHandler'<WIDGET_ID>','afterDataLoad', 
function (widgetId,paramss,netState,callback)
{

...


   LOGGER.info('response', response)

...


});


The following screen shot displays the Sweep Structure List widget with and without internet connectivity. The screen shot on the left-hand side shows the Sweep Structure List widget with remote data (with Internet) and the right-hand side shows the Sweep Structure List widget with local data (without Internet). Image Removed

Image Added