开发者

Provide JSON as data for rich:extendedDataTable

开发者 https://www.devze.com 2023-03-24 10:47 出处:网络
I am implementing a full text search in my project and for that the result of search comes from SOLR server as JSON.

I am implementing a full text search in my project and for that the result of search comes from SOLR server as JSON.

Is it possible to provide JSON for data or value attribute of the richfaces component extendedDatatTable or simple dataTable.

Resultant JSON would look something like :

`resultObj = {

    "numberOfResults":25,
    "results":[
    {
        "instanceId":100,
        "inj_Name":"Inj4",
        "i_IdentificationNumber":127,
        "noz_Name":"Nozzle4",
        "n_IdentificationNumber":460,
        "thr_Name":"Throttleplate4",
        "t_IdentificationNumber":0,
        "act_Name":"Atuator4",
        "a_IdentificationNumber":781
    },
    {
        "instanceId":100,
        "inj_Name":"Inj4",
  开发者_高级运维      "i_IdentificationNumber":127,
        "noz_Name":"Nozzle4",
        "n_IdentificationNumber":460,
        "thr_Name":"Throttleplate4",
        "t_IdentificationNumber":0,
        "act_Name":"Atuator4",
        "a_IdentificationNumber":781
    } ]
};

`

Regards,

Satya


As far as I know, no you can't. Your best bet would be to reflect this data into a List of Java objects using Gson and then use that list as a data source.

0

精彩评论

暂无评论...
验证码 换一张
取 消