[ic] Newbie: Coordinated Search

zensuriert interchange-users@interchange.redhat.com
Wed Mar 13 06:20:02 2002


I'm quite new to interchange and I try to figure out how to make a more
advanced search page but I can't make it working.

It should be possible to search for a word in a category - which I
managed to do - and to search in a category with radiobuttons which
contain Boolean-variables.

This is the code I have so far:


------------------------
__TOP__
__LEFT__

<h3>Advanced Search<h3>
<br>
<form action="[area search]" method=post>

<table>
<tr>
<td>
<b>Search by Field:</b><br>
Search for

<input type="text" name=search1>

in the
 
<select name=searchfield>
<option value="">
<option value="sku">SKU
<option value="name">name
<option value="description">description
<option value="price">price
</select>

field. <br><br>

Grad1:<br>
<input type="radio" name=search2 value=""> don't take this into
account<br>
<input type="radio" name=search2 value="1"> yes<br>
<input type="radio" name=search2 value="0"> no<br>

<INPUT TYPE="Hidden" name="mv_sql_query" value="SELECT code FROM
products WHERE 'searchfield' LIKE search1 AND grad1 LIKE search2">

</td>
</tr>
</table>
</form>

__BOTTOM__

------------------------------

As you can see I tried it with an SQL-Query as i don't know how to solve
that in another way -didn't really understand the documentations- but it
doesn't work.

If you enter a search-string and check a button and the data isn't in
the database the results-page is displayed correctly: 'No matching data
could be found...' ,but when data is found it doesn't list it in a table
but leaves it blank.

So I'm not sure if it's not the results.html which produces the problem.


Code of results.html:

---------------------------

__TOP__
__LEFT__
<he>Searchresults</h3>
[search-region]
[on-match]
<table cellpadding=5>
<tr>
<th>Test #</th>
<th>name</th>
<th>Price</th>
</tr>
[/on-match]
[search-list]
<tr>
<td>[item-code]</td>
<td><a href="[item-code].html">[item-field name]</a></td>
<td align=right>[currency][item-field price][/currency]</td>
</tr>
[/search-list]
[on-match]
</table>
[/on-match]
[no-match]
<p>No matching data could be found...</p>
[/no-match]
[/search-region]
<hr>
<p align=center>[page index]Welcome Page</a></p>
__BOTTOM__

------------------------------

I looked in the interchange documentations and searched the mailinglist
but still can'T figure out how to do it.
Any help greatly appreciated.

TIA
Philipp Hammer-Pohlau