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.
We have a self service application built by using WebFocus HTML Layout tool. We have may parameters to be passed from GUI to the reports on each tab (a html page). We have many tabs in that application. The application is working just fine.
Now we are asked to pass parameters from one tab to another tab. If users click SUBMIT button on the same tab, use the current selected parameters. If users jump from one tab to another tab, default to the previous parameters (need to pass the parameters from tab to tab). I save all users selections to a database and can pass all the parameters to the next tab and reports generated correctly without issues. I use javascript in the window_onload() function in the html file to hightlight the selections in the comboBoxes and radio buttons.
The only issue is with the chained listbox by using this approach (I use focexec programs to get data). For car database as an example, the combobox shows country, the listBox shows car when country is selected. When the form opens, I can have JAPAN selected as a country from the comboBox, but how can I have DATASUN, TOYOTA shown(not JAGUAR, JENSEN and TRIUMPH) in the listbox by using javascript code through window_onload function. Has anyone done this through this approach or done in different ways?
I am thinking Webfocus must have an internal event handler or functions to call for the chained comboBoxes. When you click on chained box1, the values in chained box2 will be refreshed automatically based on your selection. Is there any way we can trigger this event handler or call this type of function?
We are using webfocus 7.63 for Windows Server 2003.
COUNTRY CAR
ENGLAND JAGUAR
JENSEN
TRIUMPH
FRANCE PEUGEOT
ITALY ALFA ROMEO
MASERATI
JAPAN DATSUN
TOYOTA
W GERMANY AUDI
BMW
This message has been edited. Last edited by: Kerry,
Posts: 118 | Location: Omaha, NE | Registered: June 12, 2003
Not knowing what you do in your onload step, but I would have thought, that what loads or positions your first list could then populate the second, and so on.
When an HTML file, created within painter, is opened the onload function is called. This onload function is held within IBIRLS2.js and contains most of the js used to control things such as chained combo boxes etc.
One of the things that the onload function does is to prepend "onchange" events to combo boxes in general which is designed to call the AJAX process to load control values from a fex or a master.
You can see that what you need to do is to call that function yourself at the appropriate time. The function is called "populateDynamicCtrl();" and it expects an object variable to be passed - so something like -
objCtrl = document.getElementById(your control id goes here); populateDynamicCtrl(objCtrl);
Good luck
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
I did try to call a few js functions in ibirls2.js, such as populateDynamicCtrl(objCtrl) and populateChainElementFromServer(element), and it just inialized to the default, which showed the first (for car db as an example) COUNTRY in the combobox and the CAR belongs to the first country.
To answer Waz question: I use onload function to position users' selections from comboboxes, radio buttons. When I have this statement document.all.COUNTRY.options[3].selected = true; WHICH MEANS user selected JAPAN as a country. Meanwhile, I wish it shows DATASUN and TOYOTA in the chained listbox. However it shows JAGUAR JENSEN TRIUMPH. The chained box does not automatically refresh if you set your selected COUNTRY in js unless you make a different selections from GUI (I guess it fires onchange event). I tried to code onchange event handler and then call it from onload function, but not successful.
This is a kind of 2 steps process, first you carry over the parameters in focexec and send your request to the reporting server to get report right, then you also want users see their selections on GUI correctly. I have everything working correctly except the chained listbox.
Any help is appreciated.
Posts: 118 | Location: Omaha, NE | Registered: June 12, 2003
rather than trying to push the content to the new tab (which is a challenge when the content is not a simple "value"), an alternative is to have the tab pull the content, whenever the tab comes into view, from the most recently visible tab that shares each of its respective parameters
use a global array of objects, keyed to parameter name, to hold source info for obtaining the latest content and status: before a tab loses focus, it sets the pointer for each of its parameters to itself. (I'm not sure that the tab's 'loss of focus' can be sensed -- if not, do it whenever it loads or regains focus, but after it updates its content from other tabs.) Thus, on a perpetual accounting basis, you know what's the freshest source for each parameter.
On load of a tab and when it regains focus, if the global array's pointer is non-null and points to a different tab as the latest source, then refresh from that tab: Depending on the type of control, either copy the value from the other tab, or (for a SELECT group) copy the array of options and their attributes. Radio groups can also be handled.
At any given moment, some hidden tabs may be out of sync, but that does not matter -- they get updated as needed whenever they come into view.
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
Fernando, the UpdateData() function is called in window_onload function by default. However I did try to pass different values in the argument by calling it again after some js statements. It did not do that work.
Posts: 118 | Location: Omaha, NE | Registered: June 12, 2003
Have you thought about setting Cookie values, writing out to a txt file, the, read them back in???
Short example:
FI VARS DISK vars.txt
-RUN
-WRITE VARS setC("CHTX","&CHTX.EVAL");
-WRITE VARS setC("CHT","&CHT.EVAL");
-WRITE VARS setC("CHTTXT","&L0TXT.EVAL");
-WRITE VARS setC("ORG","&ORG.EVAL");
-WRITE VARS setC("LEV","&LEV.EVAL");
-WRITE VARS setC("LEVUP1","&LEVUP1.EVAL");
-WRITE VARS setC("LEVDN1","&LEVDN1.EVAL");
-WRITE VARS setC("STRLEV","&STRLEV.EVAL");
-WRITE VARS setC("ORGDIV","&ORGDIV.EVAL");
etc...
THEN
LOOP or -REPEAT to get the variables you need..
-READ VARS NOCLOSE etc....
In your JavaScript, some functions:
function htmCall(){
//This function is called when the user clicks on HTM.
//Set the Format cookie:
setC("WFFMT",'HTML');
document.getElementById('iframe1').src="/ibi_apps/WFServlet?IBIC_server=EDASERVE&IBIAPP_app=" + '!IBI.AMP.RPMAPP;' + "&IBIF_ex=waldo&Random=" + Math.random();
}
function pdfCall(){
//This function is called when the user clicks on PDF.
//Set the Format cookie:
setC("WFFMT",'PDF');
pdf_fmt_src = fmt_src + "&Random=" + Math.random();
window.open(pdf_fmt_src, '_blank', "toolbar=0,resizable=1");
}
function exlCall(){
//This function is called when the user clicks on EXL.
//Set the Format cookie:
setC("WFFMT",'EXL2K');
exl_fmt_src = fmt_src + "&Random=" + Math.random();
window.open(exl_fmt_src, '_blank', "toolbar=1,resizable=1");
}
var bGrps = '!IBI.AMP.BTNCD;';
setC("BTNCD",bGrps);
//
var bGrp1 = bGrps.substr(0, 1);
var bGrp2 = bGrps.substr(1, 1);
var bGrp3 = bGrps.substr(2, 1);
var bGrp4 = bGrps.substr(3, 1);
var bGrp5 = bGrps.substr(4, 1);
var bGrp6 = bGrps.substr(5, 1);
var bGrp7 = bGrps.substr(6, 1);
var bGrp8 = bGrps.substr(7, 1);
var bGrp9 = bGrps.substr(8, 1);
var bGrp10 = bGrps.substr(9, 1);
var bGrp11 = bGrps.substr(10, 1);
var bGrp12 = bGrps.substr(11, 1);
var bGrp13 = bGrps.substr(12, 1);
Tom, thanks for your response and sample code. I write the values to a database, and can get back values to the reports. The only issue is positioning in the chained listbox on the GUI side. I think setting cookie values is no difference comparing with writing values to the database within a session, though I have not tried that.
Posts: 118 | Location: Omaha, NE | Registered: June 12, 2003
Apologies for not replying yesterday, I didn't have a great deal of time to spare here.
Ok, so calling the populate ctrl function only gave you the first entry in the selection and what you really want is to position the combo box at the value being passed to the HTML page?
That being the case, then just have a javascript function of your own which instantiates a variable with the value required and then locate it within the combo box and set the selected attribute for that index to true.
Using this function you can achieve just that. Just make a call to the function and pass the combo box Id and the value at which point you want the combo box positioned.
function position_ctrl(ctrlid,value) {
objCtrl = document.getElementById(ctrlid);
for (i=0; i<objCtrl.length; i++) {
if (objCtrl[i].value == value) {
objCtrl.selectedIndex = i;
}
}
}
Good luck
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
To make my question more clear, I coded a simple sample htm file and 3 focexec. The htm file contains a chained listbox and a combobox. I added js function there called position_controls() which is called from window_onload. I position COUNTRY to index 3, which is JAPAN, how can I position the car which are made in JAPAN in the chained listbox (by default it shows cars made in ENGLAND)?
Below are my sample programs (1 htm file and 3 focexecs), and you can copy to your DeveloperStudio to test (I created project folder called test):
[CODE]< !-- Generated by Report Layout Painter -->
<script id=IBI_ibigblloadCss type=text/javascript> ibigblloadCss(null); HtmlPage <script id=clientEventHandlersJS type=text/javascript> //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
position_controls();
} //End function window_onload
//Begin function button1_OnClick function button1_OnClick(ctrl) { // TODO: Add your event handler code here OnExecute(ctrl) } //End function button1_OnClick
function position_controls() { document.all.COUNTRY.options[3].selected = true;
//how to positon CARs made in the above specified country in the listbox CAR
2. Why did script code appear twice? I don't know. I guess I tried to chain the controls twice. First time I did see the code generated, so I did it again. However it does not affect funcitoning from my developer studio.
Posts: 118 | Location: Omaha, NE | Registered: June 12, 2003