IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 3 replies
  • Latest Post - ‏2012-12-09T07:51:24Z by AntonAleksandrov
SystemAdmin
SystemAdmin
570 Posts

Pinned topic Change the title of the page

‏2012-06-26T20:00:06Z |
Hi,
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?

Thanks
  • IdanAdar
    IdanAdar
    288 Posts

    Re: Change the title of the page

    ‏2012-06-27T04:34:08Z  
    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
    icw
    2 Posts

    Re: Change the title of the page

    ‏2012-12-06T04:40:29Z  
    • IdanAdar
    • ‏2012-06-27T04:34:08Z
    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
    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
    AntonAleksandrov
    22 Posts

    Re: Change the title of the page

    ‏2012-12-09T07:51:24Z  
    • icw
    • ‏2012-12-06T04:40:29Z
    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.
    You can change documents's title by using document.title property in JavaScript.
    E.g:
    document.title="my new title";