Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
callout - onCallout
System
Hi,
I have callout like below which is perfectly working.I want to change this to onCallout.I wrote the below code it is not working.
<item name="SelectedModels" rowcontinue="t">
<label>Selected Product Models</label>
<textarea row="5" col="20" >
<cgi-callout url="/iw-bin/Ex_GetModels.ipl" label="Model Id..."
window-features="width=480,height=380,resizable=no,toolbar=no,scrollbars=no"/>
</textarea>
</item>
I want to run this through callServer function.so i wrote follwoing code.
IWEventRegistry.addItemHandler("/SelectedModels", "onCallout", handle_onCallout);
function handle_onCallout(item) {
var Category = IWDatacapture.getItem("/ProductCategories").getValue();
alert(Category);
}
The reason i am using this I want to send Category argument to my callout.
Thanx in advance
Find more posts tagged with
Comments
Migrateduser
Hi,
Here i am attaching perl script which i am calling in callServer
#!/usr/iw-home/iw-perl/bin/iwperl
=head1 NAME
getModelApplet.ipl - show java applet to call the Model Selection Dialog Box
same as Templating Java Class does.
=head1 DESCRIPTION
This CGI program is intended to show the Model Selection Dialog Box.
=cut
use TeamSite::CGI_lite;
use TeamSite::Config;
use Sys::Hostname;
$|=1;
my $cgi = TeamSite::CGI_lite->new();
$cgi->parse_data();
use CGI qw(param);
my $value = $in->param('myParameter');
my $form_name = $cgi->{'form'}{'iw_form_name'};
my $element_name = $cgi->{'form'}{'iw_callback_var'};
my $user_name = $cgi->{'form'}{'user_name'};
my $item_name = $cgi->{'form'}{'iw_item_name'};
my $item_description = $cgi->{'form'}{'iw_item_description'};
my $dcr_name = $cgi->{'form'}{'iw_object_name'};
my $init_value = $cgi->{'form'}{'iw_item_value'};
$init_value =~ s/\s+$//;
my $nums = "";
foreach my $s (split('\n', $init_value)){
my ($n, $d) = split(':', $s);
$nums .= "$s";
}
$nums =~ s/:$//;
$init_value = $nums;
my $params = $ENV{'PATH_INFO'};
if ($params =~ m!^.*/([^/]+)$!) {
$params = $1;
}
my $host = hostname;
if ($host =~ /^([^\.]+)\..*$/){
$host = $1;
}
my $form = "callout_form";
my $class = "com.canon.cusa.ts.ir50.iwcallout.SelectionApplet";
my $jar = "dbpclient.jar";
my $base = "/iw";
my $rmi_url = "rmi://$host/DBBrokerServer";
my $connection = "extranet";
my $panel_class = "com.canon.cusa.ts.ir50.iwcallout.panel.ExtranetProductPanel";
my $property = "extranet_models";
# my $property = "extranet_accessary";
# my $property = "extranet_supply";
#my $parameters = "p1=3356";
my $parameters = "p1=$value";
my $filename ="/tmp/xyz.log";
open LOG, ">>$filename" or die "cannot open filename = $filename";
chmod 0777 , $filename;
print LOG "Inside this Perl script $parameters \n";
close LOG;
my $title = "Model Code/Name ";
my $code_field = "code";
# my $width = 420;
# my $height = 200;
my $width = 520;
my $height = 340;
# my $wWidth = $width + 60;
# my $wHeight = $height + 70;
my $wWidth = $width + 30;
my $wHeight = $height + 50;
print_ui();
exit 0;
sub print_ui {
print_header();
print <<"END";
<FORM NAME="$form">
<!--"CONVERTED_APPLET"-->
<!-- CONVERTER VERSION 1.3 -->
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = $width HEIGHT = $height align="baseline"
codebase="
http://java.sun.com/products/plugin/1.4/jinstall-14-win32.cab#Version=1,4,0,mn">
<PARAM NAME = ARCHIVE VALUE = $jar >
<PARAM NAME = CODE VALUE = $class >
<PARAM NAME = CODEBASE VALUE = $base >
<PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.4">
<PARAM NAME="scriptable" VALUE="false">
<PARAM NAME=server-url VALUE = "$rmi_url" >
<PARAM NAME=panel-class VALUE = "$panel_class" >
<PARAM NAME=connection VALUE = "$connection" >
<PARAM NAME=property VALUE = "$property" >
<PARAM NAME=title VALUE = "$title" >
<PARAM NAME=code_field VALUE = "$form.$code_field" >
<PARAM NAME=init_value VALUE = "$init_value" >
<PARAM NAME=parameters VALUE = "$parameters" >
<PARAM NAME=ok_handler VALUE = "handle_selection();" >
<PARAM NAME=cancel_handler VALUE = "alert('cancel');" >
<!-- PARAM NAME=cancel_handler VALUE = "self.close()" -->
<PARAM NAME="MAYSCRIPT" VALUE = "true" >
<COMMENT>
<EMBED type="application/x-java-applet;jpi-version=1.4"
width="$width" height="$height" align="baseline"
code="$class"
codebase="$base"
scriptable=false
server-url = "$rmi_url"
panel-class = "$panel_class"
connection = "$connection"
title = "$title"
code_field = "$form.$code_field"
init_value = "$init_value"
parameters = "$parameters"
ok_handler = "handle_selection()"
cancel_handler = "self.close()"
pluginspage="
http://java.sun.com/products/plugin/1.4/plugin-install.html">
<NOEMBED>
No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
</NOEMBED>
</EMBED>
</COMMENT>
</OBJECT>
<INPUT TYPE="HIDDEN" NAME="$code_field" >
</FORM>
<SCRIPT LANGUAGE="JavaScript">
<!--
// -->
</SCRIPT>
END
print_footer();
return;
}
sub error_message {
my (
@msgs)
=
@_
;
print_header();
foreach my $message (
@msgs)
{
print $message;
}
print <<"END";
<CENTER>
<FORM>
<INPUT TYPE="BUTTON" VALUE="OK" onClick="self.close()">
</FORM>
</CENTER>
END
print_footer();
return;
}
sub print_header {
print<<"END";
print <<"Content-type: text/html\n\n";
<HTML>
<HEAD>
<TITLE>$host</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.resizeTo($wWidth, $wHeight);
function set_datacapture_item_value( code )
{
if ((window.opener == null) ||
(window.opener.closed))
{
return false;
}
var calloutForm = eval($form_name);
if (!calloutForm)
{
return false;
}
var calloutElementFound = false;
for ( i = 0 ; i < calloutForm.elements.length ; i++ )
{
if (! calloutElementFound && calloutForm.elements
.name == '$element_name')
{
calloutForm.elements
.value = code ;
calloutElementFound = true;
}
}
if (!calloutElementFound)
{
return false;
}
return true;
}
function handle_selection()
{
if (callback())
{
opener.top.datacapture.refreshForm();
self.close();
} else {
alert('Please make a selection.');
}
}
function callback()
{
if (!set_datacapture_item_value( document.$form.$code_field.value)) {
alert('Fatal callout error. Did you close the datacapture window?');
}
// did not find a selected option!
return true;
}
-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#C0C0C0">
END
return;
}
sub print_footer {
print <<"END";
</BODY>
</HTML>
END
return;
}
Thx in advance