13 Replies Latest reply on Oct 8, 2010 6:34 AM by Willam van Weelden

    Back and Print button not working

    Gleedo
      Our tech author just managed to get the print and back buttons to display on our webhelppro project, but nothing happens when they are clicked!

      Any ideas what might be wrong? I thought once they display, they should work lol
        • 1. Re: Back and Print button not working
          Gleedo Level 1
          OK, i just realised you need to add javascript to print and back buttons to get them to work lol.....ooops.

          I go the back button working just fine.

          However, i can not get the print to work. This is because i do not know the name of the <iframe> that the main content is displayed in.

          I have toolbar up top, toc down left and main content window to right.

          Can anyone tell me the name of the content frame?

          Im assuming frames are used of course.

          Thanks
          • 2. Re: Back and Print button not working
            Peter Grainge Adobe Community Professional (Moderator)
            See Snippet 24 on my site.

            • 3. Re: Back and Print button not working
              Gleedo Level 1
              quote:

              Originally posted by: Peter Grainge
              See Snippet 24 on my site.



              Thank you Peter, that did the trick :)

              I havent done javascript for years and couldnt remember to use top. etc..

              • 4. Back and Print button not working
                echopraxia Level 1
                This isn't working for me in RH 7.0.2 (WebHelp, not WebHelp Pro). The new button appears, has hover text and an image, however on click doesn't trigger a print dialogue.

                FF 3, IE 8 (yes.. beta)
                No pop-up blockers, etc.
                • 5. Re: Back and Print button not working
                  echopraxia Level 1
                  Resolution found :) A posting by "Authorgraphic" on another site (I can only assume this is the same "Authorgraphic" on this forum) posted the following:

                  "window.parent.frames[1].frames[1].focus();window.parent.frames[1].frames[1].print();

                  I have tested this in Internet Explorer 7, Mozilla Firefox 3, and it works OK.
                  It also works in Apple Safari 3.1.2, although the printout it scaled down to
                  about 80% of correct size (text and screenshots). "

                  This goes into WebHelp Skin Editor > Toolbar tab > Print Topic > Edit icon. Custom Toolbar Item > Action tab > Javascript OnClick

                  Entries are not required in the inline javascript section.
                  • 6. Re: Back and Print button not working
                    michaelgd
                    I tried your solution and while it worked on my machine when I compiled the help system (clicking the Print button did, in fact, bring up the Print dialog), my client informed me that when she loaded the HTML help system onto the Web site server, it refused to function. She said she received an "Error on Page" message. She also mentioned that when she hovers the cursor over the Print button, the tooltip reads Javascript null. Any thoughts? I am a technical writer working on a help system and my client is beside herself. She really wants this to work although I did tell her that the print functionality in RoboHELP HTML is nonexistent because the help topic opens in a browser window and users will use the print functionality of the browser to print help topics. I confirmed this with Adobe Technical Support; the Print function is only avaliable when building help files in RoboHELP for Word (for stand-alone software program help files), but not in RoboHELP HTML.
                    • 7. Re: Back and Print button not working
                      Peter Grainge Adobe Community Professional (Moderator)
                      See Snippett 24 on my site.

                      • 8. Re: Back and Print button not working
                        CHanechak

                        I just wanted to let people know that I tried this and it works for both Mozilla Firefox 3.5.7 and Internet Explorer 7.0.

                         

                        I had gotten a solution (below) in a similar vein about 6-7 years ago from the forums when I first started working with WebHelp. This worked beautifully in Internet Explorer and still does a version or two later. However, the software development company I work for recently starting developing with Firefox. I discovered that if I bring the help up in Firefox using the code below for the "Print Topic" button's onClick command that the browser prints the toolbar frame rather than the current topic frame.

                         

                        javascript:parent.frames[1].bsscright.focus();window.print();

                         

                        Whereas window.parent.frames[1].frames[1].focus();window.parent.frames[1].frames[1].print(); works great for WebHelp in either IE or Firefox.

                        • 9. Re: Back and Print button not working
                          stephenure

                          What is the javascript for the back button?

                          • 10. Re: Back and Print button not working
                            Willam van Weelden Adobe Community Professional & MVP

                            Hi,

                             

                            history.go(-1)

                             

                            Greet,

                             

                            Willam

                            • 11. Re: Back and Print button not working
                              stephenure Level 1

                              Thanks, but that does not work...

                               

                              I put a back button in the main toolbar and set that as the ON-click script. No luck.

                               

                              In order to get the print buttton to work I used...

                               

                              var printAction=function()

                              {

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

                              topicPane.focus();

                              topicPane.print();

                              }

                               

                              I want the back button to return the main frame to the previous content.

                               

                              Any ideas?

                              • 12. Re: Back and Print button not working
                                Willam van Weelden Adobe Community Professional & MVP

                                Hi,

                                 

                                In your button, go to the Action tab. In the field OnClick, enter top.frames[1].frames[1].history.go(-1);. This will set the topic to the previous topic.

                                 

                                Greet,

                                 

                                Willam

                                • 13. Re: Back and Print button not working
                                  stephenure Level 1

                                  That works.

                                   

                                  Thank you.