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

 Master/Detail-Add and Master/Detail-Edit

Print topic Send  topic

Author Message
Kam

Posts: 1
Posted: 12/11/2011, 8:01 PM

I'm working for a weeks to find a solution for (master/detail insert/edit in the same page) with Codecharge 4.3 and at a moment no succes.

Based on the Tutorial Example (PHPMAKER) : http://www.hkvstore.com/phpmaker/doc/masterdetail.htm

This is Allows inserting/updating a master record with multiple detail records(Editable grid) of a detail table in the same page. Supports adding/deleting rows to/from the detail grid.
Can 'Codecharge' will do like above example?

tqvm
View profile  Send private message
andy


Posts: 183
Posted: 12/14/2011, 6:43 AM

Hi Kam

This is a notoriously difficult thing to do in CodeChargeStudio - not because CCS is not flexible - but because in HTML when you post a form, you can only really post a single form.
You need to think a bit out side the box.
I assume you are familiar with presenting a master record and related child grid or editable grid on the same page.

If you have a master record as an updatable form and an editable grid with its child records then you have two data sources. If you update one, you won't automatically update the other.

You can manipulate the page Redirect so that after submitting you stay on the same page but I'm guessing what you really want (don't we all) is to have a master record with a Submit button and an editable grid without buttons.
You edit both and when you come to save both the master record and the child-editable grid you just click one button...

I recommend you have the master record as editable and updatable and the child grid as read only. In order to edit a record in the child grid, have an edit link to call another page which edits a single record at a time then returns the user to the calling master-child form (you can make it a modal window if you want to maintain the illusion of it being part of the same master-child transaction). When you have finished editing, click the master record submit button to save the master record.

This approach doesn't conform to ACID-transaction safe method.

Be clear:
CCS doesn't support commit-rollback transactions

You can - if you are prepared to put the work in - mimick this as follows:

Upon opening the master-child page, copy the master and child records to temporary tables.
Manipulate the data entry as outlined above.
When the user finally presses the Submit button for the master record, then and only then are the edited, updated master and child records "committed" by overwriting the original live master-detail records with the updated temporary records.

You can ensure that any unsaved updates to the master record are recorded by doing an AJAX updated db for the master record that is triggered by a mouseover the edit link calling the child record edit page.

In a nutshell, CodeCharge Studio doesn't support this natively so I would recommend you play to its strengths and explore simple workarounds.

I hope this helps.

P.S I tried long and hard to "daisy chain" form submissions but that doesn't work.


One approach is to use AJAX updated db.
Your master record is the main submission form
_________________
Andy

RAD tools for rich UI controls:
http://www.koolphptools.com
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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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