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     [SOLVED]choosing a fex to run during an onsubmit

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]choosing a fex to run during an onsubmit
 Login/Join
 
Guru
posted
I am trying to make an onsubmit for a form, fire off a certain button click depending on what color is on a button. I get a "WebFOCUS was called with an invalid request." when I use the code below. I believe my problem has to do with the "ctrl". Another concept was me trying to control the action of the form. Any ideas would be greatly appreciated.

ONSUBMIT CODE:
form_submit(this);return_false;


JAVASCRPT FUNCTIONS:
//Begin function form_submit
function form_submit(ctrl) {
//button_variables();
var form11 = document.getElementById('form11');
var b1 = document.getElementById('button1');
var b2 = document.getElementById('button2');

//if (form11 !== null & b1.style.color == "blue") {
// document.write("button21")
//}
if (b1 !== null & b1.style.color == "blue") {
// document.write("button1")
button1_onclick(ctrl);
}
if (b2 !== null & b2.style.color == "blue") {
document.write("button2")
}

// document.write("help2")
}
//End function form_submit

//Begin function button1_onclick
function button1_onclick(ctrl) {
// TODO: Add your event handler code here
OnExecute(ctrl)
//button_color_reset();

var mf = document.getElementById('MainFrame');
var b1 = document.getElementById('button1');

if (mf !== null) {
mf.style.left = "5px";
mf.style.width = "1085px";
}

if (b1 !== null) {
b1.style.color = "blue";
}
}
//End function button1_onclick

//Begin function button2_onclick
function button2_onclick(ctrl) {
// TODO: Add your event handler code here
OnExecute(ctrl)
button_color_reset();

var mf = document.getElementById('MainFrame');
var b2 = document.getElementById('button2');

if (mf !== null) {
mf.style.left = "5px";
mf.style.width = "1085px";
}

if (b2 !== null) {
b2.style.color = "blue";
}
}
//End function button2_onclick

This message has been edited. Last edited by: Jay Potter,


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
 
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011Report This Post
Virtuoso
posted Hide Post
quote:
if (b1 !== null & b1.style.color == "blue") {


Ehrm... that's a bitwise OR, not a logic OR. You probably want to put && there instead of &.

I'm not sure why you get the error you mention, but I think that might be because you're passing the ctrl for the form on to the button's event handler instead of the ctrl for button1. Depending on the internals of OnExecute() that might be what's causing your problem. That function is probably somewhere in ibirlsn.js (with n the version number that WF8 uses - we're at WF7.7 and here it's 3).

I'm also a bit suspicious of those document.write() lines; basically you're appending code to the end of the current HTML document. Do you still get the error if you comment those out?

Oh, and I just notice you wrote return_false instead of return false.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Guru
posted Hide Post
I will not be using the document writes when I go live. They are there now to show me that the logic works. Do you know what value ctrl should be? The code works when I use the document write, but when I replace it with the on click, it chokes.


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
 
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Jay Potter:
I will not be using the document writes when I go live. They are there now to show me that the logic works.


I get that, but I was wondering whether they might be the cause of why the logic doesn't work.

I don't know about the ctrl values, you'll have to look into the ibirls logic. I would have to do the same to answer that.

Or you could open a case with IBI. They should be able to provide a useful solution eventually, once you reach the people who might actually know this stuff.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Guru
posted Hide Post
I figured it out. I replaced the onsubmit function in the onsubmit event event with my own function. The ctrl is "left".


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
 
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011Report 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     [SOLVED]choosing a fex to run during an onsubmit

Copyright © 1996-2020 Information Builders