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'm trying to chain two calendar controls (begin/end date), set to relative YYMD format, to a chain of listbox controls. I need the listbox content to filter based on a given date interval. Which means the listbox should only display content selections that exist within that time frame. This seems simple enough, but I believe the real obstacle lies in chaining two controls to one control. As well as referencing a valid date parameter that's tied to the date controls.
Though the CAR file doesn't have a date field, I've made a sample html page to illustrate my desired output. The two calender controls should have to start at the top of the chain to filter the following controls accordingly. The first picture displays the parameter tab layout for the chain. Assuming COUNTRY, CAR, MODEL will only display values that exist within that date range, the second picture looks similar to what I need.
Listbox1 will use an external procedure that includes two unformatted fields for begin/end date and two where statements ( WHERE CAR.BEGIN_DATE GT &bd; WHERE CAR.END_DATE LT &ed; ).
I've searched the forums extensively, but haven't found a topic tailored to this particular case. If you need to see anything else let me know. Thanks in advance.This message has been edited. Last edited by: zshanks,
WebFOCUS 7.7.03 Dev Studio 7.7.03 Windows 7 ALL Outputs
Posts: 14 | Location: Upland, IN | Registered: March 26, 2013
1) I don't see any ilustrations. 2) Please post the code which you have already created, or a link to it. 3) Consider using a fex to populate the first chained listbox (which comes after the two calendar controls) which uses the values from the calendar controls as the inputs / filters.
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
There should be a couple pictures shown on my post, as they are visible to me. Maybe your view settings are different from mine? I am using an external procedure (fex) to populate the first chained listbox, which comes after the two calendar controls. The fex code will follow the same format as this...
TABLE FILE CAR
SUM FST.COUNTRY
BY COUNTRY
WHERE BEGIN_DATE GE &BEGIN_DATE;
WHERE END_DATE LE &END_DATE;
ON TABLE PCHOLD FORMAT XML
END
The calendar controls are pointing to two parameters (bd/ed) which are used to filter my graph when ran. The question is, what should I use to reference the calendar control values for my fex where statements and is the above syntax appropriate?This message has been edited. Last edited by: zshanks,
WebFOCUS 7.7.03 Dev Studio 7.7.03 Windows 7 ALL Outputs
Posts: 14 | Location: Upland, IN | Registered: March 26, 2013
Originally posted by Doug: 1) I don't see any ilustrations. 2) Please post the code which you have already created, or a link to it. 3) Consider using a fex to populate the first chained listbox (which comes after the two calendar controls) which uses the values from the calendar controls as the inputs / filters.
Doug here are direct links to the images I posted.
Also.. I'd post the code here but I've been advised not to modify the code in HTML Composer, as it screws with the GUI build. Overall I'm trying to chain two calendar controls that represent a date range, to a listbox that filters its values within that range. If anyone knows a successful method to doing this could you showcase your build? I've been stuck on this for quite some time..This message has been edited. Last edited by: zshanks,
WebFOCUS 7.7.03 Dev Studio 7.7.03 Windows 7 ALL Outputs
Posts: 14 | Location: Upland, IN | Registered: March 26, 2013
I'd post the code here but I've been advised not to modify the code in HTML Composer, as it screws with the GUI build.
How does that prevent you from posting the code? Just copy it from the text view of HTML Composer and paste it here between a couple of code tags. You're not modifying anything doing that.
There are claims that what you're attempting is possible; to have multiple links to a control from different other controls. It involves applying some kind of voodoo to the link logic, but I've never been able to pull that off. As far as I'm concerned, that just doesn't work.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
How does that prevent you from posting the code? Just copy it from the text view of HTML Composer and paste it here between a couple of code tags. You're not modifying anything doing that.
Sorry, I thought the images could explain the concept better and I wasn't sure it was safe to post the original code but I just got permission. In addition, If there's another way to filter a date range for my chain controls without using multiple links to a control, I'd be more than happy to use that as well. This just appears to be the only way... Does anyone know such sorcery!?
WebFOCUS 7.7.03 Dev Studio 7.7.03 Windows 7 ALL Outputs
Posts: 14 | Location: Upland, IN | Registered: March 26, 2013
Well... I sort of do know such sorcery. I created our own javascript library for dealing with launch-pages that fetches form element contents by calling the Adhoc-fex directly with a fragment of user-provided WebFOCUS code.
At one hand, it is far more flexible than what HTML Composer offers; it can deal with form controls with input from several other form controls and vice versa and supports much more flexible embedded procedures (anything goes, really). OTOH, it's still incomplete (haven't worked on it for a while now), requires that you know how to hand-code HTML pages and requires some hand-coded embedded XML (which is fairly simple, but it won't work without or with errors in it) - no convenient WYSISYG editor, I'm afraid. It's also mostly undocumented...
Oh, and deploying that HTML using Developer Studio will only make you giggle. Or cry. DS breaks it trying to "adjust" paths (that don't need adjusting) to how they are on the server and meanwhile change a whole bunch of content to things that are not very standards compliant.
That is the way we went for such cases. They're lucky to have me here
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
HTML Composer's calendar control consists of two parts -- an INPUT control (part of the generated static HTML: ID=calendar1 etc.) for the resulting parameter value string and -- the calendar widget (the icon and associated functionality dynamically added by the "setupDocCalendars();" call at the bottom of the file) that allows the user to select a date and updates the INPUT control accordingly.
Unfortunately, the browser does not fire an onchange of the INPUT control when it is altered programmatically. It would help a lot if IBI would trigger an "onchange" event in the INPUT control whenever the widget stuffs a new value there. Until then, there are methods to accomplish that. See the article, for example.
SO: - create two hidden inputs, bd and ed, - associate the parameters &bd and &ed with them - reconstruct the chain as bd -> ed -> listbox1 ... When value of either calendar1 or 2 changes, * copy them both to bd and ed, respectively, using IbComposer_getCurrentSelection() and IbComposer_setCurrentSelection() * trigger refresh of the chain from listbox1 and onward, using IbComposer_ResetDownChainControls()
Note that the "refresh" of ed (second in the chain) will never be triggered, so it does not matter how you define it -- but the chaining ensures that both parameters will be fed to the fex that refreshes listbox1.
Let us know how you fare.
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
Perfect. Looks like your approach did the trick jgross. Thank you!
First, I created two textbox controls (set to hidden) associated with parameters &bd/&ed. Instead of using the linear chain bd -> ed -> listbox1, I was actually able to chain the textbox controls to listbox1 using separate links bd -> listbox1 <- ed.. So yes, you can employ multiple links to a single control provided certain conditions are met. Check out the procedure "How to Use Controls to Populate Another Control Based on Selected Values", on page 246, for a good example of this.
I used the "setInterval()" method within the article jgross cited above, to detect a change within calendar controls. I could then copy the values over to their respective textbox controls. For some reason, "getCurrentSelection()" and "setCurrentSelection()" didn't work properly, so I had to use "getElementById()" instead. This may have something to do with formatting issues, but I'm not sure. Last, I triggered the "ResetDownChainControls()" function from the textbox controls to refresh the chain. This works like a charm. Will definitely be using more javascript in composer for times to come. Here's the code...
function onInitialUpdate(){
checkDate();
}
function checkDate(){
var bdOld = document.getElementById('calendar1').value;
var edOld = document.getElementById('calendar2').value;
document.getElementById('edit1').value = bdOld;
document.getElementById('edit2').value = edOld;
IbComposer_ResetDownChainControls('edit1');
IbComposer_ResetDownChainControls('edit2');
setInterval(function(){
var bdCur = document.getElementById('calendar1').value;
var edCur = document.getElementById('calendar2').value;
if (bdCur!=bdOld){
bdOld = bdCur;
document.getElementById('edit1').value = bdOld;
IbComposer_ResetDownChainControls('edit1');
}
if (edCur!=edOld){
edOld = edCur;
document.getElementById('edit2').value = edOld;
IbComposer_ResetDownChainControls('edit2');
}
}, 100);
}
Thanks again guys, you rock This message has been edited. Last edited by: zshanks,
WebFOCUS 7.7.03 Dev Studio 7.7.03 Windows 7 ALL Outputs
Posts: 14 | Location: Upland, IN | Registered: March 26, 2013