Hi,
I have a requirement to provide a callout button and in the form that is opened I have
1.Two Multiselect Boxes..
First Multiselect Box:---Values are populated from a File
Second Multiselect Box---If the Form is opened in edit mode Then values of the DCT feild are populated. If the form is opened AS New Form it is empty.
2. Add and Remove Buttons between these two Boxes.
3.Finish and Cancel Buttons.
If the form is opened in edit mode I have to populate the first Multiselect box with the values that are not present in the second Multiselect box...
For this I have tried to compare the two arrays as below
#!D:\Interwoven\TeamSite/iw-perl/bin/iwperl
use TeamSite::CGI_lite;
use TeamSite::Config;
$|=1;
my $cgi = TeamSite::CGI_lite->new();
$cgi->parse_data();
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 $element_value = $cgi->{'form'}{'iw_item_value'};
my
@second=split(/\n/,$element_value);
my $debug_output = "D:/Interwoven/TeamSite/local/config/options.txt";
open(FILE, $debug_output) || die("Could not open file!");
my
@optionscopy=;
close FILE;
my
@options=parse_flat_file($debug_output);
if (!
@options){
error_message( 'No available selection options were found.' );
exit 1;
}
%second = map {$_, 1}
@second;
@difference = grep {!$second{$_}}
@optionscopy;
print_ui(
@difference);
exit 0;
But the difference array gets all the values of options array.
I have to get all the values in the file except the values in the array "second"...
can some one suggest where am i going wrong?