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] Using Javascript in OPEN event of form.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Using Javascript in OPEN event of form.
 Login/Join
 
Guru
posted
HI All,
I am using webfocus maintain to display a form.I want to display it when the form is opened or shown with all the data from stack.When I use event OPEN,it only allows me to write only maintain function in it not any javascript function.I need to use javascript as I have to apply different validation logic (coloring,formatiing etc.based on data from stack).Is there any way to achieve this?Please advice.

Thanks.

This message has been edited. Last edited by: Kerry,


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Guru
posted Hide Post
Can anybody reply to this please?

Thanks.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Virtuoso
posted Hide Post
Add an external javascript file. In there have an attachevent/addeventlistener for window / load / function. It is all standard javascript, which is what you want to use rather than the Maintain code.

.
.
function addEvent(obj, evType, fn){
  if (obj.addEventListener){
    obj.addEventListener(evType, fn, true);
    return true;
  } else if (obj.attachEvent){
    var r = obj.attachEvent("on"+evType, fn);
    return r;
  } else {
    return false;
 }
}

.
.
function initPage() {
// What to do when page opens
.
.
}
.
.
addEvent(window, 'load', initPage);


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
There are a couple of ways of doing this, but it depends on your release of the product. Before 7.6 you could create an onLoad JS function and add it to the form. In 7.7 the can assign an onLoad.js directly to the property sheet of the form. In 7.6 you can cheat a little, and this is how I do it.

Create a JS file and call it anything you want. Let's say loader.js. Add in the JS code without a function name like this:

if (document.Form1.msgtext.value.length != 0)
{
var msgtext = Form1.msgtext.value;
alert(msgtext);
Form1.msgtext.value = '';
}

This code looks for a value in the field msgtext, and if it's there, alerts it. Now embed the loader.js onto the form. Since it has no name, we add it to the top of the code and perform it every time the form refreshes.

If this doesn't work you can try bracketing that code with this:

function LoadFunct() {
if (OriginalOnload) OriginalOnload ();
//put code here
}

This worked BEFORE 7.6. Again, in 7.7 you just create your function and place it in the properties sheet for the form.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report 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] Using Javascript in OPEN event of form.

Copyright © 1996-2020 Information Builders