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 have an accordion report that is using prompts to allow the user to select different by levels. Since I have predefined the first 3 BYs, they can choose NONE, or one or more additional fields to go down a level BY. The values are static (predefined) in each drop down list box and are the same, would like to learn how to adjust the subsequent list box, so as the user chooses values the subsequent choices will exclude the choice made in the previous list box. I was told this could be done with HTML composer, but after looking at some posts and documentation, I was unable to understand the technique. I did go through the initial set up with the HTML composer wizard, but when got to the chain window was stuck on how to proceed. Using the car example provided by IBI, here is an example. "Level n" is a drop down list box: (Hope this lines up)
Level 1 Level 2 Level 3 Level 4
NONE NONE NONE NONE
CAR CAR CAR CAR
COUNTRY COUNTRY COUNTRY COUNTRY
MODEL MODEL MODEL MODEL
Let's say user wants BY COUNTRY CAR and MODEL then as user clicks on the choices the list boxes to look like this:
Level 1 Level 2 Level 3 Level 4
NONE NONE NONE NONE
CAR COUNTRY MODEL
COUNTRY MODEL
MODEL
Here is current code sample with CAR
SET ASNAMES = ON
SET EXPANDBYROW=ON
-PROMPT &SORT1.(ALL,CAR,COUNTRY,MODEL,BODYTYPE).First Sort.
-PROMPT &SORT2.(ALL,CAR,COUNTRY,MODEL,BODYTYPE).Second Sort.
-PROMPT &SORT3.(ALL,CAR,COUNTRY,MODEL,BODYTYPE).Third Sort.
-PROMPT &SORT4.(ALL,CAR,COUNTRY,MODEL,BODYTYPE).Fourth Sort.
-SET &SORT1 = IF &SORT1 EQ 'ALL' THEN '_FOC_NULL' ELSE &SORT1 ;
-SET &SORT2 = IF &SORT2 EQ 'ALL' THEN '_FOC_NULL' ELSE &SORT2 ;
-SET &SORT3 = IF &SORT3 EQ 'ALL' THEN '_FOC_NULL' ELSE &SORT3 ;
-SET &SORT4 = IF &SORT4 EQ 'ALL' THEN '_FOC_NULL' ELSE &SORT4 ;
-SET &BYSORT1= IF &SORT1 EQ ' ' THEN ' ' ELSE 'BY ' | &SORT1;
-SET &BYSORT2= IF &SORT2 EQ ' ' THEN ' ' ELSE 'BY ' | &SORT2;
-SET &BYSORT3= IF &SORT3 EQ ' ' THEN ' ' ELSE 'BY ' | &SORT3;
-SET &BYSORT4= IF &SORT4 EQ ' ' THEN ' ' ELSE 'BY ' | &SORT4;
TABLE FILE CAR
SUM SALES
&BYSORT1
&BYSORT2
&BYSORT3
&BYSORT4
ON TABLE NOTOTAL
END
caveat: im in 7.6.8, so things may have improved... write a launch page, rather than prompts. are you ok with that? if not, bail out now. if so, continue reading. in 7.6.8, in your launch page set up 4 dropdown lists, write 4 fexes, you'll populate your 4 lists with dynamic not static, and with procedure , not data source. ok so far? Say your parms are &level1, &level2, &level3, &level4 and you have a file (or you make one) containing a field called LEVEL and the values in LEVEL are NONE, CAR, COUNTRY, MODEL then your first fex is TABLE FILE myfile PRINT LEVEL ON TABLE PCHOLD END ..and you get your list of 4 then your 2nd fex is -DEFAULT &level1 = ' '; TABLE FILE myfile PRINT LEVEL IF LEVEL NE &level1 ON TABLE PCHOLD END ... and your 3rd fex is -DEFAULT &level1 = ' '; -DEFAULT &level2 = ' '; TABLE FILE myfile PRINT LEVEL IF LEVEL NE &level1 IF LEVEL NE &level2 ON TABLE PCHOLD END ... ok so far? now you write the 4th fex.... ... now chain them, using the chain tool now here's the trick, in 7.6.8, you then have to open the html code and change 'cacheruntimedata=1' to 'cachruntimedata=0' and you do that 4 times for each of the 4 parameter names.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Thank you for the steps. I'm willing to give it a try, but would like to know how I can create the table containing the field values for Level. Those Items are the names of the field and are not data, so I can't create it with a Print statement since I don't have a table containing that information to start with or am I missing something.
Thank you for the code to create the field names as data for the level prompts. I got that part working, but haven't been able to get the html composer part working. I get an error (FOC205) The description cannot be found for file named: levellist. When I look at the Properties and settings of the comboboxes, the code I typed (from your earlier example) is gone. When I set up initially, I clicked on the Parameters Tab at the bottom of HTML Composer, then I right clicked on combobox1 and chose properties and settings. Then I clicked on External Procedure and in the big text area typed in your code (modifying it for my actual information). I left all the other fields as they were except I deleted the information in the text box between External Procedure and Value field. Value field and Display field were blank already. I didn't see an ok box so I clicked on the X in the right corner to close the window. I did similar for the other comboboxes, then saved the file.
you want to put the code in a .fex in your app or in your domain, you don't want it in the html page. you point to the fexname, you don't type in the code. you want your dropdown fexes to be on the default path of that domain. are you in MRE or are you on the backend writing something in the apps directory?
i don't know anything about a big text area when you pick 'external procedure'...if that's something in 7.7, i've got a headache.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
I appreciate your help on this. I created the fex files and then chose them in the properties window. It automatically filled in the big text area with the code from the fex. Now it shows the field names in the drop down without the error message. I thought I had them chained, but must still be missing something because it is not reducing the choices and I could not locate the cacheruntimedata=1 in the html (I assume you meant to click on the tab that says html). There is an option in the properties window for Cache run time data. I left that unchecked hoping that would be the same as changing it to 0 in the html if I could find it.
I'm not sure you can use chaining to reduce the number of values in a dropdown box based on prior selections quite like you require.
For example, you would be able to chain Country, State, City dropdown boxes: select a Country - only States in that Country will be shown; select a State - only Cities in that State would be shown.
In your scenario, you would like to eliminate previously selected values - I don't think there's a GUI, automated way of doing this with HTML Composer.
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
HTML Composer is not an intuitive GUI tool. (There, I've said it).
It doesn't seem to be suggested in the documentation, but I recently learned that you should write the report fex BEFORE creating a GUI HTML Composer launch page.
In Dev Studio Report Painter, there is an option to parameterize report columns. You put report columns in the report. Then you select one or more column and you select an option in the wide dropdown box that has two values "One variable for each selected column" and "One variable for all selected columns". (Documented in Creating Reports With Report Painter > Creating Guided Reports".) This replaces the previously selected column names by Dialogue Manager variables, including possible values.
Then you create a new HTML Composer page. I don't know if I'm doing the next step correctly (because annoying things happen - a second Reset button is added, the form objects are at the bottom of the form... annoying), but I add a new form. Then I select the Run button and add a hyperlink to point to the previously created fex. You get the option to create controls that are in the fex - select yes.
In my example below, I chained the three column dropdown boxes, but I cannot make them react the way you'd like - none of the obscure-looking chaining options suggests what you want is possible.
I have included code here. Create these two files in your baseapp application folder. Run the HTML file.
-* File fpsxschech1.fex
-SET &ECHO='ALL';
TABLE FILE CAR
SUM
CAR.BODY.SEATS
BY LOWEST &RP_FL01B01_Sort1.(<COUNTRY,CAR.ORIGIN.COUNTRY>,<CAR,CAR.COMP.CAR>,<MODEL,CAR.CARREC.MODEL>,<None,_FOC_NULL>).Please select sort field(s).
BY LOWEST &RP_FL02B02_Sort2.(<COUNTRY,CAR.ORIGIN.COUNTRY>,<CAR,CAR.COMP.CAR>,<MODEL,CAR.CARREC.MODEL>,<None,_FOC_NULL>).Please select sort field(s).
BY LOWEST &RP_FL03B03_Sort3.(<COUNTRY,CAR.ORIGIN.COUNTRY>,<CAR,CAR.COMP.CAR>,<MODEL,CAR.CARREC.MODEL>,<None,_FOC_NULL>).Please select sort field(s).
ON TABLE SET ONFIELD IGNORE
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END
One can write custom JavaScript to do this, I'm not sure you want to go that route.
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
Thank you for taking a look at this and providing the code. Since it seems chaining may not work for this situation, maybe I'll need to add a bunch of If statements to ignore the sort fields if it has previously been chosen so that I don't get the field multiple times as is the case now if user selects the same field in more than one box.
I'm hoping someone smarter than me can take the sample code and make the chaining work like you require. Your requirement seems a reasonable expectation of the GUI.
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
Designing a User Interface for a Web Application With the HTML Composer > Chaining Controls for Dependencies in the HTML Composer > Applying Conditions to a Chain
I cannot understand this documentation...
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
Ok, taking the lead that Susannah and Francis began.
Create a new procedure and call it sxschech_combo and place the following code within it. It is basically Susannah's fex but modified slightly. It defaults 3 variables &Level1, &Level2 and &Level3. The example won't use &Level3 but it is there to whet the taste buds. The fex will build a dynamic dataset and report from it to an XML output. The selection will be restricted by the value of the 3 variables.
-* File sxschech_combo.fex
-SET &ECHO = ALL;
-DEFAULT &Level1 = 'FOC_NONE'
-DEFAULT &Level2 = 'FOC_NONE'
-DEFAULT &Level3 = 'FOC_NONE'
FILEDEF myfilemas DISK myfile.mas
FILEDEF myfile DISK myfile.TXT
-RUN
-WRITE myfilemas FILENAME=myfile, SUFFIX=FIX , $
-WRITE myfilemas SEGMENT=myfile, SEGTYPE=S0, $
-WRITE myfilemas FIELDNAME=LEVEL, ALIAS=LEVEL, USAGE=A8, ACTUAL=A8, $
-WRITE myfile NONE
-WRITE myfile CAR
-WRITE myfile COUNTRY
-WRITE myfile MODEL
-RUN
TABLEF FILE myfile
SUM FST.LEVEL
BY LEVEL
WHERE LEVEL NE '&Level1'
WHERE LEVEL NE '&Level2'
WHERE LEVEL NE '&Level3'
ON TABLE PCHOLD FORMAT XML
END
Now create a new HTML page using composer. Place a single combo onto the page (I'm not going to teach you how to do the rest). Go to properties and change the NAME attribute to Level1.
Now click on the parameters tab. Select the new Level1 icon and right click choosing properties and settings. Select dynamic data type and external procedure. Click on the ellipsis "..." button and navigate to the fex created above. Enter the value and display values as LEVEL (for some reason these do not get populated automatically - probably because of the fex content!).
Next, create another 2 combos and follow the same procedure above except change the NAME attribute to Level2 and Level3.
Select the design tab and select the first combo (named Level1). Hold the control key and subsequently click Levl2 combo and then Levle3 combo. This is the chaining process (one of a few methods).
I had a glitch at this stage because the control didn't work the way I expected. I had to go to the HTML and change the values for "resolveparameterfq" and "resolveparameter" from LEVEL to Level1 for the second combo and to Level2 for the third combo.
When run, the second and third combos are affected by what is selected in the previous combo(s) such that if you select CAR in the first, only NONE, COUNTRY and MODEL are shown in the second combo, and if you then select COUNTRY n the second combo, only NONE and MODEL are shown in the third combo. You can see that if you add a fourth combo and apply the same external procedure he variable &Level3 will come into play.
Now I know that this doesn't completely give you your ultimate goal but it must surely give you enough knowledge to be going on with.
T
Had to edit it a few times because the speel chucker was on holiday
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 followed your steps as best I could. Here is the result. Before modifying the HTLM, I ran to see what would happen. The combo boxes populated and when I clicked on the first box, all the others changed to that value, I assume that is the glitch you mentioned. Next I went into the html and changed the LEVEL in the resolveparameterfq and resolveparameter to LEVEL1, 2 and 3 respectively. After doing that I reran and all the drop down boxes show everything, so I must have missed a step or didn't modify the html correctly.
First the good news...That worked. I also needed to modify this part of ComboFex because I wanted the default option to be NONE and have NONE available in any combo box regardless.
WHERE LEVEL NE '&Sort1' OR LEVEL EQ 'NONE' WHERE LEVEL NE '&Sort2' OR LEVEL EQ 'NONE' WHERE LEVEL NE '&Sort3' OR LEVEL EQ 'NONE'
Now the issue is how to get the results of the combo to run the report. I tried adding a button, but don't know how to relate the drop down boxes to the report. I also tried creating a new report and doing the insert report which brought in the list boxes from the fex and automatically created the chain. Then I changed these list boxes to look at ComboFex and the other steps you outlined previously. However, I could not locate the "resolve" in the html. The result is it is not filtering down.
WHERE LEVEL NE '&Sort1' OR LEVEL EQ 'NONE' WHERE LEVEL NE '&Sort2' OR LEVEL EQ 'NONE' WHERE LEVEL NE '&Sort3' OR LEVEL EQ 'NONE'
There is, perhaps, a more convenient (better?) way of doing this and that would be to add the ALL option to each of the combos with the text to be display as NONE. Then remove the -WRITE myfile NONE from the fex (plus your additions).
The all option is always displayed as the first line which I had achieved by using TABLEF instead of TABLE.
Apologies if my previous comment sounds a bit harsh, but I just feel a structured training course would benefit you more. The main advantage would be learning the GUI - which many will confirm, is not an area I tread very often
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
After spending some of Friday and a good part of today, looking at various links etc, the good news is I finally got the chaining to work, at least in testing. The tricky things were figuring out how to manually create the parameters and get them bound -- drag parameter out of unbound box and then drag drop down box onto parameter and it then shows an arrow. When I tried this last week, it didn't work because when I was reading, I only saw them mention to drag the dropdown box onto the parameter, I didn't see it say to move the parameter out of the unbound box first. The other hard part was locating the resolve. Seems when I did ctrl+F to find resolve, the cursor would go back to the top of the document and I'd have to scroll down to locate the highlighted item. Sometimes I still couldn't see it, so I copied and pasted the entire html code into a text editor and searched/replaced there and then copy pasted back into the html tab of HTML Composer. Hope I'm not doing damage to the code by using this method for editing.
Another question, if I may. If I want to give the user the option to type in a value that is not listed in the drop down box (as if it were a text box), can this be done? Reason is that I will provide a set list of values in the combofex file, but for some "power users" they may want to see a particular field that a regular user doesn't need to see (or know about) and also because I'd rather not have to maintain a bigger list than necessary.