102
Views
7
Comments
How to set screen title in the screen that use for preview file
Application Type
Traditional Web

Hello Everyone  :D  

I am now using OS 11 and Traditional web.
I want to preview PDF file in my browser. 
So here is my approach: 

- In the preparation:  I get the file content (Binary data) by Document_Download Action. FileName is an input parameter.   


Download set upPreparation




- In the Screen UI : I use an image to present the file. 


And it works as expected. 

But here is the problem:   I can't change the screen title, and by default it is set to "Preview.aspx".
Either I try RunJavaScript or  SetPageTitle Action, it doesn't work. :( 


Screen Seting

My goal is to set FileName parameter as screen title. 

How can I achieve it?

Thanks, 

Nam 






2019-05-16 13-55-52
João Henriques

Hi Nam,


I think you can create a local text variable and set it to the page title.

After loading the file, you set the variable with the Filename.

But the method cannot be Ajax Refresh you must use submit instead to re-load the html.


Here's an example using both the variable solution and SetPageTitle Action.

Thank you.

PageTitle.oml
2023-02-20 05-20-57
Nam Nguyen

Hi João,


Thank you for your answer.

In order to do it, I have to trigger an action after the download component (means the preparation is completed because that is when the file was loaded). 

Since download component is the end node, I don't think it's possible to reference an action after it. 

Nam

2023-10-21 19-42-11
Tousif Khan
Champion

Hello,
Can you debug your code and check whether you are getting the file name in your variable that you have assigned to the Download widget,? If you are not getting any value I thing it must be blank in that case. please check once.
Thanks

2023-02-20 05-20-57
Nam Nguyen

Hi Tousif Khan, 

That is not the problem. FileName has value (you can check it via the url in which the image i had sent) " test file name .docx". 
 
As you can see, in my post,  I had setted "test" as screen title (not FileName). But the result is the same.

Thanks,

Nam

2025-01-15 08-35-04
Vignesh Sekar

Hi Nam ,

can you share the OML that could help to view the code

2025-01-15 08-35-04
Vignesh Sekar

HI Nam,

When the screen load first preparation then only screen will load , when you end the preparation with download the default value will not set. so use the preparation for set the default value (Binary).

then use the action for execute some action (Download)

now the new changes will reflect

Hope it will help






UserImage.jpg
Anh Cong Nguyen

Hi Nam, 

Do you have the answer to this question?

I am also facing a similar case

Hope to hear from you soon. 

Thanks in advance.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.