karen
Posts: 99
|
Posted: 12/06/2011, 7:22 PM |
|
Hi all,
I would like to be able to trigger update of a different table when a checkbox is clicked on a form. Having a confirmation dialog would be a bonus.
An example scenario is for an organisation record with related member records. When the organisation is made inactive (via checkbox), there will be a dialog to ask if all the members related to the organisation should also be updated to inactive and if yes, an update query will operate when form is submitted.
I'm using CCS3.2 PHP/MySQL.
Thanks for any advice!
Cheers,
Karen
|
|
|
mamboBROWN
Posts: 1713
|
Posted: 12/10/2011, 3:58 PM |
|
Karen,
Seems like all you need to do is execute custom code after a specific event on a form. Here is an example of custom update code for an After Execute Update event: http://docs.codecharge.com/studio40/html/ProgrammingTec...tomSQL.html?toc
|
|
|
karen
Posts: 99
|
Posted: 12/11/2011, 4:58 PM |
|
Thanks, mambobrown. I was hoping to do it on the client-side but it may not be such a good idea after all. Now I'm thinking perhaps I should have a flag depending on the confirm dialog response that will then control the after execute update custom code. I'll look at this more and check back again...
|
|
|
andy
Posts: 183
|
Posted: 12/15/2011, 1:52 AM |
|
If you want to trigger a database update in the background without having to submit the form then I would advise you use the Ajax UpdateDB feature.
Click on any text box and on the Data tab under properties at the bottom select Features...
Click on the elipsis (...)
From the Add Feature box select UpdateDB under the AJAX heading.
In the features panel with UpdateDB1 selected fill in Connection with your connection,
operation Type as insert/update/delete
Click on the elipsis by Operation Parameters, select your table and fields to operate on
then finally under Start event, find your checkbox - select it and enable the onclick event.
OK
You can experiment with your triggers but that will secretely update the specified table in the background without having to submit the form.
It's a really useful function!
I hope that is helpful...
_________________
Andy
RAD tools for rich UI controls:
http://www.koolphptools.com |
|
|
andy
Posts: 183
|
Posted: 12/15/2011, 1:53 AM |
|
Just noticed you are using CCS 3.2
Not sure whether this version supports AJAX.
If not, you may have to upgrade....
_________________
Andy
RAD tools for rich UI controls:
http://www.koolphptools.com |
|
|
karen
Posts: 99
|
Posted: 12/22/2011, 3:14 AM |
|
Thanks, Andy. That's a good reason to upgrade...for now, I've decided to keep it simple and just use custom code in the after execute update event.
|
|
|
sorinbuda
Posts: 27
|
Posted: 06/25/2013, 9:03 AM |
|
Do you have any ideea on how to triger UpdateDB based on checkbox clik?
Apprently the Features option is available for textbox but not for checkbox and when the checkbox is included in a Panel that will not work either.
|
|
|
karen
Posts: 99
|
Posted: 06/25/2013, 10:20 AM |
|
I guess you'll have to do your own custom code like I did. Bear in mind that you may have a newer version of CCS which can support more advanced features that I won't be aware of.
|
|
|
sorinbuda
Posts: 27
|
Posted: 06/25/2013, 10:40 AM |
|
I am using CCS 4.3. Features are not available for checkbox in 4.3 version maibe in 5.0.
I found a solution by adding Submit Form action to On Click event.
However is frustrating to see the page refreshing each time the checkbox is clicked.
So I foud a solution for half of the problem. Now I have to feagure how to update only the panel in order not to refresh the page every time I make a click on the checkbox.
|
|
|