Skip to main content

Need help with Java Lightweight Component

No replies

I'm looking to write a lightweight component that takes a helpset name and id as parameters. It will behave very similar to the JHSecondaryViewer object, but instead of bringing up a secondary window or popup window, the new object will refresh the current JavaHelp browser with the new helpset and id. I guess you could call it a cross-helpset link of sorts. The JHSecondaryViewer object has served as a great template but I'm running into a problem when I try to set the JavaHelp browser to the new helpset. The new id displays in the content pane correctly but the navigation (TOC, Index, and Search) remain on the original helpset. Furthermore, when I click on a TOC item I receive ' BadID' messages and for Index items 'BadID' messages.

In my html page, the tag looks like this:

My java code has a getter and setter for both 'helpSet' and 'ID' and the famous setViewData method. I made my new object a JLabel instead of JButton, so I'm using mouseClicked instead of actionPerformed to perform my actions.

When the user clicks on the label, the content pane refreshes with the new id but the navigation remains on the original helpset. Here is that Java code:
Map.ID newId = null;
newId = Map.ID.create( currId, hs );
((JHelpContentViewer)container).setCurrentID( );

currId and hs are the parameters passed in by the tag. 'container' is the JHelpContentViewer found when the setViewData method runs.

I'm thinking my problem is a simple refresh problem or I'm missing a method somewhere to update everything correctly.

Does anyone have any helpful tips or something I can try? Thanks for your time!

David Cagle
Applications Developer
Publications Technology Development
(919) 531-4814
SAS ... The Power to Know


You may leave the list at any time by sending message with no subject and
are available at
Submit bug reports at