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.
Hi, Here a question for a newbie user of AppStudio : how can I prevent the execution of my report when the onClick() event is triggered and validation failed ?
Let's explain.
I have an HTML page that provide a bunch of controls to assign filters/parameters for a report, when I press the "Run" button, I want to apply some validations. Up to there all works fine since I can have alerts telling me which field is invalid.
I'm applying js validation on field and all goes well and perform validation as it should be but the report is still launch even if one of the fields is invalid.
Here a sample of the onClick() event for the Run button that I want to implement:
function buttonRun_onclick(event) {
var eventObject = event ? event : window.event;
var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;
if (IsNumeric(GPMIN.value) == false)
{
alert("This is not a valid number");
GPMIN.focus();
return false;
}
}
Within WF7 having a "return false;" in the onClick() event prevent the report to be launch. How can I achieve the same result in WF8 using AppStudio ? Can't find the option to prevent execution.
And even an IBI consultant that I have here don't know how...
Thanks to helpThis message has been edited. Last edited by: MartinY,
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
I create a separate function that performs the validations and returns true or false.
//Begin function validateParams
function validateParams(ctrl)
{
if (blah... blah...)
{
alert('blech... blech...');
return false;
}
else
{
return true;
}
}
//End function validateParams
In the onclick function, I do the following:
//Begin function btnRun_onclick
function btnRun_onclick(ctrl)
{
// TODO: Add your event handler code here
if (validateParams(this))
{
// run report
OnExecute(ctrl);
}
}
//End function btnRun_onclick
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server