[ic] search-region using label causes more-list error

Ton Verhagen tverhagen at alamerce.nl
Fri Jul 13 11:37:26 EDT 2007


Quoting Ton:
>Hi All,
>
>I am using the following code on a page.
>
>Basically what I am trying to accomplish is displaying the search
>results found in a Perl block using the [search-region] mechanism
>including the more-list feature.
>
>Unfortunately, clicking the more list links will generate errors like:
>'Object saved wrong....'
>
>Would I need to save the search results manually in the Perl block?
>
>
>[perl]
>         my $label = 'mysearch';
>         my $ary = [
>                         [ 'return-A1', 'return-A2', ],
>                         [ 'return-B1', 'return-B2', ],
>                         [ 'return-C1', 'return-C2', ],
>                         [ 'return-D1', 'return-D2', ],
>                 ];
>
>         my $n = scalar @$ary;
>
>         $Search->{$label} = {
>                         matches => $n,
>                         mv_results => $ary,
>                         mv_matchlimit => 2,
>                         mv_field_names => [ 'field1', 'field2', ],
>         };
>         return;
>[/perl]
>
>
>[search-region label=mysearch]
>[search-list]
>         [item-code] - [item-param field2]<br>
>[/search-list]
>
>[more-list]
>         [more]
>[/more-list]
>[/search-region]


Tried another angle: used object option of search-region tag.
Result: Still no working more-list (shows only the first 3 results).

In this example a file is created in the tmp directory
tmp/s/session_id.cache_key

I am wondering why the more-list does not work in the example
below. Has anyone any idea of how we can get this puppy to work?

Many thanks in advance !



##### Code start #####

[if !scratch my_search_results]
[perl]
         my $out = [
                         [ 'PSC001' ],
                         [ 'PSC002' ],
                         [ 'PSC003' ],
                         [ 'PSC004' ],
                         [ 'PSC005' ],
                         [ 'PSC006' ],
                         [ 'PSC007' ],
                         [ 'PSC008' ],
                         [ 'PSC009' ],
                         [ 'PSC010' ],
                         [ 'PSC011' ],
                         [ 'PSC012' ],
                         [ 'PSC013' ],
                         [ 'PSC014' ],
                         ];

         $Scratch->{my_search_results} = {
                 mv_results => $out,
         };

         return;
[/perl]
[/if]

<xmp>
More matches stored as: [calc]$Tag->uneval(undef, 
$Scratch->{my_search_results});[/calc]

Session: [data session id]
</xmp>


[if scratch my_search_results]

         [search-region object=`$Scratch->{my_search_results}` ml=3]
<xmp>
         [search-list][item-code]
         [/search-list]
</xmp>
         [more-list][more][/more-list]
         [/search-region]

[else]
         No object !
[/else]
[/if]

##### Code end #####




Best regards,

Ton

--
Alamerce Nederland --- Cornerstone of eBusiness
Phone +31-40-2374381    info at alamerce.nl    http://www.alamerce.nl

eCommerce Solutions -- Consulting -- Website & Interchange Hosting 




More information about the interchange-users mailing list