Display db query results in editable grid or table

1
0
-1

Good Day,

I'm using BPM Community Edition 6.2.1

I have a db query which would result in 12 column/fields with multiple rows/records. I would need to put these information into an editable grid/table.

How do I put these in the editable grid/table?

Thank you

2 answers

1
0
-1

hi @DeclanMcGarry,please can you help me and be more explicit this is exactly what i want to do!

Comments

Submitted by yannick.lombardi on Wed, 04/22/2015 - 10:52

On what point do you need more details ?

Submitted by mehdinaciri03 on Wed, 04/22/2015 - 11:10

for now im just in the step 2. Display the list of lists in the editable grid. i connected my bonita step to MS sql 2008 db ,i test it and it works great . my query return 10 *12 table how can i take the result and display it in a table . im confused with the widget which one should i use ?

thank you

Submitted by yannick.lombardi on Wed, 04/22/2015 - 11:28

If you want an editable grid, you need to use the "Editable grid" widget. Then, in the "Data" tab of this widget, you set the first field with your list of list variable.

Submitted by mehdinaciri03 on Wed, 04/22/2015 - 11:30

how to create a list of list variable ??

Submitted by yannick.lombardi on Wed, 04/22/2015 - 11:36

In the "Data" tab of your process, add a variable. In the "Data type" of this variable, choose "Java Object". By default, the java object is a list, so you don't need to change the Class.

Don't forget to set fill this variable with the output of your sqlServer connector.

1
0
-1

Hi Alfred,

an editible grid requires a list of lists as the initial data for display. you can populate that list of lists manually from the resultset that is returned from the query, or you can (in some cases) just use the resultSet - effectively casting a resultset to a List of Lists. There are times when this will not work, depending on the data types that are returned in the resultset.

The point of making the grid editable, i guess, is so that you can make a change to a record and have that record written back to the DB. correct?

This is something you have to do manually. Using the following steps:

1. Save the resultset to a list of lists. Make sure that the resultset has a unique key value.

2. Display the list of lists in the editable grid.

3. Save the editable grid to a different list of lists.

4. after the form is submitted, compare the list of lists from 1. to the list of lists from 3. If there are any differences, then run an update query / api call on the appropriate record using the unique key from 1.

-declan

Comments

Submitted by ale.ghirardi on Wed, 06/04/2014 - 21:02

Hi, as a list of lists generated? I need to display in an editable table product id and product name. Both data I bring a Mysql database

Notifications