1 (edited by dbk 2019-06-03 20:23:28)

Topic: Editable tablegrid problem > "table type has no column named id_type"

Hello friends,

I have a strange problem, i must be doing something wrong again.


I am making an editable tablegrid for a table that will hold combobox values (like gender: male or female). I have made a tablegrid like this before in the same project and it just works. Now i am making another one for a table called type which has one field (type, TEXT).


I set the tablegrid to allowedit etc, like the other one that works, but when i try to enter data i get an error dialog "table type has no column named id_type".


The debugging dialog shows "INSERT INTO "type" ("id_type") VALUES (NULL);"


I tried to add the data to the table using an editbox + save record button and this works, just not through the editable tablegrid.


Any ideas to what i might be doing wrong?
Thanks!

Re: Editable tablegrid problem > "table type has no column named id_type"

Hi DBK,
If you can attach your project, I'll have a look and see if I can spot anything.
Derek.

3 (edited by dbk 2019-06-04 11:58:25)

Re: Editable tablegrid problem > "table type has no column named id_type"

derek wrote:

Hi DBK,
If you can attach your project, I'll have a look and see if I can spot anything.
Derek.

Hello Derek,

Thanks for having a look!

Post's attachments

Attachment icon Edit grid.zip 333.62 kb, 271 downloads since 2019-06-04 

4 (edited by derek 2019-06-04 12:34:36)

Re: Editable tablegrid problem > "table type has no column named id_type"

Hi DBK,
It's the button that is causing a problem;  there are a couple of things to mention.
1.  Your 'add' button is trying to save the tablegrid (see screenshot.jpg highlighted in red) rather than fields.
2.  If you use editable tablegrids you don't need 'add', 'edit' or 'save' buttons at all.
3.  (this is the actual error).  If a button has it's 'default' property set (see screenshot.jpg highlighted in blue) then whenever 'enter' is pressed, the button is clicked (because it's the default!).  So what is happening is when you press 'enter' to save the editable tablegrid data, it is clicking the 'add' button instead - and then giving you the error.
To fix it, either set the 'default' property for the button to 'false' or remove the button completely - it's not currently doing anything.
Hope this makes sense.
Derek.

Post's attachments

Attachment icon Edit grid.zip 558.78 kb, 917 downloads since 2019-06-04 

Re: Editable tablegrid problem > "table type has no column named id_type"

derek wrote:

Hi DBK,
It's the button that is causing a problem;  there are a couple of things to mention.
1.  Your 'add' button is trying to save the tablegrid (see screenshot.jpg highlighted in red) rather than fields.
2.  If you use editable tablegrids you don't need 'add', 'edit' or 'save' buttons at all.
3.  (this is the actual error).  If a button has it's 'default' property set (see screenshot.jpg highlighted in blue) then whenever 'enter' is pressed, the button is clicked (because it's the default!).  So what is happening is when you press 'enter' to save the editable tablegrid data, it is clicking the 'add' button instead - and then giving you the error.
To fix it, either set the 'default' property for the button to 'false' or remove the button completely - it's not currently doing anything.
Hope this makes sense.
Derek.

Hello Derek,


Many thanks for taking your time (again) to help me! It makes perfect sense. But the thing is, when i was trying it yesterday, i didn't have the add button at first. I tried to add this (and other things) to try and get rid of the error. Anyway, i removed the button now and it just works smile so problem solved!


Thanks again for your help Derek!!