CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> IDE/GUI

 Custom update in multi-tables query editable grid

Print topic Send  topic

Author Message
xcoder

Posts: 1
Posted: 09/26/2004, 2:50 AM

Hi,
First excuse my poor english.

I'm using Codecharge Studio 2.3.2.24, my project is in PHP+MySQL.

I have created an editable grid with is a JOIN select query.
I want to allow users to change and update only one field per row, "publication". I converted every other control to textbox (except the primary key "id_record" -> hidden textbox).
When the editable grid retrieves the database values it's ok, each textbox reflects correctly the database values.

I created a custom update query, which update the database field "publication" for each row:
Parameters :
publication publication Control
Where:
id_record={id_record}

The problem comes here :
When I submit the grid, ALL of the records are updated with the LAST row value.

What can I do ?

Thank you for your reply.

View profile  Send private message
Anton Hinxman
Posted: 12/14/2004, 11:23 AM

Yep, I had this as well, until...

The light dawned on me and I realised that I was looking at spent data.

What do I mean 'spent data'?

In the MVC the page was submitted and all the data resides in the data portion of the model so any value you look at in the 'view' of the grids controls is the last row value. Basically do not use the control values at this stage. It is all sql builds using the data portion of MVC at this point.

I do Java, not PHP, but you need to get at the parameters used to build each submitted sql update in the 'Before Execute Update Event'.

In Java this is the event:

public void afterExecuteUpdate(DataObjectEvent e) {
....
and I use:

e.getParameter("theparamcolumn").getObjectValue();
...
}

You will need to do the same but in PHP.

It's great stuff once you get it working. You can devise your own sql updates to do anything you want including multiple updates etc on each row of a grid.

Regards

Anton

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.