Using the help system

To use this sample as a help system, ignore the table at the bottom or drag the horizontal divider above the table down to hide it. Then select a help topic title from the tree and you'll see the topic displayed in the text component at the right. If the topic has a link, click it and the new topic will be loaded.

Here's how it works: The tree is bound to the data set named urlTds. One column of urlTds contains the same data as is in the tree nodes. Another column contains URLs. Because the tree is a JdbNavTree, selecting a value in it causes the data set to navigate to a row with a matching value. (An error dialog is displayed if no match is found.) We listen for dataset navigation events. In our event handler, we use the value in the URL column to load the HTML page it identifies into our text component.

Almost the same thing happens when you follow a hyperlink. When a JdbEditorPane's columnNameURL property is set, the component automatically searches that column for the hyperlink's URL and loads the associated HTML page. Because all of our links are to other HTML pages in this help system, their URLS are already in urlTds, so the search will succeed and the HTML page will be loaded.

You can also navigate in the JdbTable at the bottom of the dialog to force an HTML page to be loaded. In the table, drag the right edge of the first column to make the column very wide. You'll be able to see that the node in the tree corresponding to the row you chose becomes selected, and the appropriate help file is displayed in the JdbEditorPane.