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.
I've made several attempts but none of them works. I am trying to create a function. So when the selection of radio button change to different value, it will run different animation. However after I add the code to Embedded JavaScript/CSS tab, when I create task to call this JavaScript, nothing show up.
Here's my current code from 'Embedded JavaScript/CSS' tab. Can somebody help me where did I get it wrong?
if(typeof(bRuntime) != 'undefined') { // TODO: Add your inline runtime code here } //Begin function window_onload function window_onload() { UpdateData(); // TODO: Add your event handler code here //add onInitialUpdate() function to make changes before initial run of the reports } //End function window_onload //Begin function check_reporttype function check_reporttype(){ var report_type = IbComposer_getCurrentSelection('reportselectioncontrol'); if (report_type == 'Measurables'){ IbComposer_runAnimation('ShowMeasurables'); } else { IbComposer_runAnimation('HideMeasurables'); } } //End function check_reporttype
Thank youThis message has been edited. Last edited by: WebFocusDiver,
If you want the animation to happen when the radio button changes, go to the Properties panel, click the yellow lightning bolt, and add "check_reporttype" to the Value Changed box.
You may need to call your function when the window first loads, too.
if(typeof(bRuntime) != 'undefined') {
// TODO: Add your inline runtime code here
}
//Begin function window_onload
function window_onload() {
UpdateData();
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
//Call function after window has loaded
check_reporttype();
}
//End function window_onload
//Begin function check_reporttype
function check_reporttype(){
var report_type = IbComposer_getCurrentSelection('reportselectioncontrol');
if (report_type == 'Measurables'){
IbComposer_runAnimation('ShowMeasurables');
}
else {
IbComposer_runAnimation('HideMeasurables');
}
}
//End function check_reporttype
App Studio WebFOCUS 8.1.05M Windows, All Outputs
Posts: 594 | Location: Michigan | Registered: September 04, 2015
I added it to the properties panel. The problem now is when I try to create task say when selection changed, request/actions of JavaScript Call. Under the target type -JavaScript function, there is no function show up. I don't know much about JavaScript. What is missing?
It works now except this one issue. Here is my revised code here
if(typeof(bRuntime) != 'undefined') {
// TODO: Add your inline runtime code here
}
//Begin function window_onload
function window_onload() {
UpdateData();
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
//Call function after window has loaded
check_rpttype();
}
//End function window_onload
//Begin function check_rpttype
function check_rpttype(){
var rpt_type = IbComposer_getCurrentSelection('ReportSelectionControl');
if (rpt_type == 'Measurable'){
IbComposer_runAnimation('ShowMeasure');
IbComposer_runAnimation('ShowMeasureDate');
}
else {
IbComposer_runAnimation('ShowCashFlow');
IbComposer_runAnimation('ShowCashFlowDate');
}
}
//End function check_rpttype
It seems working with load since both 'ShowCashFlow' and 'ShowCashFlowDate' show up. But when I change the radio button selection to 'Measurable', I do expect to see "ShowMeasure" and "ShowMeasureDate" show but it didn't.
I don't know if the condition in if statement really works - I am if the variable does get the value that I selected.
The "IbComposer_getCurrentSelection" function is returning the same selection no matter which one I select during my testing. This is strange. I try not to use the IBI functions because of strange behavior like this.
I will post some code that will retrieve the selection the standard way.
When you change selection, do you still get a small window that shows nothing for the selection?
alert(rpt_type);
App Studio WebFOCUS 8.1.05M Windows, All Outputs
Posts: 594 | Location: Michigan | Registered: September 04, 2015
I had mixed results (mostly bad) with the IBI function to get the current selection of the radio control. The reason seems to be that the radio control needs time to update the selections after a new choice has been made.
I don't think this is a problem the vast majority of the time, because radio controls are typically changed before a user clicks on a button to have something run -- plenty of time to update the control before any code checks the new selection. But in this case, an animation needs to run immediately after the radio control has been changed, so we need to give the radio control a little more time.
I did not test this code fully, but I think it is correct (or at least very close to it):
if (typeof(bRuntime) != 'undefined') {
// TODO: Add your inline runtime code here
}
// Begin function window_onload
function window_onload() {
UpdateData();
// TODO: Add your event handler code here
// add onInitialUpdate() function to make changes before initial run of the reports
// Call check_reporttype function after window has loaded. This function is
// normally triggered during a Value Changed event on the radio control. It is
// called here after the window has opened so that an animation can show for
// the first time. It is assumed that "Measurables" is the default choice.
check_reporttype();
}
// Begin function check_reporttype
function check_reporttype() {
// The following timeout is necessary to give the radio control time to
// update radio selections to reflect the user's new choice. For a brief
// time, at least two selections can both be checked until this update is
// finished.
setTimeout(
function() {
selection_checked();
},
150);
// Note that the timeout now exits immediately, and gives up control of the
// Value Changed event. The selection_checked function will run 150 milliseconds
// later (A long delay for a computer if it's not running IE 9).
}
// Begin function selection_checked, which actually does the important work.
function selection_checked() {
// IBI radio controls consist of a DIV tag with the Unique Identifier of the radio control.
// Inside the DIV is an HTML table that formats the appearance of the radio selections.
// INPUT tags of type "radio" are the selections, so we find all of them inside the DIV.
var rpt_type = document.getElementById('reportselectioncontrol').getElementsByTagName('input');
// Since we have delayed checking the radio control by 150 milliseconds, it should
// be safe (Famous last words. Thank you IE 9!) to see which radio selection has been
// "checked".
for (var i = 0; i < rpt_type.length; i++) {
if (rpt_type[i].checked) {
if (rpt_type[i].value == 'Measurables') {
IbComposer_runAnimation('ShowMeasurables');
} else {
IbComposer_runAnimation('HideMeasurables');
}
}
}
}
Note: I discovered that on Internet Explorer 9, 100 milliseconds is not enough time, so I've changed it to 150 milliseconds.This message has been edited. Last edited by: Squatch,
App Studio WebFOCUS 8.1.05M Windows, All Outputs
Posts: 594 | Location: Michigan | Registered: September 04, 2015