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     regarding UpdadeData() in html layout painter,please help

Read-Only Read-Only Topic
Go
Search
Notify
Tools
regarding UpdadeData() in html layout painter,please help
 Login/Join
 
Member
posted
hi,

this is the code i am using in html layout painter.In the window_onload funcction( method UpdateData()Winkis given by the webfocus itself which is used to populate the dropdown boxes from data source.After the statement i am calling the windowOnload() function to default my dropdowns.I have placed alert() statement in between the UpdateData() and windowOnload() methods.If i am removing that alert statement i am getting the error.I think some delay should happen between UpdateData() function and windowOnload() function. For that delay if i am using for loop even then it is giving the errror.only if i use alert() stmt it's not giving the error. Please help me in this regard.



<script type=text/javascript>

var g_orglevel = !IBI.AMP.P_ORGLEVEL; ;
var g_orgnumber = !IBI.AMP.P_ORGNUMBER; ;

var g_dist = 0;
if(g_orglevel == 4)
{

g_dist = !IBI.AMP.P_DIST; ;
}
var g_expctrid=' ';
var g_expctrgrp=' ';
var g_period=' ';
var g_fiscalyear=' ';
var g_dropdnname=' ';
var g_dropdnvalue=' ';

function window_onload() {
UpdateData();
alert();
windowOnload();
}

/* This function generates the report in the iframes of the page based on the parameters
* from the sccr_user_access.fex file and disable the dropdowns required based on the
* parameters
*/
function windowOnload(){


/*Making the ExpenseCenter drop down defaulted to Total Store*/
for(var i = 0; i < document.getElementById["cboExpCtr").length; i++){
if((document.getElementById("cboExpCtr").options[i].value) == "Total Store"){

document.getElementById("cboExpCtr").options[i].selected = true;
g_expctrgrp = document.getElementById("cboExpCtr").options[i].value ;
break;
}

}
g_period = getMonthId(document.getElementById("cbomonth").value);
g_fiscalyear = getFiscalYear(document.getElementById("cbomonth").value);

if(g_orglevel == 0){

g_dropdnvalue = g_orgnumber;
g_dropdnname = 'C';
var cmd = "WFServlet?IBIF_ex=sccr_landingpage_rpt&P_DEPT_ID="+g_orgnumber+"&P_DEPTNAME="+g_dropdnname+"&P_EXPCTR="+g_expctrid+"&P_EXPCTR_NAME="+g_expctrgrp+"&P_ORGLEVEL="+g_orglevel+"&P_ACCT_GRP_FOC="+P_ACCT_GRP_FOC+"&P_MONTH="+g_period+"&P_YEAR="+g_fiscalyear;
document.getElementById("reportFrame").src = cmd;
}

else if(g_orglevel == 1){

//Defaulting the dropdown values to the parameter g_orgnumber
for(var i = 0; i < document.getElementById["cboRegion").length; i++){

if(document.getElementById("cboRegion").options[i].value == g_orgnumber){

document.getElementById("cboRegion").options[i].selected = true;
break;
}
}

g_dropdnvalue = g_orgnumber;
g_dropdnname = 'R';
var cmd = "WFServlet?IBIF_ex=sccr_landingpage_rpt&P_DEPT_ID="+g_orgnumber+"&P_DEPTNAME="+g_dropdnname+"&P_EXPCTR="+g_expctrid+"&P_EXPCTR_NAME="+g_expctrgrp+"&P_ORGLEVEL="+g_orglevel+"&P_MONTH="+g_period+"&P_YEAR="+g_fiscalyear;
document.getElementById("reportFrame").src=cmd;
}
else if(g_orglevel == 2){


// Defaulting the dropdown values to the parameter g_orgnumber
for(var i = 0; i < document.getElementById["cboSpoke").length; i++){

if(document.getElementById("cboSpoke").options[i].value == g_orgnumber){

document.getElementById("cboSpoke").options[i].selected=true;
break;
}
}
g_dropdnvalue = g_orgnumber;
g_dropdnname = 'G';
var cmd = "WFServlet?IBIF_ex=sccr_landingpage_rpt&P_DEPT_ID="+g_orgnumber+"&P_DEPTNAME="+g_dropdnname+"&P_EXPCTR="+g_expctrid+"&P_EXPCTR_NAME="+g_expctrgrp+"&P_ORGLEVEL="+g_orglevel+"&P_MONTH="+g_period+"&P_YEAR="+g_fiscalyear;
document.getElementById("reportFrame").src = cmd;
}
else if(g_orglevel == 3){

// Defaulting the dropdown values to the parameter g_orgnumber
for(var i = 0; i < document.getElementById["cboDistrict").length; i++){

if(document.getElementById("cboDistrict").options[i].value == g_orgnumber){
document.getElementById("cboDistrict").options[i].selected=true;
break;
}
}
g_dropdnvalue = g_orgnumber;
g_dropdnname = 'D';
var cmd = "WFServlet?IBIF_ex=sccr_landingpage_rpt&P_DEPT_ID="+g_orgnumber+"&P_DEPTNAME="+g_dropdnname+"&P_EXPCTR="+g_expctrid+"&P_EXPCTR_NAME="+g_expctrgrp+"&P_ORGLEVEL="+g_orglevel+"&P_MONTH="+g_period+"&P_YEAR="+g_fiscalyear;
document.getElementById("reportFrame").src = cmd;
}
else if(g_orglevel == 4){

//If it is from store level we have to disable the other dropdowns except the District one
document.getElementById("cmdCompany").disabled = true;
document.getElementById("cboRegion").disabled = true;
document.getElementById("cboSpoke").disabled = true;


//* Defaulting the dropdown values to the parameter g_orgnumber
for(var i = 0; i < document.getElementById["cboStore").length; i++){

if(document.getElementById("cboStore").options[i].value == g_orgnumber){

document.getElementById("cboStore").options[i].selected = true;
break;
}
}
g_dropdnvalue = g_orgnumber;
g_dropdnname = 'S';
var cmd = "WFServlet?IBIF_ex=sccr_landingpage_rpt&P_DEPT_ID="+g_orgnumber+"&P_DEPTNAME="+g_dropdnname+"&P_EXPCTR="+g_expctrid+"&P_EXPCTR_NAME="+g_expctrgrp+"&P_ORGLEVEL="+g_orglevel+"&P_MONTH="+g_period+"&P_YEAR="+g_fiscalyear;
document.getElementById("reportFrame").src = cmd;
}

}
 
Posts: 24 | Registered: October 05, 2006Report This Post
Gold member
posted Hide Post
If I understand your problem correctly, your windowOnload() function is being called too quickly after the UpdateData() function is called.

Is that correct?

If so, the issue is that the UpdateData() function is simply setting up multiple AJAX connections to simultaneously populate listboxes, frames, etc.

Add the following code to your HTML page:
  
function WORKER(PARM1,PARM2) {
// whatever logic you need.
}
function OnLoad_Custom(frame,count,limit,milliseconds,command) {
   count++;
   if (frames[frame].document.readyState != "complete") {
       if (count < limit) { 
          setTimeout("OnLoad_Custom('"+frame+"',"+count+","+limit+","+milliseconds+",'"+command+"')",milliseconds);
       }
   } else { eval(unescape(command)); }
}


And then add the following after the UpdateData() function:

  
OnLoad_Custom('FRAMENAME',0,100,200,'WORKER("PARM1VALUE","PARM2VALUE");');


For the OnLoad_Custom function,
FRAMENAME = the frame you want to wait for it to be completely loaded
0 = always keep this 0
100 = # of times to loop waiting for FRAMENAME to completely load
200 = # of milliseconds to wait before checking for FRAMENAME to be completely loaded.

the final parameter is the actual function to call when FRAMENAME is fully loaded.
 
Posts: 21 | Location: Texas | Registered: October 24, 2006Report This Post
Gold member
posted Hide Post
oh... I forgot to mention that FRAMENAME should be the value of the UNIQUE IDENTIFIER property for the frame.
 
Posts: 21 | Location: Texas | Registered: October 24, 2006Report 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     regarding UpdadeData() in html layout painter,please help

Copyright © 1996-2020 Information Builders