how to save data when selecting a row from a table widget

1
0
-1

hi , i have a table of 10 rows *10 columns populated from a database i want to select a row from a table and get the data from this row . i have looked into this http://community.bonitasoft.com/groups/french-corner/resolved-s%C3%A9lec...

they said that i can use a javascript code, can someone be more explicit ? thank you

1 answer

1
0
-1

please someone can help?

Comments

Submitted by amine250 on Tue, 04/28/2015 - 20:27

I'm not a Bonita experienced user but I'm sure we can find a way if you explicit your question.

Is your table a widget in a pageform? You want select a row from the table widget or from a table in the database?

Regards

Submitted by mehdinaciri03 on Tue, 04/28/2015 - 22:23

yes my table is a widget in the platform ,i want to select a row from the table widget

Submitted by amine250 on Tue, 04/28/2015 - 22:37

By "getting the data from this row", I understand you want to store it in variables in your process. If so, can't you get the data directly from the database??

Submitted by amine250 on Wed, 04/29/2015 - 11:27

I see what you're actually struggling with. I actually am too. The selected list actually returns only the content of the first column of a row, maybe it's a bug ?

If you ever find a solution, can you please post it?

Regards.

Submitted by mehdinaciri03 on Wed, 04/29/2015 - 11:51

yeah i think its impossible to do with the widget ,i saw in a different post that u can use javascript but i dont know how. however u can use that first column of a row in a query to retrieve the others data of the row from the database

Submitted by amine250 on Wed, 04/29/2015 - 12:03

I actually found what I would call a semi-solution.

You can't get the whole row in a list but you can get ONLY ONE field from the table.

Using "from column with index" option which is misplaced in my opinion, we tend to think it's related to the List of initial values. See the image below.

a

You put the column index which data you want to get and you can use the following script (in the image it's called getNumPolice) to store the data.

return field_Table1.get(0);

Note: The return type is a String. field_Table1 is a list of ONE String object.

Hope this helps, Regards.

Submitted by mehdinaciri03 on Wed, 04/29/2015 - 12:06

yes and u can use that numero_police to retrieve all the data from the row with a query like "select * from db where id_police =numero_police

Submitted by amine250 on Wed, 04/29/2015 - 12:09

Exactly, it's not very "pratique" but whatever :p

Submitted by mehdinaciri03 on Wed, 04/29/2015 - 12:14

i guess we'll have to deal with it ,thank you

Notifications