16 Replies Latest reply on Dec 10, 2009 6:35 PM by cescamilla

    Go back to previous display in ActiveView

    gpriyanka

      Hi,

       

      How can I go back to the previous display in ActiveView?

       

      Currently I have a set of diplays in ProcessBook and I want them to work in ActiveView as well.

       

      In ProcessBook a new display is opened by using a box with VB code Application.Displays.Open("path", True). This new display is opened in a new window. To close this new display an exit box is created with the VB code ThisDisplay.Close(False).

       

      This setup works fine in process book but not in ActiveView. The new display opens in the same window but it cannot go back to the previous page. Any suggessions?

        • Re: Go back to previous display in ActiveView
          hanyong

          Hi,

           

          May I know why you are using VBA to open a new display programmatically instead of using buttons to link up the displays?

           

          I believe that using buttons in Processbook should work when you open the pdi in ActiveView. So we can use buttons to link different displays (remember to set it to check relative path and not open the display in new window).

           

          If you want to configure it such that instead of clicking on another object/symbol other than buttons to open up another display, we can always put the button on the foreground but making the button invisible so that the same effect can be created.

           

          Otherwise i think the other options would be to go down to including codes in the html(javascript or vbscript) to link up different displays.

            • Re: Go back to previous display in ActiveView
              gpriyanka

              Hi Han,

               

              I am using rectangles instead of buttons to go to a new page because they server other purposes as well (multistate).

               

              I could put in an invisible button for the boxes and open the secondary display. If so, How would I go back to the previous display? I have different displays that link to the same secondary display and I want the users to go back to their own primary display. Is there some function/sub that has a back functionality?

                • Re: Go back to previous display in ActiveView
                  cescamilla

                  I seem to remember that the way PI ActiveView works it allows you to have one Display open per control, so as you have only one control you can only see one screen. You can't open a secondary display if you do not replace the previous one. The way this works when you have a "Open in new window" configuration is: the ActiveView ignores that command and opesn the display with "Replace" instead.

                   

                  Maybe what you want to do is to get to a particular secondary display and have the ability of going back (automatically) to whatever the previous display was, but it may not be the same previous one for a secondary screen.

                   

                  If that is the case I think there is a workaround to achieve that without having multiple displays.

                  • Re: Go back to previous display in ActiveView
                    hanyong

                    I don't think there is a native back functionality that links back to another Processbook display. I heard of an alternative in Processbook from Cristobal to link back to the previous pdi using vba, but that is opening a new window for the secondary display and closing that to bring the user back to the primary display. This would not work given that we using ActiveView.

                     

                    What I can think of is like my last suggestion in the previous post, instead of linking the displays within the pdi, we can use javascript or html form to link to another webpage that displays the secondary display, that way the back button in IE should work.

                     

                    If we really need to allow user to click on an element in the pdi to do that, I think we can create a Windows Script Component that includes a javascript to link to another webpage that shows the secondary display.

                     

                    I have not tried that yet to know exactly how it works, if you can try that, it would be great. I'll try to do that later in the day and let you know my findings.

                     

                     

                     

                     

                      • Re: Go back to previous display in ActiveView
                        hanyong

                        I've realised that there is a easier way to do this. In Processbook buttons, we can write a URL directly as the action. What happens in Processbook is that it will open the URL in your internet browser. If we use that PDI with ActiveView, the button will bring you to the URL in the same browser window. That way the back button of the browser will automatically bring the user back to the previous page.

                         

                        So assuming I have a primary PDI in the primary page (mainpage.html), and I insert a button that points to the secondary page (page2.html) with the second PDI. I can configure the action as a URL like "http://hytinad.haydd.com/page2.html".

                         

                        Perhaps you can try this and see if it works for you?

                          • Re: Go back to previous display in ActiveView
                            hanyong

                            I'm sorry Priyanka, I think i lost track of parts of your requirement along the way.

                             

                            If you want to keep the same behaviour as in processbook, to open the other displays in new window, buttons can still be used. I am assuming that all displays are seperate html files here. We can configure action to open up IE (or any other browser you are using), passing the new page as a parameter for example,

                             

                            action="C:\Program Files\Internet Explorer\iexplore.exe" "hytinad.haydd.com/page2.html"

                             

                            1st part points to the application executable (which is IE) and 2nd part is the URL passed to IE to be opened when IE runs.

                             

                            I hope this one would be more helpful to you.

                              • Re: Go back to previous display in ActiveView
                                gpriyanka

                                Han.

                                 

                                I am a little confused. How do I turn the PDI file into html? How will that affect viewing files in processbook.

                                 

                                One thing that I did not mention before was that I want to use the same set of files for both processbook and ActiveView because they are routinely updated and I don't want to update two sets of files.

                                 

                                I was hoping for a simple solution because I will have to edit about 500 displays to make this work.

                                 

                                Priyanka

                                  • Re: Go back to previous display in ActiveView
                                    cescamilla

                                    You don't convert the .pdi's to .html's

                                     

                                    The main thing is, you use an html file and the ActiveX control is embedded, this control can access pdi files with relative addresses and I'm guessing you have no issues with that.

                                     

                                    There is no easy way to make ProcessBook know what the previous display is, however it can be worked out with having a new window open so when you close the new window you get to the preovious one. But this won't work on active view.

                                     

                                    There is another solution, but it involves creating a menu in the pdi files. so you have pre-defined functions for forward and backward, notice that clicking Back on the broswer or refreshing the current page will efectively reset the menu navigation and will send you to the main .pdi file.

                                     

                                    So, what Han Yong proposed is to create a different html file for some of the pdi's (reference on how to create those below) so when you click refresh it won't sent you away, and when you press back it will send you to the previous .pdi

                                     

                                    The way you do this is the same way you created the main html file. The one you land on when you request the server you have right now. you just copy that, rename it, and edit the source pdi line inside the html code.

                                     

                                    Is there a reason not to add a "return" button in the .pdi? does the .pdi file you go back to change dynamically?