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 issue with using After Execute Update, etc...

Print topic Send  topic

Author Message
Curtis Paul
Posted: 07/27/2005, 6:11 AM

I'm basically doing a $db->query("UPDATE blaa blaa blaa WHERE something_record_id = ". $form->ds->f("something_record_id"));

and everything seems to work fine except that the UPDATE SQL is not getting something_record_id from the ds. So the SQL statement fails....something_record_id doesn't have a value...

It's like I can't use any of the ds data....I'm under the understanding that the events in an editable grid run through all the records that were selected when the page loads...

I've also tried putting the field in the grid so it's visible, and the correct ID's show up in the grid...and then use a $form->control->getvalue() to call it in for WHERE something_record_id =". but that doesn't work either....

How the hell am I supposed to index my UPDATE SQL if I can't get any data in from the form?

Anybody have any ideas on how idiotic I may or may not be? Any ideas on how I can get this to work?
Curtis
Posted: 07/27/2005, 7:26 AM

I'm trying this now...

http://forums.codecharge.com/posts.php?post_id=60507
donb

Posts: 52
Posted: 07/27/2005, 4:47 PM

The datasource feeding a grid is not pointing to a specific record, and probably is beyond the last record of the grid after the grid is filled with data.

But this is not a problem. The CachedColumns array contains all the primary keys. As the keys are maintained separately, the state of the datasource (with respect to. the grid) is not important.

Also, UPDATEs are not performed with the datasource pointing to any specific row of the result set, either. A SQL query is constructed to perform the UPDATE.

The value you are looking for is stored in the $wp array (that's the 'where parameter' data that is used to construct the UPDATE).

Trying to obtain the value with $form->control->GetValue() will not work in the After Update event.

Look in the php file of your page and specifically the UpdateRow and Update functions/methods of the grid 's datasource to see when the After Update event is raised. Also note the data structures created just prior to the event happening and you will see why you are having this problem.
_________________
http://www.gotodon.com/ccbth
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.

Web Database

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.