Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Maintain : how to open an extra window?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Maintain : how to open an extra window?
 Login/Join
 
Platinum Member
posted
Hi,


I'm developing a form on which i have a search button, when you push the button i want a new form to appear in which you can select items

is there any way to open an new (extra) window to do this , so that it opens on top of the first window?

Any ideas?

Peter

This message has been edited. Last edited by: Kerry,
 
Posts: 206 | Registered: February 25, 2005Report This Post
Master
posted Hide Post
Pete
There are a couple of ways to do this. The first is just to create a selection form. When the user press search, do a WINFORM SHOW form and bring up a selection form. When the user makes a selection you can return to the calling form by issuing a WINFORM CLOSE form.

If you don't want a form to cover the entire screen, you can use an HTMLTable. You can create the object, and make it invisible. When the user presses SEARCH, make the object visible and place the cursor on it. When the user makes a selection, store the selection and make the object invisible.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Platinum Member
posted Hide Post
Hi Mark,


I think the 2nd solution is something i can use.


Just to make sure : the HTMLtable is on the same form right ? just one window , one form


Sounds like you saved the day again , mark

thanks !!

Peter
 
Posts: 206 | Registered: February 25, 2005Report This Post
Master
posted Hide Post
That's correct. The HTMLTable is on the same form. But you can make it visible / invisible so it only displays when you want it.

Happy to help.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Virtuoso
posted Hide Post
I'm interested in the original question -- is there a way to "pop up" a maintain form over top of the original? This would suit my needs perfectly.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Master
posted Hide Post
John
A Maintain application can have an many forms as you want. From a displayed form, you can issue:
WINFORM SHOW FORM2
Where Form2 is the name of the second form. That displays form2 and makes it a child of form1. Form1 is still open, but "covered" by form2. When you close form2, WINFORM CLOSE FORM2 or self.WinClose(), control is passed back to Form1. Any data entered into or collected from form2 can be passed back with variable or stack.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Virtuoso
posted Hide Post
When I issue that Winform Show it replaces the original instead of popping up.

I realize this looks like a minor quibble, but my goal is to pop up a very small window, have the user enter a date (with the dynCalendar widget) and then submit, returning the value to an html table on the original form. The original form is 1024x768 so the appearance of one field (on the second form) on such a big footprint is a bit jarring.

I can generate a web page in JavaScript (or create a static one and call it) but I was hoping to use that widget so that this date would work the same as the rest in the system. For the moment I am squeezing the field onto the current form and having it appear, but this particular form is quite tight. Likely I will have to hide other material and replace. It works, but isn't exactly comforting to the user.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Gold member
posted Hide Post
I, too, am interested in a good method to open a new popup window where a user could enter some data then click a Save button or a Cancel button, the popup will disappear, and the app will do something with the data entered in the edit box.

At the moment, I've created an HTML page in HTML Layout Painter with an edit box and 2 buttons, Save and Cancel. I've also created a fex with just -HTMLFORM htmlfile to call the HTML file. In my Maintain app I have a button on a form that, when clicked, calls IWCLink to execute the fex that calls the HTML page. I specify the window options in the IWCLink call so I do get the size and position that I want for my popup window.

In the HTML file I created, I named the edit box and buttons. I added a hyperlink to the Cancel button of:
javascript:self.close()
and this does close my popup. So clicking Cancel does close the popup window.

I'm at the point now where I just need to figure out how to get the data entered in the edit box on the popup into a Maintain variable when the user clicks the Save button. I probably need to write an external JS function or two to accomplish this.

The reason I'm doing this is that this form is very tight on space and only 1 specific user will be using this popup window to enter additional data. I know I could just have the app go to a different form and then close that and go back to the original form but I think the popup window would be a little quicker for the user and look nicer too.

I also had thought about creating the popup using only JavaScript. I looked at the createPopup() function. If I populate the innerHTML with a form that has the edit box and 2 buttons, I guess I'm still not sure how I would get the edit box contents back to a Maintain app. Possibly save it to a hidden control on my Maintain form in that same JS event handler and then grab it from the hidden control in Maintain (?). I don't really care if I use an actual separate popup window or use the createPopup() JS function. Either would be preferrable to using an additional form.

I think a popup window widget in the Form Editor would be a great addition to Maintain.

Thanks,
James


FOCUS 7.7.03
WebFOCUS 8.0.x/8.1
z/OS, Windows
 
Posts: 54 | Location: Everett, WA | Registered: September 27, 2005Report This Post
Gold member
posted Hide Post
Thought I'd post an update since I was able to solve my problem just today.

First, I found out that createPopup() is an IE only JS function so I decided to forget about that. Our shop is standardized on IE *groan* but I prefer code that's as cross browser compatible as possible myself.

I went with window.open() instead of using IWCLink to open a popup window. I created my HTML file from scratch instead of using HTML Painter and rolled my own JavaScript functions in that HTML file. I used window.opener to get a reference to the form in my main browser window and I was able to get/put data entered in the popup window from/into a hidden editbox control. Once I figured out the correct JS syntax in my functions, it was working. Cool


FOCUS 7.7.03
WebFOCUS 8.0.x/8.1
z/OS, Windows
 
Posts: 54 | Location: Everett, WA | Registered: September 27, 2005Report This Post
Virtuoso
posted Hide Post
I guess at this point my question boils down to this -- Is there a way for a Maintain screen to pop up another Maintain screen?

It appears from my research that once the popped-up Maintain screen is closed the session is lost. That is, you can indeed pop up the screen, but you've effectively ended your session by doing so -- you can't return to the prior screen ever. Here's what I've tried:

1. Look for a CALL command in Maintain the opens into a new window. Did not find one.
2. Create a JavaScript call to open a new window and call a Maintain form into it. This steals the session from the calling screen -- the new screen has the session now and there's no going back to the original. Closing that pop-up appears to take the session with it, regardless of how I close.
2a. Winform close in a Maintain trigger ends the session.
2b. window.close() in a JS trigger ends the session.

Since I have a need to write data from a grid in this second screen the Maintain part of the equation is pretty important. Jsp or Ajax would be pretty ugly in the pop-up.

It simply appears that Maintain cannot call a Maintain in a pop-up without ending the session prior to return. You have to stay in the same window. Anyone have a solution for this?

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Master
posted Hide Post
John
A Maintain application can have as many forms as you want. However, if you are developing a persistant application only one form can be displayed at a time. When a parent form displays a child form you can certainly return to the parent form.

If you have: WINFORM SHOW FORM1, you can, from any case or event issue: WINFORM SHOW FORM2
From FORM2, if you issue WINFORM CLOSE FORM2 or self.WinClose(); the second form closes and you return to FORM1. Any variables or stacks populated on FORM2 are available in FORM1 as well.

The second way to do this is with the CALL command. This states that the current Maintain procedure is going to kick off another Maintain procedure and pass data between them.

In the first Maintain you could have WINFORM SHOW FORM1. Then, from any event on this form (inside a CASE) you can have CALL MAINTAIN2 From Vars / Stacks into Vars / Stacks. Then in the CALL'd Maintain you can have WINFORM SHOW any forms you want. When you want to leave THIS Maintain, just issue a GOTO END and you will be returned to the parent Maintain. Unless you closed the first form, it will STILL be displayed when you return.

I hope this helps.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Virtuoso
posted Hide Post
I'm talking two separate windows on the operating system -- a parent window that has a pop-up appear over top of it. Is that possible? Your first paragraph seems to be a pretty solid "no" but then you go into some detail after that.

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Master
posted Hide Post
John
If you are talking about two explorer browers, both containing Maintain applications, then no. You can't do that.

You can either have multiple Maintain Winforms (one displayed at a time) and pass data between them OR use a Weblink to kick off a non-Maintain procedure like a Table or a URL.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Virtuoso
posted Hide Post
You can only have one (1) browser instance that runs a maintain. But if you want to launch another browser instance from within the maintain to display the results of another type of operation (for instance a report or a graph or something else) then yes, you can open a new window by using javascript commands. The only caveat with this is that I have not been able to actually give this instance focus. The window with the maintain in it always seems to take precedence, no matter what I did. So I did succeed in opening a new window, and also populating it with what was needed, but it always stayed in the background....
So I gave up trying to get it in front and followed the 'visible/invisible' technique discussed earlier in this post. I now display the result of what should have been in the new window in a html object in a bit of empty space on the maintain form.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
Mark and GamP are right, this is due to the Maintain session cookie.

With the same session you can have as many windows or Iframes or Frames running the same maintain session you want, depending on resources, but this only works for non-persistent calls.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Maintain : how to open an extra window?

Copyright © 1996-2020 Information Builders