Here's an update on my progress to implement a custom combobox on the ribbon in PMF:
I modified the pmf_ribbon.htm file in the mainstreet app folder as follows:
1. add a combo to the table tags in the body section near the bottom (replace the { with < ):
{ td>
{ label for="time_combo" id="lblTimeCombo">
Time:
{ /label>
{ /td>
{ td>
{select name="time_combo" id="time_combo" class="filtercombo" size=1
style="width: 180;" onchange="change_time_level(value);">
{option value="">---------------------------{/option>
{/select>
{/td>
2. create a change_time(value) function in the javascript section near the top:
//-----------------------------------------------------------------------------------------------------------------------------//
// This function is called when the user changes the time combobox on the ribbon
function change_time_level(TIME_RANGE_ID)
{
SetIBICookieElement("WF_USER", "TIME_RANGE_ID", TIME_RANGE_ID);
alert(GetIBICookieElement("WF_USER","TIME_RANGE_ID"));
}
//-----------------------------------------------------------------------------------------------------------------------------//
3. populate the combobox with the IDs and Names/Descriptions from the TIME_RANGES table:
-add this to the docInit() function that already exists
// ccccccccccccccccccccccccccccccccccccccccccccccc
// this loads the time period combo box
var cgicommand = getWFScriptName() + "?" ;
var theFEX = buildFEX("TIME_RANGES", "TIME_RANGE_NAME", "A50", "TIME_RANGE_ID", "I11",null, null, null, null) ;
var commobj = new ibihttpxml(cgicommand, theFEX) ;
// populateListBox(commobj,time_combo,false);
customListBox(commobj,time_combo,0,"select...");
// cccccccccccccccccccccccccccccccccccccccccccccccc
Now I have an additional combobox just to the right of the Scorecard combobox, which shows all the time range names that are in PMF. If I select a particular value, it writes the time range id to the WF_USER cookie.
As I developed this, I realized that there are two time-related settings to worry about, not just the time range. I also want to control the level of Time that gets set as the BY field / Across field. For instance, if you look at the Measure 5 Periods report, it uses the time dimension tree. You can click on a yearly value, and you will get five years of data showing on the report. This has a relative time range, with 5 periods, with period being either yearly or quarterly or monthly (default time dim). Using my time range combobox, I could easily read the cookie to change to 12 rolling periods. However, that will do nothing for the period-type.
I'm starting to wonder about the two functions Bob mentioned: populateTimeFilter() VS populateListBox(). Do they both do the same thing, or does the populateTimeFilter also handle the period-type behind the scenes? I don't really want two comboboxes to handle this, although I do understand that these are two operations and they may need to be broken into two steps.
How does one control the period-type anyway? Is it something like you SET TIME_DIM_LEVEL01-03 in a particular variable?
I am also wondering about how to refresh my report after I write the time range id to the WF_USER cookie. Is there a function that maintains the state and variables during a refresh?
Hope this post is useful for others, and I'm also grateful for some answers on my two questions.
Cheers,
Joey
-WebFOCUS 8.2.01 on Windows