Focal Point
Maintain hangs

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3701018331

November 05, 2004, 10:17 AM
Håkan
Maintain hangs
I've got a weird behaviour from a Maintain app. The form is designed to run in a 800 x 600 res, but with that size I want to set the Top and Left property of the form to 0. When the Form opens I set the focus to an editbox which triggers a JavaScript which checks the screen.availWidth. If it's < 1024 I call a Focus case with the IWCTrigger. This works fine in most programs, but when I try with a new very simple table with one key and one alpha field I get an hourglass and it just hangs. WF Dev Studio 4.3.6 SP6, W2K SP4. Any idea, anyone? Below is the Master file:

FILE=Texttab, SUFFIX=FOC, FDFC=20
SEGNAME=TEXTROOT, SEGTYPE=S1, $
FIELD=TYPE_NO, ALIAS=TYPE_NO, FORMAT=A6, INDEX=I, $
FIELD=RTEXT, ALIAS=RT, FORMAT=A60, $

Tia,

H�kan
November 05, 2004, 12:54 PM
TexasStingray
Don't Know why that does not work, But another option might be to use the javascript command open where you can specify the width, height, scrollbars, statusbar, location, etc.... this may give you more flexability.

Good Luck
November 05, 2004, 01:29 PM
Håkan
Forgot to mention, but it works if using an HTML Table, but not with a grid. Btw, how do you call a JavaScript from Maintain code. As far as I know, that's not possible. Or have I missed something?
November 10, 2004, 12:12 PM
Maintain Wizard
We have a REALLY cool way to attach a JavaScript file to a form. Every time the form opens, the JavaScript automatically gets kicked off. I think this is exactly what you need for your procedure. Create an external JavaScript file and name it anything you want. It should contain the following code:

(Please note, I renamed onload to onloadX in 3 instances on the first 2 lines of the code in order to make the post. Rename onloadX to onload in all 3 instances!!)

var OriginalOnloadX = document.body.onloadX;
document.body.onloadX = LoadFunct;
//assign your custom onload

function LoadFunct() {
if (OriginalOnload) OriginalOnload ;
//first run the OriginalOnload
// Custom onload code can now follow

}

Add the JavaScript commands that you need before the closing paren. Once the file has been created, include it in the project. In order to assign the file to the form, have both the form AND the Desktop displayed. Drag the JavaScript file from the desktop to the form. You will be asked if you wish this to be assigned.

That's it! It works like a charm. This technique is included in the February 2004 WebFOCUS Newsletter.
November 10, 2004, 12:22 PM
Maintain Wizard
Whoops
I see that you are still in V4. Ok. You can use the same JavaScript code, but the assignment is different. Create the JavaScript code inside the painter under the Scripts folder. Now, drag the JavaScript up to the Form name. That assigns the script to the form and should work for you.

Mark
September 05, 2007, 01:33 PM
Dave Ayers
quote:
We have a REALLY cool way to attach a JavaScript file to a form.


Sorry, but I just had to respond to that statement !

It may be cool to some, but to me it is just
another example of Dev Studios obtuse and inconsistent user interface.

Some things only from the menu, somethings from property sheets, or nested dialogs, some by right click only, some things by drag and drop only !

It's just not good interface design.

This message has been edited. Last edited by: Dave Ayers,


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server