Basic sample...not really. I did a lot of search on js and jquery with trial and error before I've been able to find a combination that is working with WF8 and the way IBI generates the HTML.
The greatest challenge was with the tab control where each tab don't have a unique id that can be easily referred as in WF7.
So basically I would say that
- step 1 is to hide the specific control to a tab in the onInitialUpdate() function using :
function onInitialUpdate() {
repTabStatus = 'Hidden';
showDLStatus = 'Displayed';
IbComposer_showHtmlElement('lrep',0);
IbComposer_showHtmlElement('rep',0);
hideTabRep();
}
- step 2 define a function for tabOnclick() where you will need to test the tab's name. I also had to defined internal variables to determine if my specific control are displayed and if I have the specific tab selected :
function MyTabCtrl_onclick(event) {
$(document).ready(function(){
var eventObject = event ? event : window.event;
selTab = eventObject.target ? eventObject.target : eventObject.srcElement;
if ((selTab.innerText == '!IBI.AMP.#SALESMANTRACK;') || (repTabStatus == 'OnTop' && showDLStatus == 'Displayed') )
hideDL ();
else
{
if (repTabStatus == 'OnTop')
repTabStatus = 'Displayed';
showDL ();
}
});
}
- step 3 you have to play around with your own conditions to show/display controls and tab. Here few function sample.
function QtrMthSel_onclick(event) {
var eventObject = event ? event : window.event;
var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;
// When select by quarter hide DailyEvolution tab
if (QtrMthSel1.checked == true)
{
hideTabDaily();
IbComposer_showHtmlElement("QTR",1);
IbComposer_showHtmlElement("period",0);
}
else
{
showTabDaily();
IbComposer_showHtmlElement("QTR", 0);
IbComposer_showHtmlElement("period",1);
}
}
function customer_onchange(event) {
var eventObject = event ? event : window.event;
var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;
var curCust = IbComposer_getCurrentSelection('customer');
if ((curCust != 'FOC_NOSELECTION' && curCust != '_FOC_NULL' && curCust != 'FOC_NONE') || curCust == 'NODATA')
hideTabRep ();
else
showTabRep ();
}
function showTabRep () {
$(document).ready(function(){
repTabStatus = "Displayed";
$("#MyTabCtrl").children(":first").next().next().show();
});
}
function hideTabRep () {
$(document).ready(function(){
repTabStatus = "Hidden";
$("#MyTabCtrl").children(":first").next().next().hide();
IbComposer_showHtmlElement("QMSales", 0);
IbComposer_selectTab("MyTabCtrl", 1);
showDL();
});
}
function hideTabDaily () {
$(document).ready(function(){
$("#MyTabCtrl").children(":first").next().hide();
IbComposer_showHtmlElement("DailyGraph", 0);
IbComposer_selectTab("MyTabCtrl", 1);
showDL ();
});
}
function showTabDaily () {
$(document).ready(function(){
$("#MyTabCtrl").children(":first").next().show();
IbComposer_showHtmlElement("DailyGraph", 1);
IbComposer_selectTab("MyTabCtrl", 1);
showDL ();
});
}
function hideDL () {
// when rep is chosen, hide the following drop down lists, labels and change position
IbComposer_selectTab("MyTabCtrl", 3);
repTabStatus = "OnTop";
showDLStatus = 'Hidden';
IbComposer_showHtmlElement('lcomp',0);
IbComposer_getComponentById("lrep").style.left='340px';
IbComposer_getComponentById("rep").style.top='20px';
}
function showDL () {
// when rep is not chosen, show the following drop down lists, labels and change position
showDLStatus = 'Displayed';
IbComposer_showHtmlElement('lrep',1);
IbComposer_showHtmlElement('rep',1);
IbComposer_getComponentById("lrep").style.left='700px';
IbComposer_getComponentById("rep").style.top='70px';
- step 4, a lot of tests...
Hope that this may help.
It's not the only solution. But in my case, it was the one that works.
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