Using a task pane to switch views - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Using a task pane to switch views

Last post 07-14-2010 01:54 PM by Ted Fitch. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-13-2010 10:04 AM

    Using a task pane to switch views

    Hi I have a form which contains 18 views. I want to provide a task pane that allows the user to choose their views, from a hyperlink. Can anyone tell me what the html syntax is to link to a view in the form? Thanks Darryl
    Filed under:
  • 07-13-2010 10:18 AM In reply to

    Re: Using a task pane to switch views

  • 07-13-2010 11:00 AM In reply to

    Re: Using a task pane to switch views

    Hi Ted I have, and it's brilliant. The problem is that you lose control of the order the views appear in. I want to put them in a certain order, so I was planning to create a new pane. Thanks Darryl
  • 07-14-2010 02:51 AM In reply to

    Re: Using a task pane to switch views

    I have taken 'inspiration' from Matt's switching views script, and managed to get something that does what I need i.e. allows me to dictate which order the links appear in.  Here is the rather clumsy, but working, script:

     

    <html>
    <head>


    <script language="JavaScript">


    var XDocument;
    var View;


    function PrintLinks()
    {
        // Get a reference to the XDocument object for the InfoPath Form.
        XDocument = window.external.Window.XDocument;

        // Set the reference to the View object.
        View = XDocument.View;

    }

     

    </script>
    <style type="text/css">
    .newStyle1 {
     font-family: Verdana;
     font-size: xx-small;
    }
    </style>
    </head>


    <body onload="PrintLinks()" class="newStyle1">


     <div id="ViewLinks"></div>

    <a href='#' OnClick=View.SwitchView("InitialCaseCreation")>1. Initial case creation</a><br /><br />
    <a href='#' OnClick=View.SwitchView("EngagementAcceptance")>2. Engagement Acceptance</a><br /><br />
    <a href='#' OnClick=View.SwitchView("EngagementAcceptancePrintview")>3. Engagement Acceptance - Print view</a><br /><br />
    <a href='#' OnClick=View.SwitchView("HeaderPage")>4. Header page</a><br /><br />
    <a href='#' OnClick=View.SwitchView("DebtorDetails")>5. Debtor details</a><br /><br />
    <a href='#' OnClick=View.SwitchView("Employment")>6. Employment</a><br /><br />
    <a href='#' OnClick=View.SwitchView("Directorships")>7. Directorships</a><br /><br />
    <a href='#' OnClick=View.SwitchView("TradingPartnerships")>8. Trading, Partnerships, etc</a><br /><br />
    <a href='#' OnClick=View.SwitchView("Assetsinputtable")>9. Assets (input table)</a><br /><br />
    <a href='#' OnClick=View.SwitchView("AssetsHeritageCurrentResidency")>10. Assets Heritage, Current Residency, etc</a><br /><br />
    <a href='#' OnClick=View.SwitchView("IncomeBenefitandExpenses")>11. Income, Benefit and Expenses</a><br /><br />
    <a href='#' OnClick=View.SwitchView("IandEguidance")>12. I and E Guidance</a><br /><br />
    <a href='#' OnClick=View.SwitchView("Liabilities")>13. Liabilities</a><br /><br />
    <a href='#' OnClick=View.SwitchView("Recall")>14. Recall</a><br /><br />
    <a href='#' OnClick=View.SwitchView("SupplementaryQuestionnaire")>15. Supplementary questionnaire</a><br /><br />
    <a href='#' OnClick=View.SwitchView("PrintView")>16. Print view (4-15 excl 12)</a><br /><br />

     


    </body>
    </html>
     

    DarrylGould:
    Hi Ted I have, and it's brilliant. The problem is that you lose control of the order the views appear in. I want to put them in a certain order, so I was planning to create a new pane. Thanks Darryl

  • 07-14-2010 01:54 PM In reply to

    Re: Using a task pane to switch views

    Hi Darryl,

    Thanks for sharing this!!

    Ted

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.