Making search results selectable

Making search results selectable

After creating an html-view for a search form, I want the user to be able to select one of the returned results, which will then be passed as a parameter to the next html-view. But I don't have a clue how to do this.

The attached codes is for the currently working html-view. It currently returns an ugly table showing each record matching the search criteria - so user can enter any data he has (phone, zip, name, etc.) and see which records might be the one he's looking for.

Now, I need to be able to somehow select the line in the results table that interests me, and pass that off to the next html-view which will display all of the data for that one record, and some additional options. I'm guessing I would pass an ID field to the new form, which will select the record, but I have no idea how to make each result selectable and linked to the correct ID.

Any help is greatly appreciated!



Here's the code for my currently working html-results-view

  1. htmlpage RefUSA_Data_Search_Results(search_query)
    displayname = "RefUSA Data Search Results"
    content
    <%{%>

        <%search_result  =  RefUSA_Data  [((((((((Phone_Straight.contains(input.search_query) || Company_Name.contains(input.search_query)) || Executive_First_Name.contains(input.search_query)) || Executive_Last_Name.contains(input.search_query)) || Address.contains(input.search_query)) || City.contains(input.search_query)) || State.contains(input.search_query)) || ZIP_Code.contains(input.search_query))  || Website.contains(input.search_query))];%>

    <table class="zc-viewtable"width="100%" border="1" valign="top">
    <caption class="zc-viewtitle">Possible Matches</caption>
    <tbody>
    <tr>
    <td valign="top">


    <table class="zc-viewtable width="100"%>
    <caption class="zc-viewtitle">Search Results</caption>
    <tbody>
    <tr class="zc-row-header">
    <td class="zc-viewrowheader">Business</td>
    <td class="zc-viewrowheader">First Name</td>
    <td class="zc-viewrowheader">Last Name</td>
    <td class="zc-viewrowheader">Phone</td>
    <td class="zc-viewrowheader">Website</td>
    <td class="zc-viewrowheader">Address</td>
    <td class="zc-viewrowheader">City</td>
    <td class="zc-viewrowheader">State</td>
    <td class="zc-viewrowheader">Zip Code</td>
    </tr>

     <%for each data_row in search_result
        {%>
        <tr>
            <td><%=data_row.Company_Name%></td>
            <td><%=data_row.Executive_First_Name%></td>
            <td><%=data_row.Executive_Last_Name%></td>     
            <td><%=data_row.Phone_Number_Combined%></td>
            <td><%=data_row.Website%></td>
            <td><%=data_row.Address%></td>
            <td><%=data_row.City%></td>
            <td><%=data_row.State%></td>
            <td><%=data_row.ZIP_Code%></td>

        </tr>

       
        <%}%>


       


    <%}%>