Change the title bar - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Change the title bar

Last post 08-21-2007 11:48 PM by romaik. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 08-17-2007 08:27 AM

    • romaik
    • Top 500 Contributor
    • Joined on 05-31-2007
    • Paris France
    • Posts 43

    Change the title bar

    Hi everyone.

    I would like to know if it is possible to change the title bar of the form. Like when you open a XSN file, the title bar says : "Form1 - Microsoft Office InfoPath 2003", and I would like to change "Form1" by data I will receive from a secondary data source (a external XML file basically).

    In the same way, forms for this form are saved under a name that does mean anything to users but means a lot to me (the ID of the file une the DB).

    Instead of having "1122334455.xml - Microsoft Office InfoPath 2003", I would like to have a "personnal" title bar. The saving buttons are all disabled, so users can only save using my custom save button (which saves it under the right name).

    I am using InfoPath 2003 SP2 and JScript.

     

    Any help is welcome.

    Regards,

    Romain 

     

    InfoPath 2003 SP2 User
  • 08-17-2007 10:33 AM In reply to

    Hi Romain, 

    thisXDocument.View.Window.Caption = "hello";

    This above line will let you set the window caption. You can set the data from you secondary dom to the above property.

  • 08-20-2007 12:34 AM In reply to

    • romaik
    • Top 500 Contributor
    • Joined on 05-31-2007
    • Paris France
    • Posts 43

     Hi Agni

    Thanks for the answer but I have difficulties making it work :s

    I tried to put XDocument.View.Window.Caption into a OnClick event and it works.
    But it won't work for the OnLoad event.

    Here is the code.

    function XDocument::OnLoad(eventObj)
    {
        thisXDocument.View.Window.Caption = "Hello !";
    }

    And it does not work. I also tried to put only  XDocument.View.Window.Caption = "Hello !"
    Is there something else I need to know about the OnLoad event ? 

    Regards,
    Romain 

    InfoPath 2003 SP2 User
  • 08-20-2007 01:46 AM In reply to

    • romaik
    • Top 500 Contributor
    • Joined on 05-31-2007
    • Paris France
    • Posts 43

    I found the way :)

    Xdocument does not exist yet in the OnLoad script which so XDocument.View.Window.Caption could not work.

    The solution : I put  XDocument.View.Window.Caption into the onSwitchView script and it works perfectly

    InfoPath 2003 SP2 User
  • 08-21-2007 11:32 AM In reply to

    Hi,

    XDocument actually exists onLoad, its  XDocument.View which does not exist onload.

  • 08-21-2007 11:48 PM In reply to

    • romaik
    • Top 500 Contributor
    • Joined on 05-31-2007
    • Paris France
    • Posts 43

     Thanks for the precision.

    It seams logic :) 

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