• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Problem With Custom Toolbar Button Functionality

Community Beginner ,
Jul 05, 2012 Jul 05, 2012

Copy link to clipboard

Copied

I’m working in RoboHelp 8 webhelp and have created a print button in my skin to print content.  In initial testing it’s worked great. I’ve tried out different inline and external javascript and found success with each method.

One example to create the functionality:

On the Action tab, in the OnClick field enter:

printAction()

In the inline JavaScript field enter:

var printAction = function()

{

var topicPane = top.frames[1].frames[1];

topicPane.focus();

topicPane.print();

}

When I generate the help and click the print toolbar button, the print dialogue box opens exactly as I want it to.

The problem occurs once I move the help over to a server. I click the button and nothing happens. I see the error on page message display. When opened it reads:

Line 24
Char 1
Error: ‘undefined’ is null or not an object
Code: 0
Url:  [My file path]/webhelp/whskin_tbars.htm

Here is the code from that file up until line 26:

<html>

<head>

<title> WebHelp Navigation Toolbar </title>

<meta name="generator" content="Adobe RoboHelp 8" />

<meta name="description" content="WebHelp 5.50" />

<style>

<!--

body {margin:0;}

-->

</style>

<script language="javascript" src="whver.js"></script>

<script language="javascript1.2" src="whutils.js"></script>

<script language="javascript1.2" src="whmsg.js"></script>

<script language="javascript1.2" src="whproxy.js"></script>

<script language="javascript1.2" src="whmozemu.js"></script>

<script language="javascript1.2" src="whtbar.js"></script>

<script type="text/javascript" language="JavaScript1.2">

//<![CDATA[

var printAction = function()

{

var topicPane = top.frames[1].frames[1];

topicPane.focus();

topicPane.print();

}

If I'm using different javascript the error line obviously changes. The first time I was testing it (using Willam van Weelden's toolbarscripts01.js in my project) it pointed to line 50 in the whskin_tbars.htm which is: 

gsIGlossary = "wht_glo_n.gif";

The error occurs in both IE7 and Firefox9.

Views

998

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 05, 2012 Jul 05, 2012

Copy link to clipboard

Copied

Hi,

This is very queer. If I read correctly, several methods all throw an exception when placed on a server? Strange that the script would give problems on a server whilst working locally.

What happens when you create a new project and add the print code? Do you see the same behaviour?

Greet,

Willam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 06, 2012 Jul 06, 2012

Copy link to clipboard

Copied

LATEST

Hi William.

This is indeed the case. If I start a brand new project, create a print tab and add code it works locally when generated. When the files are placed on a server, clicking the print button in the toolbar no longer works.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp