Open window with input parameter

Open window with input parameter

  
Hello,

I would like to open a new browser window with a button, to display the contents of a record.

Specifically, I have a web screen which presents the options to upload, download and view documents (pdf).
All works well, however, when viewing a document, I would really like a new window to open rather than having to navigate away from it.
Although I can get the window to open, the screen remains blank as I am unsure how to pass the Document_Id through the extended properties.

Essentially, require the same behaviour that would be achieved through right clicking on a view link, and selecting open in new window, but with a button!


Thank you,
Mark 
Hello Mark,

To open a new window with a button you may add the onclick extended property in the button with the following javascript instruction:
"window.open ('yourURL');"

Adicionally you can configure that opening window with a lot of properties. You might want to check this: http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

does it help you?


José Queirós

Erm

- create a button
-set method to navigate
- add extended property "target" "_new"
- the destination is ofcourse the page you want
- page itself has got the input parameter for the specific id

does that not work?

question, what version you have of service studio?

Hi Joost,

At least in plain HTML the TARGET property does not apply to buttons. Links it's ok, but no buttons.
Another way to go arround could be a Widget_Click action from the RichWidgets library. Inside of the screen action, from the button, you could click an CSS-hidden link that has those properties you mentioned.

regards,

José Queirós

Thank you José and Joost,

Service studio is version 6.0.0.6 


José,

The problem in passing myURL to Open.Window() is that I only know part of the URL.

e.g. the full URL is View.aspx?Documents_id=1, however, the part “?Documents_id=1” depends upon which document view button is pressed. If n records, then the nth address is “?Documents_id=n”

 If I pass View.aspx to Open.Window(), I do indeed get a new window, but the screen preparation has no document_id to work on as this has not been passed to the new window. (Works fine if not a new window).

 I did look at the other properties that can be passed with Open.Window(), but they all relate to the window itself, size etc.

 

Joost,

Yes button created, method is Navigate. I have tried numerous permutations, e.g. from my documents web screen -

Method: Navigate & also tried Submit

Destination: MainFlow\View & and have also tried using the a screen action here too with the submit button.

Extended propeties: OnClick | Open.Window(URL); return false;

 

Unclear how the “target” and the “_new” would be used in the extended properties.


Regards,

Mark

The problem in passing myURL to Open.Window() is that I only know part of the URL. e.g. the full URL is View.aspx?Documents_id=1, however, the part “?Documents_id=1” depends upon which document view button is pressed. If n records, then the nth address is “?Documents_id=n” If I pass View.aspx to Open.Window(), I do indeed get a new window, but the screen preparation has no document_id to work on as this has not been passed to the new window. (Works fine if not a new window). I did look at the other properties that can be passed with Open.Window(), but they all relate to the window itself, size etc.

Ok, but that's another problem.

Now, you need to understand that the extended property value field is an expression. As an expression you may pass the documentId Value from the current row of the TableRecord or equivalent. And the expression in the onClick property should be something like this:
"http://your_server/your_espace/page_view.aspx?DocumentId=" 
+ DocumentTableRecord.List.Current.DOCUMENT.Id
Does this respond to your need?
José,

Many thanks. I had tried something like this earlier today, but my syntax was wrong!

Even after you pointed me in the right direction, it still took quite a few attempts to get it right.
The exact syntax I am using for the OnClick value is:

"window.open('View.aspx?DocumentId="+DocumentTable.List.Current.Documents.Id+"');"

Some notes for others doing this:
1. Single inverted commas are required around URL, marked in red for clarity. An internal error in the browser appears otherwise.
2. Full path not required

Thank you for your direction and help José.

One other question please, is this the correct forum to ask such questions?
I see most others posting their questions in the "Technology and Integration" forum.

Kind Regards,
Mark
You're welcome. Always glad to be helpful. :)

Hum that I don't know. :)
I assume that, by it's name, the "Technology and Integration" forum it's the most appropriate.

Best regards,

José Queirós
@José  quite right. brain failed on me ;)
Topic moved - thanks for the heads up, and great job answering this, guys! :)

Regards,

Paulo Tavares