Problem with select and transmit content

Hi,

I try to fill a select list with the content of the database field (id)
So I can fill the select list with the id’s of my database but when I try to send the value to an another form I can’t.

I have on the component an error of type field.

My code:

  1. I create a Pool variable : listofId (java.util.List)

  2. I create a connexion in
    2.1) I edit expressions with that code :
    def script = “”
    script =“SELECT Id FROM demo”

  3. The code and the last screen
    http://s15.postimg.org/l6q6gzitn/screen_for_the_code.png

Regards
BLE

try this

``
import java.sql.ResultSetMetaData;

List list = new ArrayList();

resultset.beforeFirst();

while (resultset.next()) {
list.add(resultset.getString(“id”));
}

return list;
``

remplace id with your column name.

Hi,

Can you explain me where I put this code! and how too use it to export value with the select component

Regards
BLE

this is only to retrieve data from database. replace your resultset with it. i dont quiet understand “export value” ? are you trying to Insert your selected value into the database ? if that so , i’m having same issue and waiting for a solution. sorry my friend.

Ok, thank’s for your answer, but I can retrieve my data dro the database ans insert it into the select, I just need to export the value selected to the other form.

If I find a solution, I upload it.

Regards
BLE