CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Editable Grid BeforeExecuteUpdate Trigger - Custom Code Issue.

Print topic Send  topic

Author Message
EoN

Posts: 6
Posted: 04/18/2007, 5:42 AM

Hi all,

I'll try to keep my issue as simple as possible.

I have an editable grid in which I am dynamically building the html table rows up via javascript on the client side. (The editable grid does NOT originally select from the database, it starts out as an empty table. The BeforeSelect event currently has $GRID_NAME->ds->CmdExecution = false; )

When the form is submitted, I have put custom code in the BeforeExecuteUpdate trigger to actually change the SQL to "INSERT" statements based on the submitted editable grid (the trigger is called once per row).

My problem is this. It would appear that CodeCharge will only INSERT as many rows as there are EXISTING RECORDS In the DATABASE TABLE. This is not what I want. So for example if there happen to be 2 records in the table, but my editable grid has 5 records (dynamically created on the client side) that I wish to submit, only 2 of those will be stored. Ie it seems the BeforeExecuteUpdate trigger is only called twice (as it thinks it is doing an update).

If on the other hand I happen to have 10 rows in my db table, all 5 editable grid records will be stored perfectly. So it's something to do with me turning the "ExecuteUpdate" event into insert functionality.

I suspect it may have something to do with $GRID_NAME->TotalRows, $GRID_NAME->EmptyRows or $GRID_NAME->UpdatedRows, but I'm not sure if I'm on the right track, or where or how to apply changes.

Any help would be greatly appreciated! Hopefully it all makes sense!

EoN.
View profile  Send private message
EoN

Posts: 6
Posted: 04/19/2007, 4:55 PM

Anyone, please?!? Just a point in the right direction would be much appreciated!?

Maybe the answer might lie in whichever variable codecharge sets/uses to determine how many times the "BeforeExecuteUpdate" trigger is fired. Does anyone know which this is? As I need to modify that.

View profile  Send private message
jennyhorn


Posts: 4
Posted: 06/16/2007, 10:00 AM

Your empty insert rows don't fire the BeforeExecuteUpdate but they would fire a BeforeExecuteInsert or you could set some defaults on them causing them to insert for you.
_________________
Jenny A. Horn MBA
Axis Open Source Corporation
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.