/ Forums / Advansys Formativ / Creating Solutions with Formativ / Interact with Portal with Form Open

  • Creator
    Topic
  • #4402
    ctaleck
    Participant

      I am creating reports that I am displaying in a portal. The report is based on criteria from a form I have open. However I’ve cannot get the portal to have focus when the form is active to allow the user to scroll the view. Is this possible while keeping the form active?

      Here is main code:

       Sub Main(Client, GWEvent)
      Set oPortals = GroupWise.PortalManager.Portals

      If oPortals Is Nothing Then
      MsgBox "Application Error: Portal Manager is not available. " & vbCRLF & "Exiting..."
      Exit Sub
      End If

      setFieldList(True)
      PopulateManagerList
      SearchForm.Show

      While SearchForm.ModalResult <> mrCancel
      Utilities.DoEvents
      Wend

      CloseView

      End Sub
    • Author
      Replies
    • #8097
      Support 3
      Participant

        Formativ uses the Model dialog, meaning it does not release the input focus until it is closed. You can not switch back to the window that created the dialog box until the dialog box is closed. However, this does not prevent the user from switching to other windows or applications.

        There is a work-around, you can use the modeless HTML dialog and call the Applet when required using the Formativ API which will allow you to set forus to the portal window.

        You can use the sample code below to create the HTML dialog. If you want to pursue this approach, we will recommend to create the proto-type and make sure you can call your applet and perform tasks.

            ' Create a new instance of the internet explorer application.
            set iExp = CreateObject("InternetExplorer.Application")
            With iExp
              .Height = 600
              .Width = 700
              .ToolBar = FALSE
              .Visible = True
              .Navigate "c:tempmyform.htm"
            End With
        
            Set iExp = Nothing  
        

        Regards,
        Advansys Support

        #8096
        ctaleck
        Participant

          I am not familiar with the FormativAPI yet. Maybe I need to rethink my solution. Basically, I am trying to create a report (in HTML) which can be previewed first (does not have to be a Portal) and then printed while having a form open.

          Are there any other approaches people have used to do this? I am currently researching these controls: “EmbeddedWB,” “HTMLEditorEx” or “OleContainer” to see if they can help. Any insight would be appreciated.

          #8098
          ctaleck
          Participant

            One more thing to clarify…

            So even though I am using the “frmMain.Show” instead of “frmMain.ShowModal” it still is acts as modal because all of the Formativ application is modal to the GroupWise application (but not other external applications)?

            #8100
            Support 3
            Participant

              “frmMain.Show” method will show the dialog and continue to the next line. However, the applet execute as model thus you will not able to swith back to the window (i.e. GroupWise client/portal) until the applet complete.

              Does your application display the “Review Process Report” form when you create the portal?

              Another thought, you could add a “Print” button to your report html then your applet display the portal and exit. Your user view the portal (i.e. portal will have the focus) and when they ready to print then they can press the Print button which will execute your applet again to show the “Review Process Report” form.

              You will need to follow the steps below to call the applet from the portal.

              Step 1: Add the button html to the Portal html

               
              <INPUT TYPE="HIDDEN" NAME="formativapplet" VALUE="c:Documents and Settingsuser-nameMy DocumentsAdvansysFormativAppletsmyapplet.vbf"><INPUT TYPE="SUBMIT" NAME="printBtn" VALUE="Print">
              

              Applet code to create the button html

                iBtnHtml = " <INPUT TYPE=""HIDDEN"" NAME=""formativapplet"" VALUE=""" & utilities.currentappletname & """><INPUT TYPE=""SUBMIT"" NAME=""printBtn"" VALUE=""Print"">"
                msgbox iBtnHtml  
              

              Step 2: Make sure the Portal.RunApplets is set to true

                
                 oPortal.ID = "test"
                 oPortal.TabCaption = "CQQ"
                 oPortal.RunApplets = TRUE
              

              Step 3: When the Print button pressed from the Portal and the applet execute then you will need to identify whether the applet executed by the portal.

              Sub Main(Client, GWEvent)
              
                ' What mode are we being executed in?
                if (GWEvent = "HTML_TRIGGER") then
                  ' display the Review Process Report form
                else
                  ' Create the portal
                end if
              
              End Sub  
              

              For reference, you can review our cool solution Today View which uses the technique above.

              Hope this helps.

              Regards,
              Advansys support

              #8095
              ctaleck
              Participant

                Interesting development: The Portal now allows scrolling while a form is open with no changes except a restart of my machine and GroupWise!

                I do so much development on my machine (with many crashes of GroupWise from bad code) that I’m thinking I had bad memory which needed to be cleared out.

                In the meantime, I also explored the “EmbeddedWB” control which also worked for me.

                I also considered your suggestion but opted not to put a control on the report that would “ruin” it visually.

                Thanks.

                #8099
                Support 3
                Participant

                  Interesting findings, good luck with it.

                  Regards,
                  Advansys Support

                Viewing 6 replies - 1 through 6 (of 6 total)
                • You must be logged in to reply to this topic.