Hot Field Event

* On the Custom form, find the TWebDataGrid component . In the object inspector, switch to the Events. Create an event handler for OnHotField.

* Program the event to have this line of code after inherited;

Save your changes. Then run your exe again.

Given session number 123456 and part number 999, this event will output a URL like: /scripts/runisa.dll?TEST:DRILL:123456:999.

That bears some explanation! Why don't you test it and confirm it gives you a link to the DRILL page. Look at the URL, don't worry about the page content at this stage (we have a few more steps to get the current record displayed). Then come back here to understand what happened.

The OnHotField event is called for all hot fields, for each row, and the HTML for the grid is generated by the TWebDataGrid component. The variable s is passed in to the procedure. If you do nothing, s contains the data for the current field and that is sent out like any regular field.

What we want to do is create a URL which links to the DRILL page and passes enough information that when we get there, we know which record to load. That is done by passing the primary key value, which in this case is the part number.

WebHub provides a JUMP macro which is similar to the ACTION macro in that you just tell it the target PageID, and it handles dynamic link reconciliation when the web page is produced. The syntax is different however, because you can specify a visible phrase -- something the surfer will see.

We want to pass the part number as the command, and we want it to be the visible phrase.

The code above accomplishes this. [? JUMP Macro]


Copyright © 1995-1998 HREF Tools Corp. All Rights Reserved.
[ Credits ]
Last generated: Tue 09 Jun 1998 09:18:47 GMT