CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 AJAX - UpdateDB anyone ever got to work

Print topic Send  topic

Author Message
isoftware_com

Posts: 13
Posted: 02/03/2011, 10:14 PM

The CCS User guides are particularily non helpfull on this one. Anyone actually got this to work? How do you implement?
_________________
isoftware.com
Looking for Codecharge VB.NET Freelance Developers
View profile  Send private message
andrewi

Posts: 162
Posted: 02/04/2011, 4:21 AM

I have got it to work, though I've yet to use it on a live page. From memory it looked fairly nicely implemented, fairly self-explanatory setup (though not well documented, as you say) and adds code to the page itself (rather than setting up a separate service page)

How far have you got, and what errors are you getting? I think I may have had assistance from support.
Andrew
View profile  Send private message
vandalen

Posts: 58
Posted: 02/04/2011, 9:27 AM

Which language are you using? Last year Yes send me a patch for ASP.
View profile  Send private message
isoftware_com

Posts: 13
Posted: 02/04/2011, 1:37 PM

Hi,

I am using vb.NET. Going to have another go on a simpler test page today. I think I had secondary issues that may of caused issues.

You have confirmed my thoughts, in that it does not require a Service Page. So all good there.
_________________
isoftware.com
Looking for Codecharge VB.NET Freelance Developers
View profile  Send private message
andrewi

Posts: 162
Posted: 02/05/2011, 4:38 AM

I used asp. I found it worked easily on a new page (recommend you test with a new page) but wouldn't work on an existing (complex) page. Yes sent a patch.

I had a form with a textbox and a link: Clicking the link would insert the contents of the textbox into a simple test table. I added the DBUpdate feature to the link. In the UpdateDB features you can decide whether it's an update, delete or insert. Under the Operation Parameters you get similar dialog box to a form custom update/delete/insert. I set the Start Event (that triggers the DBupdate) as the link's onclick event (NewRecord1Link1.onclick;).

In the form code it creates some additional functions, e.g. ServiceNewRecord1Link1UpdateDB1() [in ASP at any rate] which includes the update code, so the whole feature is incoporated in the single page's code.

After the UpdateDB event had run, I wanted to update an Ajax panel that was displaying contents of the test table. I added an UpdatePanel feature to the panel, and you need to choose a "Refresh" event. If you navigate to the UpdateDB you'll find it has four events (onstart, onsuccess, onfailure, onfinish). I used onfinish - onsuccess seemed to fire too soon.

I was quite impressed by the results, it worked well. Yes seem to have put a lot of work into the programming interface - which is comprehensive. If only they'd put 20 minutes into writing a nice clear guide on how to use it... it would be a selling feature.

In contrast I found RemoteDLookUp disappointingly restrictive, but that's another story!

Andrew
View profile  Send private message
isoftware_com

Posts: 13
Posted: 02/05/2011, 2:31 PM

It appears I found a bug and have logged it with support who have acknowledged it as such. I was using a Menu and was doing it off the menu Item Click event. This causes the actual Menu code to go amiss after you add a ajax call.

I'll now build the same example that you did with a link instead. All I'm trying to do is Add a new record to a table such that it shows in the editible grid based upon a selection of an item in another grid. All fun and games.

Thanks for the assistance :-)

8-)
_________________
isoftware.com
Looking for Codecharge VB.NET Freelance Developers
View profile  Send private message
gkm

Posts: 20
Posted: 02/07/2011, 1:46 AM

I have implemented Ajax UpdateDB for updating some listboxes in several grids and it works fine for me. But in this situation I have the problem, that CCS events are not recognized, if an UpdateDB value is written to database no page refresh happens (this is the idea behind ajax).
This is why needed code in the event "after execute update" will not executed.

Has anyone some ideas to this?

Thank you,
Gerrit

Environment: php, postgresql
View profile  Send private message
andrewi

Posts: 162
Posted: 02/07/2011, 4:04 AM

gkm, The UpdateDB feature creates a block of code in page_events code page that is entirely self contained (I believe) and won't fire any other form events. It can't, really, because those form events expect all all the data & structure of the submitted form to be present.

If you want to change something on the page after the UpdateDB has run, you'll need client side events. For example, the UpdateDB feature raises an 'onfinish' client side event. You can hook up an ajax update panel to this event so that the panel is refreshed after the UpdateDB has run. (this is all available through the feature interfaces - no coding required - which is nice)
View profile  Send private message
gkm

Posts: 20
Posted: 02/08/2011, 7:29 AM

Andrew,

thank you for your kind answer and for the solution of my problem :-D

Gerrit
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.