[ic] [sort] across [more] pages

Mike Heins interchange-users@interchange.redhat.com
Thu Aug 23 22:30:02 2001


Quoting Ron Phipps (rphipps@reliant-solutions.com):
> Thanks for the pointer.  I had thought about doing it a similar way with
> passing all of the options for the search as cgi values then building
> the search based on those cgi values instead of passing them like:
> /scan/se=/sf=/ etc.  However this would require that our static search
> links be rebuilt.  Do you know if it's possible to get the values that
> were submitted in a link that looks like this:
> /scan/sf=display/se=yes/se=Case%20Badges/sf=category/ml=15/tf=sku/to=f.h
> tml
> , without rewriting the link to pass the values as a cgi string?  It
> would even be enough if it came back as a complete string and I could
> then parse out the sort option, change it to the new value, and rebuild
> the string.
> 

You can do a quick-and-dirty pretty easily. Save the following to any
page and then access it.

    [page scan/ra=yes/sp=@@MV_PAGE@@]Test it[/page]
	<P>
    [loop code prod_group category description price:n ]
	[loop-calc]
		my $url;
		my $search;
		if( $search = $Session->{last_search}) {
		    $search =~ s!tf=\w+!tf=[loop-code]!
			    or $search .= "/tf=[loop-code]";
		}
		else {
			$search = 'scan/ra=yes/tf=code/sp=@@MV_PAGE@@';
		}
		my $url = $Tag->area($search);
		return qq{<A HREF="$url">Sort on [loop-code]</A><BR>};
	[/loop-calc]
    [/loop]

    <P>
    [search-region]
    <table>
	<tr>
	    <td>
		code
	    </td>
	    <td>
		prod_group
	    </td>
	    <td>
		category
	    </td>
	    <td>
		description
	    </td>
	    <td>
		price
	    </td>
	</tr>
    [search-list]
	<tr>
	    <td>
		[item-code]
	    </td>
	    <td>
		[item-field prod_group] 
	    </td>
	    <td>
		[item-field category]
	    </td>
	    <td>
		[item-description]
	    </td>
	    <td>
		 [item-price]
	    </td>
	</tr>
    [/search-list]
    </table>
    [/search-region]


-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

I have a cop friend who thinks he ought be able to give a new ticket;
"too dumb for conditions".