[CLOSED]Need Help in JRunning animation and Java script
Hello, I need help in creating HTML. I one HTML, I have have loaded three Panel, say Panel, Panel2 and Panel3. Each Panel consists of a Run button with task. I also created a Drop down consisting of three display value like US Total, Branch, UnderwritingCenter. Initially I hide all panel. Now I want to click UStotal and it should show Panel1, If I click branches it should show panel2 and If I click Underwritingcenter, it should show panel3. My idea is to create 3 animation like Animationreport1,animationreport2 and animationreport3. Then I want to create function in java script and run the java script. function check_report(){ var current_report = IbComposer_getCurrentSelection('reportlist'); if(current_report == 'USTotals'){(IbComposer_runAnimation('Animation1');
} This is the code of my java script for first animation. But In am getting error.Please help. Regards, NihaThis message has been edited. Last edited by: <Emily McAllister>,
WebFOCUS 8 Windows 7 HTML
February 18, 2016, 03:07 PM
BabakNYC
What version of WebFOCUS?
WebFOCUS 8206, Unix, Windows
February 18, 2016, 04:37 PM
Waz
Whats the error ?
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
February 18, 2016, 07:20 PM
Squatch
That code does not look valid. You seem to have an extra parenthesis in there. Try:
var current_report = IbComposer_getCurrentSelection('reportlist');
if(current_report == 'USTotals') {
IbComposer_runAnimation('Animation1');
}
App Studio WebFOCUS 8.1.05M Windows, All Outputs
February 19, 2016, 09:44 AM
N/A
Hello, Thanks. By your advice I wrote the following codes. I want to Run three animation. If I click UStotal, it should show PanelUp.. If I click producing Branch and Territory, it should show Panel2UP and if I click Underwritingcenter and Branch it should show panel3Up.
var current_report = IbComposer_getCurrentSelection('reportlist'); if(current_report == 'USTotals') { IbComposer_runAnimation('panelUp'); }
var current_report = IbComposer_getCurrentSelection('reportlist'); if(current_report == 'Producing Branch and Territory') { IbComposer_runAnimation('panel2Up'); }
var current_report = IbComposer_getCurrentSelection('reportlist'); if(current_report == 'Underwriting Center and Branch') { IbComposer_runAnimation('panel3Up'); }
I am not sure if I will add a function or not. Please advice. Niha
WebFOCUS 8 Windows 7 HTML
February 19, 2016, 09:49 AM
N/A
quote:
Originally posted by BabakNYC: What version of WebFOCUS?
Hello, It is web FOCUS 8104. nIHA
WebFOCUS 8 Windows 7 HTML
February 19, 2016, 11:07 AM
Squatch
Assuming "combobox1" is your drop down identifier, you could do this:
//Begin function combobox1_ononafterload
function combobox1_ononafterload(ctrl) {
hide_panels();
var selection = document.getElementById("combobox1").value;
show_panel(selection);
}
//End function combobox1_ononafterload
//Begin function combobox1_onchange
function combobox1_onchange(event) {
hide_panels();
var selection = document.getElementById("combobox1").value;
show_panel(selection);
}
//End function combobox1_onchange
function show_panel(selection) {
switch(selection) {
case "US Total":
hide_panels();
document.getElementById("panel1").style.visibility = "visible";
IbComposer_runAnimation('Animation1');
break;
case "Branch":
hide_panels();
document.getElementById("panel2").style.visibility = "visible";
IbComposer_runAnimation('Animation2');
break;
case "UnderwritingCenter":
hide_panels();
document.getElementById("panel3").style.visibility = "visible";
IbComposer_runAnimation('Animation3');
break;
}
}
function hide_panels() {
var p1 = document.getElementById("panel1");
var p2 = document.getElementById("panel2");
var p3 = document.getElementById("panel3");
p1.style.visibility = "hidden";
p2.style.visibility = "hidden";
p3.style.visibility = "hidden";
}
App Studio WebFOCUS 8.1.05M Windows, All Outputs
February 20, 2016, 12:48 PM
Rifaz
Hope, you don't overlooked the control names. BTW, what's the error?
-Rifaz
WebFOCUS 7.7.x and 8.x
February 22, 2016, 09:34 AM
N/A
quote:
Originally posted by Squatch: Assuming "combobox1" is your drop down identifier, you could do this:
//Begin function combobox1_ononafterload
function combobox1_ononafterload(ctrl) {
hide_panels();
var selection = document.getElementById("combobox1").value;
show_panel(selection);
}
//End function combobox1_ononafterload
//Begin function combobox1_onchange
function combobox1_onchange(event) {
hide_panels();
var selection = document.getElementById("combobox1").value;
show_panel(selection);
}
//End function combobox1_onchange
function show_panel(selection) {
switch(selection) {
case "US Total":
hide_panels();
document.getElementById("panel1").style.visibility = "visible";
IbComposer_runAnimation('Animation1');
break;
case "Branch":
hide_panels();
document.getElementById("panel2").style.visibility = "visible";
IbComposer_runAnimation('Animation2');
break;
case "UnderwritingCenter":
hide_panels();
document.getElementById("panel3").style.visibility = "visible";
IbComposer_runAnimation('Animation3');
break;
}
}
function hide_panels() {
var p1 = document.getElementById("panel1");
var p2 = document.getElementById("panel2");
var p3 = document.getElementById("panel3");
p1.style.visibility = "hidden";
p2.style.visibility = "hidden";
p3.style.visibility = "hidden";
}
WebFOCUS 8 Windows 7 HTML
February 22, 2016, 09:34 AM
N/A
Thanks . will work on it and let you know. Regards, Niha