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.
The list box has more than 24 months, it's purpose is to set the starting month to be passed to a fex. I don't want either the lowest or highest month set initialy, but rather the current month minus 6. The reason is the called fex is autoexecuted and the widest possible date range retrieves too much data for an initial display of a graph/report.
I'm looking for a way to have the list box contain all the availalbe months both backward and forward from the hopefully defaulted selected date value. In my sample the selectedvalue is initialy set to '0901', but next month I would like this be set to '0902' without having to modify the html manually.
Any suggestions or someone pointing me to documentation would be greatily appreciated, as my searches come up blank.This message has been edited. Last edited by: Laure,
Check out the use of "-DEFAULT" for the associated variable in your fex and then associating the HTML control with that variable. This should "pick up" the DEFAULTed value... In the GUI (HTML Layout Painter / HTML Composer)...
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
Only really useful (and operational) if the HTML file is contained within an HTMLFORM within a fex where the amper variable is available and you have supporting code for the non standard attribute "selectedvalue". Your signature states that you are using 7.6.4 but has this code been produced in 7.6.9 - what IBIRLS JavaScript library does it use?
If, as I would guess, the HTML is not initiated within a fex then you would probably have to resort to setting the selectedIndex within JavaScript. The easiest method of doing this (if you always want the 6th item in your list), is with something like this in the onLoad function -
// Set the current selected to the 6th item (index goes from 0 - (n-1) where n is the number of items in the list)
document.getElementById("combobox1").selectedIndex=5;
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
if you're using a fex to create an xml file for your dropdown....and your fex could easily figure out what the selected date in your list should be .... but then HOW do we make the XML file force a selected variable? the XML list seems to only show the list top to bottom, just as written, but HOW would we pick some value in the middle to be selected? and its not always going to be , say, #5 ?
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
I was wondering about this myself recently but never had to actually do it. In the fex that creates the xml you could append something to the row that you want selected that would never normally occur. such as "@XXX" where @ could not be in the data. Then use javascript to loop through the listbox when the page loads and when you see the "@" remove it from the value and do the select.
It is clunky but would work. Is there an easier way?
Currently the JavaScript that is used to build the option list uses a mask to filter out c0 and c1 values from within your XML. A fairly easy method would be to extend the XML output to include a third value to indicate which value should be "selected" on loading.
Think of the following fex to demonstrate -
DEFINE FILE CAR
SELECTED/A8 WITH COUNTRY = IF COUNTRY EQ 'ITALY' THEN 'selected' ELSE '';
END
TABLE FILE CAR
SUM FST.COUNTRY
SELECTED
BY COUNTRY
ON TABLE PCHOLD FORMAT XML
END
It wouldn't take too much effort to recode the ibirls.js routines to filter out the selected value and set the selected attribute for the list item accordingly.
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
A method that will work (tested) without too much additional coding and without amending IB modules is to add the code I suggested above but make it easier to use. I've left the "// TODO:" comment to show where this code would be placed -
// TODO: Add your event handler code here
// Set the selected item in "combobox1" to the third item
self.setTimeout('resetsel("combobox1",2)',10);
// Set the selected item in "combobox1" to the second item
self.setTimeout('resetsel("combobox2",1)',10);
}
function resetsel(ctrl, num) {
var selObj = document.getElementById(ctrl);
selObj.selectedIndex = num;
DoResetDownChainControls(document.getElementById(ctrl));
}
The self.setTimeout will kick off the enclosed function after 10 milliseconds which should give the comboboxes time to be populated (unless they are HUGE, in which case change the 10 to something larger).
The DoResetDownChainControls will reposition any chained items you have connected to the control you specify, if any.
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
-HTMLFORM BEGIN <script id=changeCombos type=text/javascript>
function onInitialUpdate() { document.getElementById('edit1').selectedIndex = !IBI.AMP.WKBEGIN; document.getElementById('edit2').selectedIndex = !IBI.AMP.WKEND; }
-HTMLFORM END
* WKBEGIN and WKEND are the indexes which I calculated before. (index in listboxs start with 0)
Also a simple java-script can be used to determine the index by comparing the display values. Something like this ( untested ) should work idListBox1b = parent.document.getElementById('lbSuppliers'); for (i=0; i if (idListBox1b[i].value == !IBI.AMP.DISPVAL) { SelectTheIndex = i; } }
Thanks all who posted suggestions. In the end I included a value -select- to the top of the list via the HTML painter, and the called fex deals with calculating the desired default because the paramater is empty.
See the problem was that the default value to be selected from the listbox wasn't a fixed number in the list. My approach works and the customers are fine with it. And I don't modify any IB code.