Displaying/editing boolean fields in a form

Hi: New to Servoy - great product! Not sure if this is a bug/feature request, or I’m not understanding something…

Environment: Servoy Developer
Version R2 2.0 rc11-build 270
Java version 1.4.2-34 (Mac OS X). Repository is on local Firebird database.

I have a form that is connected to an external PostgreSQL database table. The table has a PostgreSQL column of type boolean that I need to have displayed and editable on the form.

I can’t display or edit this column in a Servoy form. I believe this is because the dataprovider for the boolean is cast as an integer in Servoy. The behavior I’ve gotten when trying several things has varied:

  1. Nothing is displayed if field is set as a TEXT_FIELD. However, I was able to assign a valuelist with values ‘true’ and ‘false’ to the list and got that to display the proper value in the field. However, when I changed the valuelist to display ‘t’ and ‘f’ and then changed back, I have been unable to duplicate the behavior, and now nothing displays in the field. Changing the field display to COMBOBOX with the valuelist produced the following error when trying to display the form: WrappedException of java.lang.IllegalArgumentException: Cannot format given Object as a Number.

  2. I have been unable to change the boolean field in the backend database. If I type ‘true’, ‘false’, ‘t’, or ‘f’, nothing happens (entry turns red). If I try a 1 or 0 in the field, I get the following error: java.sql.SQLException: ERROR: column “loc_from_site” is of type boolean but expression is of type integer
    You will need to rewrite or cast the expression

How do I interact with a backend boolean column through Servoy?

Have you tried to set the field as displaytype: CHECK ?
(without a valuelist!)

Thanks, but I still have the same problem. No display of the boolean (no check) and if I try to put a check in the box, I get the same javaSQL error…

Anybody worked with backend columns of type boolean?

this seems to be a problem currently with postgresql and booleans

the problem is that we don’t have real boolean support at our database level but it is always an integer so 1 or 0.. But if we send that to postgresql it will return an error. We need to send true or false..

We have to check this out first how we are going to fix this. For know please use a int (tinyint) and store it as 1 or 0