[Kexi] Autofield Checkboxes
Andy Choens
andy.choens at gmail.com
Sun May 6 21:09:34 CEST 2007
On Sunday 06 May 2007 02:29:05 pm Jarosław Staniek wrote:
> Thanks for your detailed report. Could you please send me (not to the list)
> a .kexi file where you have the problem?
>
No problem. I have attached a copy of my .kexi file, but I must report that I
think I figured out the problem, although I still consider it a bug.
I now understand that Kexi Boolean values can be one of three values, TRUE,
FALSE, and NULL. The default checkbox widget reflects this attribute and has
three default values. However, by default Kexi boolean fields are "Required"
to have a value by default. Interestingly, this produces an easily
reproducible bug when making forms.
The attached file, has an good example of this behavior. I created a table
called proof_of_concept with 1 primary key and 5 boolean fields. I used the
default kexi values.
I then produced a auto-generated form, called proof_of_concept, and I didn't
change any of the settings for the checkboxes.
So far, everything has behaved as I would expect it to. However, the problems
start soon enough. If I use the form to make an entry and mark field_one and
field_two true, everything works fine. Now, I want to save my work, so I hit
SHIFT/ENTER. But, then I change my mind and I decide that field 5 should also
be true. So, I check it to be true and hit SHIFT/ENTER and see that field_one
and field_two are magically reset to FALSE even though I want them to be set
to TRUE. Other changes to fields one-five will produce other, equally bizarre
behavior.
Note, I am not trying to change any of these fields to NULL, which isn't
allowed, I am simply trying to toggle them back and forth from TRUE to FALSE.
This is a micro-cosm of the problem that I've been dealing with for much
longer. I have MANY boolean fields, and before contacting the list, I wanted
to be absolutely sure I hadn't done something obvious and stupid. So I
checked and rechecked everything.
Now, to prove that the problem is related to the default settings, I have a
table called proof_of_fix. This table is ALMOST identical to
proof_of_concept. The only difference is that the boolean fields are NOT
required to have a value. Now when I auto-generate a form and start playing
around with toggling TRUE/FALSE value combinations of my fields, the form and
table respond EXACTLY how it should.
Somehow, and I don't know Kexi's internals well enough to know why, there is a
bug in behavior when a table has boolean values that are by design tri-state
but are required by the table design to only have the traditional binary
values.
I hope this explanation, and the attached file help you understand my problem.
If you have any other questions, feel free to drop me another email.
--andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug_report.kexi
Type: application/x-kexiproject-sqlite3
Size: 15360 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kexi/attachments/20070506/2ded54c1/attachment.bin
More information about the Kexi
mailing list