How can I change the title of popup window

How can I change the title of popup window

  

I open a popup window with title as "Order Line".

I want to change the title of of popup with out closing it so that my pop remains popup open and I move to other screen on the same popup. I tried to get the Title span by class or id change the innner html /text. 

I could not make it work as it is not finding the element (span).  

When try using os JS but in that case also it does not work. 

Has anybody done this before. 



You can change popup title in a parameters in bottom right corner:

Jakub Góralski wrote:

You can change popup title in a parameters in bottom right corner:

Thanks for your reply but that does not help. I want to changed it once it is already open. 


Try using code injection with javascript: 


document.title = "This is the new  page title.";

I want to change the title of this popup window. Order Line needs to be changed  to new title . 

Both the suggested approach does not work. 


Shailendra Bais,

Let me see if understand it correctly, you want to navigate to another screen inside your popup "Order Line", right?


Have you tried to change it on developer tools in your browser and then replicate it on javascript code?


Abílio Matos

I tried that but even document.getEleementbyid('id') does not work , even when id is there for the title

Hi Shailendra,

The title of a pop-up is not meant to be changed. A pop-up should be used for simple data entry, and is typically used to edit the data of a single row from a table, or create a new item of some sorts. Therefore, the title will typically be something like "Create new item" or "Edit item xxx" or the like, and there is no need to change it.

Can you explain why you need to change the title?

I have two popups and both can open individually by clicking two different links in the list of order line but one can traverse from one popup to other . 

I can close the first one and open the other but I do not want to do that  as I want to to keep the user on the same popup as other will also be open as popup.

Please suggest as if know the solution 

You can change Popup Title to none, or something in the generally meaning, like 'configuration' or just 'order'.

Then, in a Popup Content you can take an Expression as a header and change value there in case you need.

I know, it's not a solution but some idea.

Btw. When Outsystems doing a lot of thing instead of you, then you have less posibilities to make your application special. :)

Jakub Góralski wrote:

You can change Popup Title to none, or something in the generally meaning, like 'configuration' or just 'order'.

Then, in a Popup Content you can take an Expression as a header and change value there in case you need.

I know, it's not a solution but some idea.

Btw. When Outsystems doing a lot of thing instead of you, then you have less posibilities to make your application special. :)

It does not work this way. There is nothing you can refresh in outsystems, I mean when you change the expression .


In Screen Action you can use Ajax Refresh which would reference with Id of Container of Expression.

Header widget is not available for refresh. You can only refresh what is shown in yellow but header is beyond it.


Ok, but I suggested to leave Popup Title, and make new header with title as a Expression in Popup Content which can be refreshed. 

Hi Shailendra,

For a good user experience, you should never display different content in a pop-up, that's just not what pop-ups are meant for. Closing one, then opening the other may make for better user experience, as the user is better aware they're getting different content. Anyway, what you want, changing the pop-up title, is just not easily possible.

we want to change the title in title panel. Other expression in screen contents has no meaning . that is not requirement 

Hi Shailendra,

Just go back to whoever made the requirements, and tell them chaging the pop-up title is not possible with OutSystems.

I am looking for answer but failing in not doing so just an option which we already know but wanted to check if expert in the area can help . 

Solution

Hello Shailendra.

First, I'll say that I agree with Kilian. I would say that close the popup and open the new one is the way to go.
Better user experience. Don't overlook this.

But it is possible to do what you want. See my OML.
You need to find the element in the main page, as it is not inside the popup.

A notify in the preparation of the second Popup do the trick.

https://eduardojauch.outsystemscloud.com/PopUpTitleTest/Home.aspx?_ts=636619716018461155

Cheers.

Solution

Cool stuff Eduardo! :)

Kilian Hekhuis wrote:

Cool stuff Eduardo! :)

Thanks Kilian. Hate Popups, but love to mess around with them... rs


Hello :) 

You can change the title without closing and reopening the popup.

Selecting by class doesn't work because the element is in the parent window, so you can just select it from there in your javascript:  

SyntaxEditor Code Snippet

"window.parent.$('.os-internal-ui-dialog').find('span').text('"+ EncodeJavaScript(YourNewPopupTitle) + "');"