Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
callServer
System
Hi,
I want to implement callServer with parameter and Receiving Parameter value in corresponding prg.
If you any body have any example could pls. post and point me to example.
I am able to pass the argument but i am not able to receive the value.
Thanx in advance
Find more posts tagged with
Comments
Migrateduser
Scripts that involve using callServer() involve 2 parts:
1. The formAPI script that invokes callServer()
2. The CGI that responds with JavaScript code to alert the calling formapi script of the results of the call.
Because of the nature of HTTP calls within a browser, callServer() is an asynchronous call; the method returns before the actual result of your call is available.
Here is a simple example of the formAPI and response JavaScript that uses callServer()
The formAPI script...
function fetchResults()
{
var params = new Object();
params.name="John Smith";
IWDatacapture.callServer("/bin/mycgi.cgi",params);
}
function setResults(result)
{
//This function will be called by the responding CGI from
//an invokation of callServer(). Do something with result...
}
The cgi "mycgi.cgi" may respond with the following:
<html>
<head>
<script language="javascript">
//The results would have something meaningful
parent.getScriptFrame().setResults("the results");
</script>
</head>
</html>
Note that there is no restriction as to what datatype call callServer callback can take; the result can come in the form of a datastructure understood by the callback.
I hope this helps!
--Daniel
Migrateduser
Thanx for your reply.
In the below item i am using callout without url.I am using onCallout event which executues callServer function.
DCT with callout:
<container name="ProductModels" combination="and" >
<item name="SelectedModels" rowcontinue="t">
<label>Selected Product Models</label>
<textarea row="5" col="20" >
<cgi-callout label="Model Id..." />
</textarea>
</item>
ItemHandler:
IWEventRegistry.addItemHandler("/ProductModels/SelectedModels", "onCallout", handle_onCallout);
handle_onCallout()
{
var category = IWDatacapture.getItem("/ProductCategories").getValue();
var param = new Object();
param.myParameter =category;
alert(param.myParameter);
IWDatacapture.callServer('/iw-bin/Ex_GetModels.ipl',param,false);
}
Ex_GetModels gets param value do further.
I used the below code to receive the param value
use CGI qw(param);
my $in = new CGI;
my $value = $in->param('myParameter');
It is always returning null value.
pls. check the attached file for full code.
Thanx in advance
Migrateduser
u got it ..?
Ignore Blank Field Values in PAGEOUT on a Free Block.pdf
Migrateduser
Yes i solved that issue i used cgi not callServer.