Welcome, Guest
Guest Settings
Help

Thread: ajaxCall question



Permlink Replies: 25 - Last Post: May 27, 2014 12:46 AM Last Post By: ravi kumar
roberto nicchi

Posts: 77
Registered: 4/11/01
ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 14, 2012 2:24 AM
Clicking into a button (that is placed into a dbrepeater) i want to
update a database table (without fully reload the page).
Ajax seems to be the solution. I'm trying to execute the ajax function
passing a parameter.

I can't find a way to pass a parameter to the ajax function. I guess
it's possible. How to do it ?

I'm trying with:
echo $sender->ajaxCall('updatedatabase',array('paramvalue'),array());

and in test function i read the parameter as follow: param1=$params[0];

If i try to diplay the param into a Label i have an empty string.

thanks

Roberto
roberto nicchi

Posts: 77
Registered: 4/11/01
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 14, 2012 2:40 AM   in response to: roberto nicchi in response to: roberto nicchi
Il 14/04/12 11.24, roberto nicchi ha scritto:
Clicking into a button (that is placed into a dbrepeater) i want to
update a database table (without fully reload the page).
Ajax seems to be the solution. I'm trying to execute the ajax function
passing a parameter.

I can't find a way to pass a parameter to the ajax function. I guess
it's possible. How to do it ?

I'm trying with:
echo $sender->ajaxCall('updatedatabase',array('paramvalue'),array());

and in test function i read the parameter as follow: param1=$params[0];

If i try to diplay the param into a Label i have an empty string.

thanks

Roberto

ok, i have finally found the answer:

$par = "thevalue";
echo( "params = ['" . $par . "'];\r\n" );
echo $sender->ajaxCall('updatedatabase');

anyway i don't have to pass a constant value but some ID of the database
record that is "linked" to the button.

I have tryed then with:

$par=$sender.tag

and with

$par=$sender.name

but i have the value 0 for tag and the value 'Button1' for name.

In the the OnBeforeShow event of the button i do:

$sender->name=$this->tbproducts1->fields['ID'];
$sender->tag=$this->tbproducts1->fields['ID'];

thanks

Roberto

Unknown Coder

Posts: 7
Registered: 2/12/12
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 14, 2012 5:56 AM   in response to: roberto nicchi in response to: roberto nicchi
$par=$sender.tag

and with

$par=$sender.name

I think you are mixing up js and php

$sender->name and $sender.name are 2 different php variables.

And fwiw I really think hiddenFields for transfers back to the server are the easiest way to do things when you are learning.

This thread has everything in it that you are trying to do.
https://forums.embarcadero.com/thread.jspa?threadID=69057&tstart=0
roberto nicchi

Posts: 77
Registered: 4/11/01
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 14, 2012 8:20 AM   in response to: Unknown Coder in response to: Unknown Coder
Il 14/04/12 14.56, Unknown Coder ha scritto:
$par=$sender.tag

and with

$par=$sender.name

I think you are mixing up js and php

$sender->name and $sender.name are 2 different php variables.

And fwiw I really think hiddenFields for transfers back to the server are the easiest way to do things when you are learning.

This thread has everything in it that you are trying to do.
https://forums.embarcadero.com/thread.jspa?threadID=69057&tstart=0

I did a mistake typeing the message, i use the -> operator

Anyway (after a long walk that always help) i have found how to do it
using an hiddenfield

function Button1BeforeShow($sender, $params) // button1 is the button
into the dbrepeater
{
$sender->name=$this->tbproducts1->fields['ID'];
}

function test($sender, $params)
{
$this->test_lb->Caption=$this->hf->value;
}

function Button1JSClick($sender, $params)
{
?>
//begin js
findObj('hf').value=event.target.name; // hf is an
hiddenfield object
//end
<?php

echo $sender->ajaxCall('test');
}

thanks, you helped :)

Roberto

roberto nicchi

Posts: 77
Registered: 4/11/01
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 18, 2012 3:30 AM   in response to: roberto nicchi in response to: roberto nicchi
Found two problems: it doesn't works with IE and the page is reloaded.
Changing the code as follow solve both problems.

function Button1BeforeShow($sender, $params)
{
$sender->name=$this->tbproducts1->fields['ID'];
}

function Button1JSClick($sender, $params)
{
?>
//begin js
var target = event.target || event.srcElement // use srcElement (IE)
or target (other browser)
findObj('hf').value=target.name;
//end
<?php

echo $sender->ajaxCall("test");

?>
return(false); // avoid the page is reloaded
<?php
}

function test($sender, $params)
{
$this->test_lb->Caption=$this->hf->value; // show the name of the
selected button into a label
}

"roberto nicchi" ha scritto nel messaggio
news:460335 at forums dot embarcadero dot com...

Il 14/04/12 14.56, Unknown Coder ha scritto:
$par=$sender.tag

and with

$par=$sender.name

I think you are mixing up js and php

$sender->name and $sender.name are 2 different php variables.

And fwiw I really think hiddenFields for transfers back to the server are
the easiest way to do things when you are learning.

This thread has everything in it that you are trying to do.
https://forums.embarcadero.com/thread.jspa?threadID=69057&tstart=0

I did a mistake typeing the message, i use the -> operator

Anyway (after a long walk that always help) i have found how to do it
using an hiddenfield

function Button1BeforeShow($sender, $params) // button1 is the button
into the dbrepeater
{
$sender->name=$this->tbproducts1->fields['ID'];
}

function test($sender, $params)
{
$this->test_lb->Caption=$this->hf->value;
}

function Button1JSClick($sender, $params)
{
?>
//begin js
findObj('hf').value=event.target.name; // hf is an
hiddenfield object
//end
<?php

echo $sender->ajaxCall('test');
}

thanks, you helped :)

Roberto

roberto nicchi

Posts: 77
Registered: 4/11/01
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 14, 2012 10:15 AM   in response to: Unknown Coder in response to: Unknown Coder
Il 14/04/12 14.56, Unknown Coder ha scritto:
$par=$sender.tag

and with

$par=$sender.name

I think you are mixing up js and php

$sender->name and $sender.name are 2 different php variables.

And fwiw I really think hiddenFields for transfers back to the server are the easiest way to do things when you are learning.

This thread has everything in it that you are trying to do.
https://forums.embarcadero.com/thread.jspa?threadID=69057&tstart=0

one more question: is it possible to show a message after the ajaxCall
has been completed ?

thanks!

Roberto
Unknown Coder

Posts: 7
Registered: 2/12/12
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 14, 2012 11:01 AM   in response to: roberto nicchi in response to: roberto nicchi
one more question: is it possible to show a message after the ajaxCall
has been completed ?

thanks!

Roberto

Yes there are a few different ways. I don't use the current RADphp so I don't know if they have updated the version of xajax though. For just testing while you are learning I would just change a label caption.
this thread discusses loading message (use for a loading gif animation etc) http://web.archive.org/web/20100110132844/http://forums.delphi-php.net/javascript-ajax/2093-how-display-loading-message.html

The detailed instructions are here http://www.xajaxproject.org/en/docs-tutorials/ you just have to find what works with the vcl's implementation.

For production websites I don't use ajaxcall because it is unbearably slow. I do 99% of my ajax with basicAjax routines and it is extremely easy to put messages into that.
http://web.archive.org/web/20091218200425/http://forums.delphi-php.net/javascript-ajax/1721-basic-ajax-d4php.html
roberto nicchi

Posts: 77
Registered: 4/11/01
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 14, 2012 11:43 AM   in response to: Unknown Coder in response to: Unknown Coder
Il 14/04/12 20.01, Unknown Coder ha scritto:
one more question: is it possible to show a message after the ajaxCall
has been completed ?

thanks!

Roberto

Yes there are a few different ways. I don't use the current RADphp so I don't know if they have updated the version of xajax though. For just testing while you are learning I would just change a label caption.
this thread discusses loading message (use for a loading gif animation etc) http://web.archive.org/web/20100110132844/http://forums.delphi-php.net/javascript-ajax/2093-how-display-loading-message.html

The detailed instructions are here http://www.xajaxproject.org/en/docs-tutorials/ you just have to find what works with the vcl's implementation.

For production websites I don't use ajaxcall because it is unbearably slow. I do 99% of my ajax with basicAjax routines and it is extremely easy to put messages into that.
http://web.archive.org/web/20091218200425/http://forums.delphi-php.net/javascript-ajax/1721-basic-ajax-d4php.html

I'll take a look to basicajax, thanks

Roberto
roberto nicchi

Posts: 77
Registered: 4/11/01
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 19, 2012 9:36 AM   in response to: Unknown Coder in response to: Unknown Coder
I have found how to set xajax syncronous: echo "xajax.config.defaultMode =
'synchronous';";

I'd like also to try Basicajax but the file seems not to be available
anymore. Do you have a link that works ?

thanks

Roberto

"Unknown Coder" ha scritto nel messaggio
news:460361 at forums dot embarcadero dot com...

one more question: is it possible to show a message after the ajaxCall
has been completed ?

thanks!

Roberto

Yes there are a few different ways. I don't use the current RADphp so I
don't know if they have updated the version of xajax though. For just
testing while you are learning I would just change a label caption.
this thread discusses loading message (use for a loading gif animation etc)
http://web.archive.org/web/20100110132844/http://forums.delphi-php.net/javascript-ajax/2093-how-display-loading-message.html

The detailed instructions are here
http://www.xajaxproject.org/en/docs-tutorials/ you just have to find what
works with the vcl's implementation.

For production websites I don't use ajaxcall because it is unbearably slow.
I do 99% of my ajax with basicAjax routines and it is extremely easy to put
messages into that.
http://web.archive.org/web/20091218200425/http://forums.delphi-php.net/javascript-ajax/1721-basic-ajax-d4php.html
Unknown Coder

Posts: 7
Registered: 2/12/12
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 19, 2012 11:31 AM   in response to: roberto nicchi in response to: roberto nicchi
roberto nicchi wrote:
I have found how to set xajax syncronous: echo "xajax.config.defaultMode =
'synchronous';";

I'd like also to try Basicajax but the file seems not to be available
anymore. Do you have a link that works ?
I think these will cover it:
https://forums.embarcadero.com/thread.jspa?threadID=70726&tstart=0
roberto nicchi

Posts: 77
Registered: 4/11/01
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 19, 2012 12:46 PM   in response to: Unknown Coder in response to: Unknown Coder
Il 19/04/12 20.31, Unknown Coder ha scritto:
roberto nicchi wrote:
I have found how to set xajax syncronous: echo "xajax.config.defaultMode =
'synchronous';";

I'd like also to try Basicajax but the file seems not to be available
anymore. Do you have a link that works ?
I think these will cover it:
https://forums.embarcadero.com/thread.jspa?threadID=70726&tstart=0

Hi

Thanks for the files but i miss the basicAjax library and i can't see it
in the zip file attached. I see 4 demo php units only.

thanks

Roberto
Unknown Coder

Posts: 7
Registered: 2/12/12
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 19, 2012 1:20 PM   in response to: roberto nicchi in response to: roberto nicchi
Thanks for the files but i miss the basicAjax library and i can't see it
in the zip file attached. I see 4 demo php units only.

thanks

Roberto

There is no real library. It is a small chunk of javascript that I stick into common.js but you could just include it instead.
It was linked from the first thread

http://web.archive.org/web/20090604080723/http://forums.delphi-php.net/javascript-ajax/3017-favorite-functions-add-common-js.html

vcl=
{
$:function ()
{
var elements = new Array();
for (var i = 0; i < arguments.length; i++)
{
var element = arguments[i];
if (typeof element == 'string')
element = findObj(element);
if (arguments.length == 1)
return element;
elements.push(element);
}
 
return elements;
},
int:function(obj){ return parseInt(vcl.$(obj).value);},
real:function(obj){ return parseFloat(vcl.$(obj).value);},
escape:function(obj){ return escape(vcl.$(obj).value);},
unescape:function(obj){ return unescape(vcl.$(obj).value);},
focus:function(obj){ vcl.$(obj).focus();},
check:function(obj){ vcl.$(obj).checked=true;},
uncheck:function(obj){ vcl.$(obj).checked=false;},
hide:function(obj){ vcl.$(obj).style.display = 'none';},
show:function(obj){ vcl.$(obj).style.display = '';},
find:function(obj){ return vcl.$(obj);},
text:function(obj){ return vcl.$(obj).value;},
value:function(obj){ return vcl.$(obj).value;},
setOpacity:function(incoming,value)
{
theObj=vcl.$(incoming);
theObj.style.opacity = value/10;
theObj.style.filter = 'alpha(opacity=' + value*10 + ')';
}
}
 
function createHTTPrequest()
{ /* Firefox, Opera 8.0+, Safari */
try {return new XMLHttpRequest();}
catch (error) {}
/* newer IE */
try {return new ActiveXObject("Msxml2.XMLHTTP");}
catch (error) {}
/* older IE */
try {return new ActiveXObject("Microsoft.XMLHTTP");}
catch (error) {}
throw new Error("Your browser does not have AJAX support!");
}
function basicAjax (url,parameters,callback)
{
xmlHttp=createHTTPrequest();
if (callback) {xmlHttp.onreadystatechange=callback;}
else
{
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
if (xmlHttp.status == 200)
{eval(xmlHttp.responseText);}
else
{alert("Sorry, received a server error ="+xmlHttp.statusText);}
}
}
}
xmlHttp.open("POST",url,true);
if (typeof(basicAjaxAsyncFalse) != 'undefined' && basicAjaxAsyncFalse==1) xmlHttp.open("POST",url,false); //this will force a wait for return
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("If-Modified-Since", "Fri, 31 Dec 1999 23:59:59GMT");
xmlHttp.send(parameters);
}
roberto nicchi

Posts: 77
Registered: 4/11/01
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 20, 2012 12:32 AM   in response to: Unknown Coder in response to: Unknown Coder
ahhh ok, thanks !!

Roberto

"Unknown Coder" ha scritto nel messaggio
news:461609 at forums dot embarcadero dot com...

Thanks for the files but i miss the basicAjax library and i can't see it
in the zip file attached. I see 4 demo php units only.

thanks

Roberto

There is no real library. It is a small chunk of javascript that I stick
into common.js but you could just include it instead.
It was linked from the first thread

http://web.archive.org/web/20090604080723/http://forums.delphi-php.net/javascript-ajax/3017-favorite-functions-add-common-js.html

vcl=
{
$:function ()
{
var elements = new Array();
for (var i = 0; i < arguments.length; i++)
{
var element = arguments[i];
if (typeof element == 'string')
element = findObj(element);
if (arguments.length == 1)
return element;
elements.push(element);
}
 
return elements;
},
int:function(obj){ return parseInt(vcl.$(obj).value);},
real:function(obj){ return parseFloat(vcl.$(obj).value);},
escape:function(obj){ return escape(vcl.$(obj).value);},
unescape:function(obj){ return unescape(vcl.$(obj).value);},
focus:function(obj){ vcl.$(obj).focus();},
check:function(obj){ vcl.$(obj).checked=true;},
uncheck:function(obj){ vcl.$(obj).checked=false;},
hide:function(obj){ vcl.$(obj).style.display = 'none';},
show:function(obj){ vcl.$(obj).style.display = '';},
find:function(obj){ return vcl.$(obj);},
text:function(obj){ return vcl.$(obj).value;},
value:function(obj){ return vcl.$(obj).value;},
setOpacity:function(incoming,value)
{
theObj=vcl.$(incoming);
theObj.style.opacity = value/10;
theObj.style.filter = 'alpha(opacity=' + value*10 + ')';
}
}
 
function createHTTPrequest()
{ /* Firefox, Opera 8.0+, Safari */
try {return new XMLHttpRequest();}
catch (error) {}
/* newer IE */
try {return new ActiveXObject("Msxml2.XMLHTTP");}
catch (error) {}
/* older IE */
try {return new ActiveXObject("Microsoft.XMLHTTP");}
catch (error) {}
throw new Error("Your browser does not have AJAX support!");
}
function basicAjax (url,parameters,callback)
{
xmlHttp=createHTTPrequest();
if (callback) {xmlHttp.onreadystatechange=callback;}
else
{
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
if (xmlHttp.status == 200)
{eval(xmlHttp.responseText);}
else
{alert("Sorry, received a server error ="+xmlHttp.statusText);}
}
}
}
xmlHttp.open("POST",url,true);
if (typeof(basicAjaxAsyncFalse) != 'undefined' && basicAjaxAsyncFalse==1) 
xmlHttp.open("POST",url,false); //this will force a wait for return
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("If-Modified-Since", "Fri, 31 Dec 1999 
23:59:59GMT");
xmlHttp.send(parameters);
}
roberto nicchi

Posts: 77
Registered: 4/11/01
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 20, 2012 9:31 AM   in response to: Unknown Coder in response to: Unknown Coder
Seems to understand that basicAjax needs an external PHP file.
ajaxCall allows to execute a php function that is in the same file. Is it
possible also with basicAjax ?

thanks

Roberto

"Unknown Coder" ha scritto nel messaggio
news:461609 at forums dot embarcadero dot com...

Thanks for the files but i miss the basicAjax library and i can't see it
in the zip file attached. I see 4 demo php units only.

thanks

Roberto

There is no real library. It is a small chunk of javascript that I stick
into common.js but you could just include it instead.
It was linked from the first thread

http://web.archive.org/web/20090604080723/http://forums.delphi-php.net/javascript-ajax/3017-favorite-functions-add-common-js.html
Unknown Coder

Posts: 7
Registered: 2/12/12
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 20, 2012 11:19 AM   in response to: roberto nicchi in response to: roberto nicchi
roberto nicchi wrote:
Seems to understand that basicAjax needs an external PHP file.
ajaxCall allows to execute a php function that is in the same file. Is it
possible also with basicAjax ?

That will just slow it back down. Loading files with all of that vcl overhead is most of the reason it was slow in the first place.

PHP is an interpreted language - every line of code has to be parsed (compiled) every time.

Separate small scripts is the way the web has worked for years.
roberto nicchi

Posts: 77
Registered: 4/11/01
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 20, 2012 11:44 AM   in response to: Unknown Coder in response to: Unknown Coder
Il 20/04/12 20.19, Unknown Coder ha scritto:
roberto nicchi wrote:
Seems to understand that basicAjax needs an external PHP file.
ajaxCall allows to execute a php function that is in the same file. Is it
possible also with basicAjax ?

That will just slow it back down. Loading files with all of that vcl overhead is most of the reason it was slow in the first place.

PHP is an interpreted language - every line of code has to be parsed (compiled) every time.

Separate small scripts is the way the web has worked for years.

ok thanks
roberto nicchi

Posts: 77
Registered: 4/11/01
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 23, 2012 3:03 AM   in response to: Unknown Coder in response to: Unknown Coder
I guess that in the external php file i can't change the php main form but
i jave to use javascript. For example, if i want to change the caption of a
Label seems i can't do: $Page1-> Label1->caption='some value';

thanks

Roberto

"Unknown Coder" ha scritto nel messaggio
news:461857 at forums dot embarcadero dot com...

roberto nicchi wrote:
Seems to understand that basicAjax needs an external PHP file.
ajaxCall allows to execute a php function that is in the same file. Is it
possible also with basicAjax ?

That will just slow it back down. Loading files with all of that vcl
overhead is most of the reason it was slow in the first place.

PHP is an interpreted language - every line of code has to be parsed
(compiled) every time.

Separate small scripts is the way the web has worked for years.
Unknown Coder

Posts: 7
Registered: 2/12/12
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 23, 2012 9:58 AM   in response to: roberto nicchi in response to: roberto nicchi
roberto nicchi wrote:
I guess that in the external php file i can't change the php main form but
i jave to use javascript. For example, if i want to change the caption of a
Label seems i can't do: $Page1-> Label1->caption='some value';

Yes, just output the js to do it.

findObj('Label1').innerHTML='some value';

That is really the same thing the vcl does for you behind the scenes.
Your browser doesn't understand any php only js and html so the vcl translates everything for you.
roberto nicchi

Posts: 77
Registered: 4/11/01
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 24, 2012 12:17 AM   in response to: Unknown Coder in response to: Unknown Coder
ok thanks

Roberto

"Unknown Coder" ha scritto nel messaggio
news:462458 at forums dot embarcadero dot com...

roberto nicchi wrote:
I guess that in the external php file i can't change the php main form
but
i jave to use javascript. For example, if i want to change the caption of
a
Label seems i can't do: $Page1-> Label1->caption='some value';

Yes, just output the js to do it.

findObj('Label1').innerHTML='some value';

That is really the same thing the vcl does for you behind the scenes.
Your browser doesn't understand any php only js and html so the vcl
translates everything for you.
AEE AEE

Posts: 4
Registered: 12/1/08
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 8, 2012 10:35 AM   in response to: roberto nicchi in response to: roberto nicchi
i m beginner , excuse a lot

this does not work
it doesn't transmit a param to MToolBar1Click

can anyone help me please

class MPage1 extends MPage
{
public $Label1 = null;
public $MToolBar1 = null;
function MToolBar1JSVClick($sender, $params)
{
// MToolBar ("Venise","Valence"
?>
//begin js
params=jQuery(this).find('a').text();
alert(params);
//end
<?php

echo $this->MToolBar1->ajaxCall("MToolBar1Click",array(),$params);
}
function MToolBar1Click($sender, $params)
{
if ($params=="Valence")
$this->Label1->Caption="France";
else
$this->Label1->Caption="Italie";

}

}

Adrian Chaves

Posts: 19
Registered: 11/5/11
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 9, 2012 12:51 AM   in response to: AEE AEE in response to: AEE AEE
ajaxCall is for standard web applications, based on the Page container.

If you are creating a mobile application, using MPage for your pages, AJAX works differently (easier).
AEE AEE

Posts: 4
Registered: 12/1/08
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 9, 2012 11:11 PM   in response to: roberto nicchi in response to: roberto nicchi
how easier

thank's
Ronny Gerndt

Posts: 2
Registered: 11/13/09
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 3, 2012 6:47 AM   in response to: roberto nicchi in response to: roberto nicchi
Hi,

i have a Problem with ajaxCall. Here some SourceCode(most from MasterDetail example):

function GroupName1JSChange($sender, $params)
{
?>
GroupID=GroupName1.selectedIndex + 1;
params=GroupID;
<?php
echo $sender->ajaxCall("UpdateGames", array(), array('Games1'));
}

function UpdateGames($sender, $params)
{
$this->tbGroups1->ID = $params;
$this->tbGames1->refresh();
$this->tbGroups1>Cancel();
}

If i Change the Combobox Item i get an 500 Internal Server Error.

This is what Chrome says where the error occured:
xajax._internalSend xajax_core.js:395
xajax.submitRequest xajax_core.js:394
xajax.request xajax_core.js:379
xajax_ajaxProcess index.php:35
GroupName1JSChange index.php:49
onchange index.php:67

And this is the Generated javascript:

function GroupName1JSChange(event)
{

var event = event || window.event;
var params=null;
GroupID=GroupName1.selectedIndex + 1;
params=GroupID;
xajax_ajaxProcess('Page1','GroupName1',params,'UpdateGames',xajax.getFormValues('Page1'),["Games1"]);

}

Anyone an idea what i can do to fix it?

Thanks.

Greetings

Ronny Gerndt
Unknown Coder

Posts: 7
Registered: 2/12/12
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 3, 2012 9:13 AM   in response to: Ronny Gerndt in response to: Ronny Gerndt
server 500 errors are usually when you do something that your server is built to protect against. - against the operators rules.

Always the easiest way to debug ajaxcall stuff is to do it as a regular button post and when that works you can disconnect the button event and make it an ajaxcall.
Ronny Gerndt

Posts: 2
Registered: 11/13/09
Re: ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 4, 2012 4:37 AM   in response to: Unknown Coder in response to: Unknown Coder
Unknown Coder wrote:
server 500 errors are usually when you do something that your server is built to protect against. - against the operators rules.

Always the easiest way to debug ajaxcall stuff is to do it as a regular button post and when that works you can disconnect the button event and make it an ajaxcall.

Thanks, i finally found my error.
ravi kumar

Posts: 1
Registered: 6/7/14
ajaxCall question
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 27, 2014 12:46 AM   in response to: roberto nicchi in response to: roberto nicchi
HI

I am trying to implement the ajax in mobile application.So i am getting error message like 'xajax_ajaxProcess is not defined'.

I have other question like i need to implement to ajax request in a page will it be possible or not?

Can anyone help me on this ?

THanks
Ravi

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02