Page 1 of 1

Creating Links Using Rest output

Posted: Tue Jul 17, 2012 7:11 am
by Geeth

Hi ,
I got a REST Service that maps a results to a grid. But not all the data are mapped shown in the grid. because some data are need to call a another web service when the user clicks on the cell.

Let me explain it this way.

  1. Rest service returns json object in which one object contains around 10 parameters. (All of them are identical through out the object)

  2. Four parameters mapped into the grid.

  3. Remaining 6 parameters has to be used as an input to a rest service which would be invoked if user clicks on the first cell of the every row of the grid.

    Q1. My question is where would I keep the six remaining parameters?

    (It cannot be mapped to local storage because there would a lot object passed as json by the rest. I have included sample json object which has two objects. but original one could have around 100 objects.

    Q2. How do I pass them to rest service once user clicks on the cell?

    Thanks

    Sample json object

    {"flkData":[
    {
    "type":"bank",
    "count":7,
    "currency":"LKR",
    "excluded":true,
    "user_account_id":33,
    "account_balance":12061.09,
    "last_updated_date":"2012-01-11 16:30:17.0",
    "fiName":"Sampath Bank",
    "is_manual":0,
    "sortId":0,
    "showFLKBalance":0,
    "userId":0,
    "flk_balance":-96600.0,
    "primaryUserAccId":0,
    "userCredentialId":12,
    "fiCode":"SMP",
    "secNickName":null,
    "secUserNickName":null,
    "secUserAccId":0,
    "secAccNo":null,
    "secCreditNo":null
    },

    {
    "type":"bank",
    "count":8,
    "currency":"LKR",
    "excluded":true,
    "user_account_id":34,
    "account_balance":12066767.09,
    "last_updated_date":"2012-01-11 16:30:17.0",
    "fiName":"Sampath Bank",
    "is_manual":0,
    "sortId":0,
    "showFLKBalance":0,
    "userId":0,
    "flk_balance":0.0,
    "primaryUserAccId":0,
    "userCredentialId":12,
    "fiCode":"SMP",
    "secNickName":null,
    "secUserNickName":null,
    "secUserAccId":0,
    "secAccNo":null,
    "secCreditNo":null
    }

    ]}


Creating Links Using Rest output

Posted: Tue Jul 17, 2012 7:16 am
by Geeth

Json object above might have more than 10 parameters. I need only around 10 from them

Thanks


Creating Links Using Rest output

Posted: Tue Jul 17, 2012 3:26 pm
by maxkatz

You could store them on the page, as hidden fields for each object row. When you click on an item, you would store just the 6 elements in local storage. You can read them on the next page and/or use them for service invocation.

If you don't want to store these values in the client, then the other option is to make another request to the service to get them.

Hope this helps..