S Stefano Di Chiano Active Member Licensed User Sep 8, 2020 #1 Hi, I'm looking for a way to change the layout Page Title attribute from code. I have a module that loads the same layout for every language, but then writes the texts based on which one the user selected. I'd like to change the navigation bar text based on the selected language as well, but the layout Page Title attribute seems unreachable from code to me. To be more clear, this is the attribute I'm talking about: For example, if I write "English" instead of "Page" like in the image, the navigation bar would be showing "English" on that module no matter what the user selected. If there is a way to change it from code when I show the page it would be great.
Hi, I'm looking for a way to change the layout Page Title attribute from code. I have a module that loads the same layout for every language, but then writes the texts based on which one the user selected. I'd like to change the navigation bar text based on the selected language as well, but the layout Page Title attribute seems unreachable from code to me. To be more clear, this is the attribute I'm talking about: For example, if I write "English" instead of "Page" like in the image, the navigation bar would be showing "English" on that module no matter what the user selected. If there is a way to change it from code when I show the page it would be great.
klaus Expert Licensed User Longtime User Sep 8, 2020 #2 Have you tried Page1.Title ? Page1 is the name of the Page. Page1 is the default page in B4i. You probably have the code below, where you can add Page1.Title = "My page name": B4X: Copy Page1.Initialize("Page1") Page1.RootPanel.LoadLayout("Page1") Page1.Title = "My page name" Upvote 0
Have you tried Page1.Title ? Page1 is the name of the Page. Page1 is the default page in B4i. You probably have the code below, where you can add Page1.Title = "My page name": B4X: Copy Page1.Initialize("Page1") Page1.RootPanel.LoadLayout("Page1") Page1.Title = "My page name"
Erel B4X founder Staff member Licensed User Longtime User Sep 8, 2020 #3 With B4XPages, it is done with: Code: Copy B4XPages.SetTitle(Me, "new title") Upvote 0
S Stefano Di Chiano Active Member Licensed User Sep 8, 2020 #4 klaus said: Have you tried Page1.Title ? Click to expand... Yes, I tried. I thought it was that too, but it wasn't. Erel said: B4XPages.SetTitle(Me, "new title") Click to expand... I added B4XPages library but it gives me the following error: Unknown type: b4xmainpage<br />Are you missing a library reference? Click to expand... Upvote 0
klaus said: Have you tried Page1.Title ? Click to expand... Yes, I tried. I thought it was that too, but it wasn't. Erel said: B4XPages.SetTitle(Me, "new title") Click to expand... I added B4XPages library but it gives me the following error: Unknown type: b4xmainpage<br />Are you missing a library reference? Click to expand...
Erel B4X founder Staff member Licensed User Longtime User Sep 8, 2020 #5 Stefano Di Chiano said: I added B4XPages library but it gives me the following error: Click to expand... This is only relevant if you create a project based on B4XPages: [B4X] B4XPages - Cross platform and simple framework for managing multiple pages Upvote 0
Stefano Di Chiano said: I added B4XPages library but it gives me the following error: Click to expand... This is only relevant if you create a project based on B4XPages: [B4X] B4XPages - Cross platform and simple framework for managing multiple pages
S Stefano Di Chiano Active Member Licensed User Sep 8, 2020 #6 Erel said: This is only relevant if you create a project based on B4XPages: [B4X] B4XPages - Cross platform and simple framework for managing multiple pages Click to expand... I didn't because it was an old project that I had to update. So I can't change it otherwise? Upvote 0
Erel said: This is only relevant if you create a project based on B4XPages: [B4X] B4XPages - Cross platform and simple framework for managing multiple pages Click to expand... I didn't because it was an old project that I had to update. So I can't change it otherwise?
Erel B4X founder Staff member Licensed User Longtime User Sep 8, 2020 #7 This is really not relevant to this discussion. All the ways to update the title are listed above. Last edited: Sep 8, 2020 Upvote 0
klaus Expert Licensed User Longtime User Sep 8, 2020 #8 Post your project as a zip file. Otherwise it is impossible to help you. Upvote 0
S Stefano Di Chiano Active Member Licensed User Sep 8, 2020 #9 Stefano Di Chiano said: Yes, I tried. I thought it was that too, but it wasn't. Click to expand... My bad, it does work. It didn't work before probably because I set the page before loading the layout and not after. Upvote 0
Stefano Di Chiano said: Yes, I tried. I thought it was that too, but it wasn't. Click to expand... My bad, it does work. It didn't work before probably because I set the page before loading the layout and not after.