Webspeed search Details

Iceman_a

New Member
I have a page that pulls up a list of records. I want to be able to click on a record and have that record displayed in details. I have that piece kind of working except that no matter which record I click on, I get the first record in the table. Any ideas?
 

cup99

New Member
Please let us know what code you are using to find the record that you click on.

In my webspeed programs, I use the ROWID to find the record that I want. When you click on the record that you want, submit the ROWID of the record and use this to retrieve the correct record.

Depending on how you are displaying the records and then selecting it, this can be done in several ways.
 

Iceman_a

New Member
This is the Listings Code:

<HTML>
<HEAD><TITLE>Sales Representatives</TITLE>
<SCRIPT LANGUAGE=SpeedScript>
/* Used in a output-headers because of the cookie issue */
/*Procedure output-headers:
If get-cookie("Fred") = "" then
Do: /* User must have skipped the login screen */
REQUEST_METHOD = "GET".
Run login.r.
Return error.
End.
End procedure.
*/</SCRIPT>
</HEAD>
<BODY bgcolor=white>
<CENTER>
<TABLE border=2>
<!--WSS For each salesrep no-lock: -->
<TR><TD> `salesrep.sales-Rep` </TD>
<TD>
<A HREF="sales_rep_upd.r?RowID=`url-encode(string(rowid(salesrep)),?)`">
`html-encode(rep-Name)` </A>
</TD>
<TD> HREF="sales_rep_upd.r?RowID='url-encode(string(ROWID(salesrep)),?)`">
`html-encode(region)` </TD>
</TR>
<!--WSS End. -->
</TABLE>
<P>
<A HREF="sales_menu.r">Return Main Menu</A>
</CENTER>
</BODY>


This is the Detail Code:

<html>

<head>
<title>Sales Representative Details</title>
</head>

<body bgcolor=white>
<center>
<A HREF="sales_rep_listing.r">Back to sales rep. listing</A>
<P>
<form method="POST" action="sales_rep_upd.r">
<input type="hidden" name="RowID">
<table border="0">
<tr>
<td align="right">Sales Rep. ID:</td>
<td><input type="text" size="20" name="ID"></td>
</tr>
<tr>
<td align="right">Name:</td>
<td><input type="text" size="20" name="repName"></td>
</tr>
<tr>
<td align="right">Region:</td>
<td><input type="text" size="20" name="region"></td>
</tr>
</table>
</form>
</center>
</body>
</html>

I also have a .w file for mapping html to the record data.
 

cup99

New Member
It looks to me like you are using the HTML Mapping feature in progress. I don't use this to develop in Webspeed so I can't help you.

One question though, how are you finding the record. What is the code you are using as I can only assume it is this which is causing the problem.

I don't know how the HTML Mapping works in progress but I can guess that it is the .w file that is retrieving the records. I had a quick look at how to set one up and noticed that when you select the data source you can use a freeform query. Once set up you should be able to change the OPEN_QUERY trigger to pass it the value of the ROWID that you need to retrieve.

Somewhere in the HTML Mapping process it needs to know what ROWID to use in the query.

I hope this helps.

If not, my advice is to simply use embedded speedscript in HTML files as it is more flexible.
 
U

Unregistered

Guest
Check for a ROWID like cup99 mentioned or your find statement must be specific enough to identify a unique record. any index set on the table you are searching?
 
U

Unregistered

Guest
I also agree with cup99. The embedded speedscript method is much more flexible. I mix speedscript, html, javascript and even vbscript with great success. I have more control as well.
 
Top