IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2012-12-09T07:51:24Z by AntonAleksandrov
570 Posts

Pinned topic Change the title of the page

‏2012-06-26T20:00:06Z |
I have implemented multi page and fragment features of work light application.
And I want to know, is there way to change the title when I load each page?

  • IdanAdar
    288 Posts

    Re: Change the title of the page

    ‏2012-06-27T04:34:08Z  in response to SystemAdmin
    Well, I will assume that by "title" you mean some text you have set in your HTML?
    If so, you can perhaps change your layout so that the tag that has this text in it, is part of the fragment and this way, every time you load a page or a fragment you can change this text as well?

    Idan Adar | QA Engineer | IBM Worklight Mobile Platform
    • icw
      2 Posts

      Re: Change the title of the page

      ‏2012-12-06T04:40:29Z  in response to IdanAdar
      No. The title being referred to is the TITLE, <title>developerWorks : Post Message: Reply</title>

      As in the the title of the web page being viewed.

      The reason that this person can not is because they are using Pages and Fragments which uses the well know xmlHTTRequest to change the content will keeping the page the same.

      You'll need to waste several hours of your time... probably at least a month like I have... trying to create some way of hashing your pages and fragments out and creating a breadcrumbing structure yourself since this was obviously something seriously overlooked by IBM and they expect developers to create high level web apps using one single unmaintainable page and then use some voodoo show hide method while creating adapaters and implementing thousands of lines of Javascript to ensure that your pages actually stay in the worklight shell.

      As IBM will tell you... "You should look at JQuery Mobile, Sencha, or Dojo" to do something basic such as this.

      However, in my case I cannot use a 3rd party framework so it does me no good to look at other frameworks.
      • AntonAleksandrov
        22 Posts

        Re: Change the title of the page

        ‏2012-12-09T07:51:24Z  in response to icw
        You can change documents's title by using document.title property in JavaScript.
        document.title="my new title";