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 am developing an HTML launch page using the HTML Composer in Dev Studio. I have one control, which is a radio button with 5 static values. I also have a list box control that I would like to dynamically load values via a fex based on a value selected with the radio button.
My radio button control has values like Region, Division, etc. If the selected value is Region, I'd like to have List Box populated with regions. If the selected value is District, I'd like to have the list box populated with districts. These values come from an Oracle table and I want to retrieve the values via a fex based on the radio button value.
Is this possible to do in the HTML Composer, or do I have to do this in HTML? How can I go about doing this?
Thanks!This message has been edited. Last edited by: JRLewis,
You'll probably have to write your own javascript that you can tie to the radio button control. As an alternative you could create all 5 list boxes and populate all of them, and then use javascript to hide or unhide based on the radio button selection. then there is no delay when switching between values (after the initial load, or course)
Because you're populating different fields into the same list box control, you're also going to have to pass a variable that would tell your fex which parameter is being populated (region, division, etc.) because your fex will need to know which fields to use for display and/or comparision. If you create the list boxes separately, each has its own parameter name and would avoid confusion.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
We introduced some nifty new dynamic abilities in 769. Suggest you download 7.6.10 devstudio and have a look (when you are ready to deploy, your WF shoukld also be up to 7.6.10 too).
Brian Suter VP WebFOCUS Product Development
Posts: 200 | Location: NYC | Registered: January 02, 2007
I've had luck in the past using a Dropdown list instead of Radio Buttons. you need to define the fieldand enter the values you need to display.
This code puts together office and worker: SET HOLDLIST=PRINTONLY
JOIN TCAS_OFC_WRKR_DMSN.TCAS_OFC_WRKR_DMSN.CAS_WRKR_DMSN_ID IN TCAS_OFC_WRKR_DMSN TO MULTIPLE TCAS_WRKR_DMSN.TCAS_WRKR_DMSN.CAS_WRKR_DMSN_ID IN TCAS_WRKR_DMSN AS J0 END JOIN TCAS_OFC_WRKR_DMSN.TCAS_OFC_WRKR_DMSN.CAS_OFC_DMSN_ID IN TCAS_OFC_WRKR_DMSN TO MULTIPLE TCAS_OFC_DMSN.TCAS_OFC_DMSN.CAS_OFC_DMSN_ID IN TCAS_OFC_DMSN AS J1 END DEFINE FILE TCAS_OFC_WRKR_DMSN WRKR_ID/A40=CAS_WRKR_DSPL_NM ||' - ' || CAS_WRKR_USR_ID; END TABLE FILE TCAS_OFC_WRKR_DMSN PRINT CS_OFC_CD WRKR_ID BY CAS_OFC_DMSN_ID BY CAS_WRKR_DMSN_ID HEADING "" FOOTING "" ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT XML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE *
Note: I join the dimentions together to get the code and worker name since dimentions are small tables they do not to load.
Duane
WebFOCUS 8.0.7 DS 8.0.7 AS 8.0.7 Windows Output: Excel, HTML, PDF, AHTML,Mobile In Focus 1982
You could always call a JS function onclick of the radio buttons, dunamically change the value of the "datasource" attribute of the combo and then call the JS function within the IBIRLS.JS or IBIRLS2.JS something like -
Thanks for all the responses! I decided to go ahead with creating 5 list boxes and using Javascript to hide and show as needed. This provides exactly the functionality I was looking for.
Sure - here is some code snippets of the method I went with.
I started with the HTML Painter (v7.6.8) to create the objects (list boxes, radio button), then wrote the Javascript functions to support the behavior I wanted.
I created a radio button and five list boxes, one on top of another. The list boxes are pre-populated from the database by fexes based on organization (i.e. regions, divisions, areas, etc.). The value of the radio button relates to the organizational level, like 'Region'. There are five values corresponding to the five list boxes. When I select the Region value, the Region list box shows.
Here are the JS functions:
function window_onload() {
//Place 5 listboxes on the form - one each for region list, division list, area list, district list, and store list.
//Default listbox is listbox1 (region). The listboxes display one on top of the other.
document.getElementById("listbox1").style.display = "block";
document.getElementById("listbox2").style.display = "none";
document.getElementById("listbox3").style.display = "none";
document.getElementById("listbox4").style.display = "none";
document.getElementById("listbox5").style.display = "none";
}
function DisplayListBox(hierlevel) {
//Determine which listbox and comboboxes are be displayed on top, based on the selection of 'hierlevel' radio button.
document.getElementById("listbox1").style.display = "none";
document.getElementById("listbox2").style.display = "none";
document.getElementById("listbox3").style.display = "none";
document.getElementById("listbox4").style.display = "none";
document.getElementById("listbox5").style.display = "none";
if (hierlevel == 'Region') {
document.getElementById("listbox1").style.display = "block";
}
if (hierlevel == 'Division') {
document.getElementById("listbox2").style.display = "block";
}
if (hierlevel == 'Area') {
document.getElementById("listbox3").style.display = "block";
}
if (hierlevel == 'District') {
document.getElementById("listbox4").style.display = "block";
}
if (hierlevel == 'Store') {
document.getElementById("listbox5").style.display = "block";
}
}
Here is the HTML generated from the painter for the radio button, which shows the JS function being called when a particular radio button value is selected.
I still can't get it to work....here some simple html code. can you tell me where to add the java and tml code you provided? thanks
< !-- Generated by Report Layout Painter -->
<HTML>
<HEAD>
<META content="MSHTML 6.00.6000.17063" name=GENERATOR>
<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
}
//End function window_onload
</SCRIPT>
<script for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
</HEAD>
<BODY style="OVERFLOW: auto"></BODY></HTML>
This message has been edited. Last edited by: Kerry,
Hello I can't get the list boxes to populate dynamicly from a datasource or a focexec. but if I put a static value in the listbox I see it. please help...here's my code below..thanks..!!
< !-- Generated by Report Layout Painter -->
<HTML>
<HEAD>
<META content="MSHTML 6.00.6000.17063" name=GENERATOR>
<script id=clientEventHandlersJS type=text/javascript>
//Begin function window_onload
function window_onload() {
//Place 5 listboxes on the form - one each for region list, division list, area list, district list, and store list.
//Default listbox is listbox1 (region). The listboxes display one on top of the other.
document.getElementById("listbox1").style.display = "block";
document.getElementById("listbox2").style.display = "none";
document.getElementById("listbox3").style.display = "none";
document.getElementById("listbox4").style.display = "none";
document.getElementById("listbox5").style.display = "none";
}
function DisplayListBox(hierlevel) {
//Determine which listbox and comboboxes are be displayed on top, based on the selection of 'hierlevel' radio button.
document.getElementById("listbox1").style.display = "none";
document.getElementById("listbox2").style.display = "none";
document.getElementById("listbox3").style.display = "none";
document.getElementById("listbox4").style.display = "none";
document.getElementById("listbox5").style.display = "none";
if (hierlevel == 'Region') {
document.getElementById("listbox1").style.display = "block";
}
if (hierlevel == 'Division') {
document.getElementById("listbox2").style.display = "block";
}
if (hierlevel == 'Area') {
document.getElementById("listbox3").style.display = "block";
}
if (hierlevel == 'District') {
document.getElementById("listbox4").style.display = "block";
}
if (hierlevel == 'Store') {
document.getElementById("listbox5").style.display = "block";
}
}
{
UpdateData();
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
}
//End function window_onload
</SCRIPT>
<script for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
</HEAD>
<BODY style="OVERFLOW: auto">
<A id=anchor1 href="java_script:OnExecute[null, 'anchor1')" name=anchor1 autoExecute="True" requests_list="3">Preview</A></SPAN>
<SPAN id=radio1 contentEditable=false style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; Z-INDEX: 129; LEFT: 20px; WIDTH: 100px; FONT-FAMILY: Arial; POSITION: absolute; TOP: 110px; HEIGHT: 80px; BACKGROUND-COLOR: white" tabIndex=129 name="HIER_VALUE" columns="1" operation>
<TABLE contentEditable=false style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; WIDTH: 100%; HEIGHT: 100%" cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD>
<INPUT id=radio1_0 onclick="DisplayListBox['Region');" type=radio CHECKED value=REGION_VALUE name=HIER_VALUE displaytext="Region">
<LABEL style="CURSOR: default" tabIndex=129 for=radio1_0>Region</LABEL></TD></TR>
<TR>
<TD>
<INPUT id=radio1_1 onclick="DisplayListBox['Division');" type=radio value=DIVISION_VALUE name=HIER_VALUE displaytext="Division">
<LABEL style="CURSOR: default" tabIndex=129 for=radio1_1>Division</LABEL></TD></TR>
<TR>
<TD>
<INPUT id=radio1_2 onclick="DisplayListBox['Area');" type=radio value=AREA_VALUE name=HIER_VALUE displaytext="Area">
<LABEL style="CURSOR: default" tabIndex=129 for=radio1_2>Area</LABEL></TD></TR>
<TR>
<TD>
<INPUT id=radio1_3 onclick="DisplayListBox['District');" type=radio value=DISTRICT_VALUE name=HIER_VALUE displaytext="District">
<LABEL style="CURSOR: default" tabIndex=129 for=radio1_3>District</LABEL></TD></TR>
<TR>
<TD>
<INPUT id=radio1_4 onclick="DisplayListBox['Store');" type=radio value=STORE_VALUE name=HIER_VALUE displaytext="Store">
<LABEL style="CURSOR: default" tabIndex=129 for=radio1_4>Store</LABEL></TD></TR></TBODY></TABLE></SPAN>
<SELECT id=listbox1 style="Z-INDEX: 130; LEFT: 210px; WIDTH: 240px; POSITION: absolute; TOP: 110px" tabIndex=130 size=3 name=listbox1 datasource="SWFOPSBRANCH.mas" sourcetype="typeMaster" datafield="OPS_VP" displayfield="OPS_VP" dynalldisplayvalue="ALL" addalloption="1" datatype="1" ibiformat="A255V" dfformat="A255V" ibiapp_app="#" ibic_server="LOKI" selectedvalue textvarname="listbox1_TEXT"></SELECT>
<SELECT id=listbox2 style="Z-INDEX: 131; LEFT: 210px; WIDTH: 240px; POSITION: absolute; TOP: 180px; HEIGHT: 54px" tabIndex=131 size=3 name=listbox2 IBIMR_dir="#matty90zv2r1" datasource="app/group_plant_dropdown1.fex" sourcetype="typeFex" dynalldisplayvalue="ALL" addalloption="1" datatype="1" IBIMR_folder="#opsdry4jlt70" IBIMR_domain="untitled/untitled.htm" ibiapp_app></SELECT>
<SELECT id=listbox3 style="Z-INDEX: 132; LEFT: 210px; WIDTH: 240px; POSITION: absolute; TOP: 260px; HEIGHT: 54px" tabIndex=132 size=3 name=listbox3>
<OPTION value=three selected displaytext="three">three</OPTION></SELECT>
<SELECT id=listbox4 style="Z-INDEX: 133; LEFT: 210px; WIDTH: 240px; POSITION: absolute; TOP: 350px; HEIGHT: 54px" tabIndex=133 size=3 name=listbox4>
<OPTION value=four selected displaytext="four">four</OPTION></SELECT>
<SELECT id=listbox5 style="Z-INDEX: 134; LEFT: 210px; WIDTH: 240px; POSITION: absolute; TOP: 420px; HEIGHT: 54px" tabIndex=134 size=3 name=listbox5>
<OPTION value=five selected displaytext="five">five</OPTION></SELECT></BODY></HTML>
This message has been edited. Last edited by: Kerry,
Sorry for not being too responsive - I am at a client site, and we are in the middle of a production implementation.
There was a question about getting the listboxes to load dynamically. I developed some load fexes and used the painter to create the list boxes and tied the fexes to the list boxes.
The load fex creates an XML file used by the list box.
Here is generated code - keep in mind this is 7.6.8, so you will probably not be able to plug this into your html.
Dan, if I can figure out how you were able to develop the html, that would be great! Unfortunately, my experience with the post 7.6.8 version of the painter is pretty minimal and disappointing. I do have some questions for you:
Was your entire html developed in the painter, or did you enhance it manually? I see dialogue manager and WF code - did you add that? Do you use the html as a web page by itself, or as an HMTLFORM in a fex?
JRLewis - I developed the page entirely in the HTML Composer. The Dialog Manager and WebFOCUS Code was added in the Properties and Settings window for the listboxes. This is done on the Parameters tab. The page will run just fine by itself but you could certainly call it from a .fex procedure using -HTMLFORM. In fact, I just realized recently that launching an .htm file from a .fex using -HTMLFORM is the only way I can resolve some Global AmperVariables on the web page. I may need to start using that technique more often.
Regards,
Dan
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007
I copied your code and created a fex that calls the code in an HTML file - clicking on any of those three master names does not load anything into the two select lists. I am on v7.6.8 so I suppose your v7.6.10 code will not work.
I simply need to reload one select list.
Thanks,
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
Code in place and working. Now I'll run away and hide out in Bali, because I don't want to be around when they upgrade one minor version an everything crashes.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
An update on my previous posting (glad it helped Francis).
I have a process that I am currently using where I need to refresh the third combo in a chained list. E.g I have three controls that are chained with respective ids of "edit1", "edit2" and "edit3" - very imaginative I know As part of my process I update (using an AJAX call using MODIFY) values in my database that will load into the "edit3" combo, and I need to refresh the contents so that the user does not have to reset "edit2" and then set it back again, purely to get the contents of "edit3" updated (hope that's clearer than I think it is ).
To achieve this I use the following JavaScript, and this works in 7.6.10 upwards. Not managed to get it working in 7.6.9 but will be looking at that soon, I hope.
var objCtrl = document.getElementById("edit2");
DoResetDownChainControls(objCtrl);
Please note that this is an IBIRLS3 function and therefore earlier releases that have IBIRLS2 or IBIRLS are unlikely to have that function.
Also, bear in mind what Brian Suter has mentioned in other posts.
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
What I *love* is that simply opening and saving a HTML Composer file created in a prior version may cripple it - whatever happened to Information Builders steadfast rule regarding backwards compatibility?
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server