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 -> General/Other

 Need help with Service Builder and writing custom-code

Print topic Send  topic

Author Message
CodeChargenewbie

Posts: 114
Posted: 02/23/2008, 8:05 AM

I am at my wits end, here. I don't understand what I'm doing wrong, so maybe someone can help me out.

First of all, why am I using ajax? In CCS 3, I employed AJason to allow me to update the database and return new data, on-the-fly. This is a necessary component for my code. On the server-side, I called one php function that took care of everything and then Ajason took care of returning the data. But AJason doesn't work in CCS4 and I must use their service builder to accomplish the same goal.

I created a service page using an HTML list. Now, the service builder forces you to assign a database query. As I stated before, I have a function in common that handles everything and I do not wish to make any changes. I'd expect codecharge should be able to handle custom code on the service page but I really don't know now. What I did was create a query that returns nothing, selecting one field for the select query (call it AID). Then on the service page, I added custom code to the AID label and set its value to the function. Unfortunately, AID is not being set for some reason. The output of the service page is simply

<ul>

</ul>

Is there a way to employ custom code in a service page which doesn't rely directly on the datasource?

thansk you
View profile  Send private message
CodeChargenewbie

Posts: 114
Posted: 02/23/2008, 9:17 AM

Well, I was able to (somehow) figure out how to pass values from the service page without using databases. I simply deleted all the html list code, created a label, and passed the php function result into the label.

Now, I'm having two problems, but let me give a backdrop to provide a better understanding. I have a button that makes an ajax request in an onclick event (using prototype). The service page calls my php function and returns a value. Essentially speaking, this value should be incremented by 1, each time I call the function (ergo each time I click the button).. The problem is the value is not being incremented. The ajax request is reported as a success, but it doesn't increment the value. Only after I run the service page in its own window does the value update. Keep in mind, it is returning a value, just not the one I want.

The other problem is I'm having trouble setting the value a textbox with the return value from the ajax call. I tried $F('id_of_textbox').value = transport.responseText and it doesn't work. I tried Form.Name.value = transport.responseText and that also does not work. What am i doing wrong here?

Thanks
View profile  Send private message
CodeChargenewbie

Posts: 114
Posted: 02/23/2008, 11:47 AM

I don't know if this is a codecharge issue (and I suspect that it is!), but I tried my page in firefox and it works as it should. That is, when I click the button, it makes an ajax call and returns the appropriate value each and every time. I have a listbox where the user selects a choice and it calls a pop-up window that loads data into the parent window. After this and only this will selecting the button make an ajax call in IE. Why? I have no clue. Worked just fine in CCS 3.2 with AJason. Which is why I suspect it has something to do with CCS 4

edit: freakin' IE. I think it has something to do with using GET, not POST. IE caches GET. Ugh.
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.