Pop up window

Hi all,

I'm currently trying to use pop-up windows to go through records and then pick one to choose.

What i want to achieve is something like: I have a text field that receives a user id. Pressing Search button it opens a pop-up window listing all my users (id, name), then i click a user id and the pop-up closes and my text field is automatically filled with the selected id.

Has anyone ever done something like this? Or has any idea how to do this?

Best Regards,
Hi Rui,

What you are trying to do is a common user interface pattern. You have two different issues:
1 - Open a User selection popup window by pressing a [SearchUser] button in the MainScreen;
2 - Update the MainScreen UserInputId value and close the popup window when you press the [SelectUser] buton or link in the PopupWindow.

To solve the first one, you can try to search for "popup" in the community and you'll have some results. Basically, the solution is the following:

a) Create a Web Screen to list and select users (popup_UserSelection). This will have a user listing of your users with a [SelectUser] button or link for each user.

b) Create an Entry Point to that popup screen (SelectUserEntry).

c) In your MainScreen [SearchUser] button, set the onclick property to the javascript code that will open the UserSelectionEntry in a browser popup window. That will be something like:

"window.open('SelectUserEntry.aspx?[parameters....]', ""User Search"", ""height=600,width=500,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes""); return false;"

To solve the second problem, you have to set the onclick property of your [SelectUser] button or link in the popup_UserSelection screen to the javascript code that sets the UserId input value in your MainScreen with the selected user Id and then closes the popup window. For that you have to:

a) Fill in the "name" property of your UserInputId input in the MainScreen (so that you can reference it and set its value in the popup window).

b) Create a parameter in your popup_UserSelection Web Screen for the UserInputId of the main window.

c) In the window.open() javascript action of the [SearchUser] button in the MainScreen, pass the UserInputId runtime id value to the popup in the invocation URL ("SelectUserEntry.aspx?UserInputId=" + UserInputId.Id + "[parameters....]...).

d) In your popup window [SelectUser] button, set the onlick javascript code that updates the value of the UserInputId in the main window and closes the popup. To set the input value, you can use the window.opener javascript object. To close the popup, use the window.close() action.

To set the input value of the opener window you could write the following javascript action (and place it in the eSpace javascript):

function SetOpenerWindowInputValue(InputId,InputValue){
window.opener.document.getElementById(InputId).value = InputValue;

You would then set the onclick property of the [SelectUser] button to something like:

"SetOpenerWindowInputValue('" + UsernameInputId + "','" + TableUsers.List.Current.User.Username + "'); window.close();
return false;"

Attached I placed a sample eSpace that implements this pattern. You'll have to install Service Studio 4.1 to open it.

Best Regards,


I tried the sample in IE and it doesn't work.

I tried in the mozzila, and it worked.

What can be the problem?

Thank you
Hi. This might be caused by having a space character in the window name parameter ("User Search") in the window.open(...) method.

Hi, I have tried accessing this file through a 5.1 Service Studio version.
A log-in to the a server is required. I have tried to change the server hostname to that of our environment and inputted the required server credentials, however, I received something like this,
"The communication object, System.ServiceModel.ChannelFactory`1[ServiceStudio.ServerCommunications.SS.Java.ServiceStudio], cannot be used for communication because it is in the Faulted state."

What seems to be the problem here?
Thanks for you help.