CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Editable Grid Problem with Listboxes

Print topic Send  topic

Author Message
pkrawetz

Posts: 77
Posted: 06/07/2004, 3:24 PM

I have an editable grid (the only object on the page) which has 1 empty row when displayed. After adding a row, the page is redisplayed with the new row and one empty row. When I click the delete checkbox and press Submit, I get an SQL error on an insert statement. It appears that the grid is trying insert the empty row. When I redisplay the page, the row which I checked off for deletion was deleted.

How do I stop it from displaying the SQL error on the empty row? This only appears to happen when I have a listbox in the grid. I have another page with an editable grid and only textboxes. That page works just fine.
View profile  Send private message
ghtracey

Posts: 23
Posted: 06/07/2004, 3:32 PM

Just out of curiosity (because this sounds familiar :D) do you have any hidden fields in the grid that you set values into?

I ran into the same issue, it was caused by me programmatically setting the values of hidden fields. This caused the engine to think that data had been entered into the form causing an insert to be triggered. I eventually coded a check to see if the hidden fields were all that was set, and if so, setting InsertAllowed false.
_________________
Graham Tracey
Council of Yukon First Nations
View profile  Send private message
peterr


Posts: 5971
Posted: 06/07/2004, 3:36 PM

Actually if the default value of the ListBox is set to something than it will be submitted and the program will think that the user selected that value. You would need to set the ListBox value to null/blank, so that nothing gets submitted when nothing was selected.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
pkrawetz

Posts: 77
Posted: 06/07/2004, 4:30 PM

Bingo. There is a hidden field on the grid. I didn't think that was the problem but the hidden field gets set during the onload event. Thanks for the information. I'll have to try setting InsertAllowed to false.
View profile  Send private message
pkrawetz

Posts: 77
Posted: 06/07/2004, 4:32 PM

ghtracey, where did you place the code to set the InsertAllowed to false?
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.