Focal Point
[SOLVED] Display different variable options for -DEFAULT

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3447019096

November 08, 2018, 01:45 PM
ratios
[SOLVED] Display different variable options for -DEFAULT
Hi Fellow Focusers,

Wondering how to display different variable options for -DEFAULT in the 8202 version. Please see screenshot from IBI video. I would like to know the procedure (fex) code to display options like the Store Type. Thanks for any help.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS App Studio 8202M
Windows, All Outputs
November 08, 2018, 01:51 PM
BabakNYC
This is a feature called Page Designer. When you place a fex with parameters inside a page it'll create these controls for you automatically. By default they're all drop down boxes but you can right click and change them.


WebFOCUS 8206, Unix, Windows
November 08, 2018, 01:54 PM
ratios
Thanks BabaNYC, that much I know. I am creating using the Page designer. I would like to know what code brings those options up in the Page Designer OR how do I do it in the GUI (then I can look at the code it produces)


WebFOCUS App Studio 8202M
Windows, All Outputs
November 08, 2018, 01:56 PM
BabakNYC
In the GUI, you let Page Designer create all the drop downs and right click and convert. The choices are Radio Buttons or Button Set. I'm not sure what code is generated in the background though.


WebFOCUS 8206, Unix, Windows
November 08, 2018, 02:13 PM
ratios
quote:
choices are Radio Buttons or Button Set

Hmmm I'm trying but not seeing those choices. Anyone has a CAR FILE example with options like this?


WebFOCUS App Studio 8202M
Windows, All Outputs
November 08, 2018, 02:18 PM
MartinY
quote:
I would like to know the procedure (fex) code to display options like the Store Type

The displayed values are probably coming from a distinct list on possible value within the StoreType field.

As per example using
TABLE FILE CAR
BY COUNTRY
ON TABLE PCHOLD FORMAT XML
END
-RUN

Is giving you all possible Country values that you can then use to have your control populate with.
You then set the control type as you wish : drop down, list box, radio, ...

Is that what you're looking for


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
November 08, 2018, 02:18 PM
BabakNYC
Maybe this is an 8203 feature. I don't think the data makes a difference.


WebFOCUS 8206, Unix, Windows
November 08, 2018, 02:27 PM
ratios
quote:
The displayed values are probably coming from a distinct list on possible value within the StoreType field.

I have a feeling you are right about this one. I believe it should be an 8202 feature because that the version I found the video under. If I cannot solve it, I will let the users type in textbox 1 of 3 options. Its not ideal but it works.


WebFOCUS App Studio 8202M
Windows, All Outputs
November 08, 2018, 04:25 PM
MartinY
quote:
I have a feeling you are right about this one. I believe it should be an 8202 feature because that the version I found the video under. If I cannot solve it, I will let the users type in textbox 1 of 3 options

Create your own choice list.
It doesn't have to come from an existing data table.
You can build any list you want.
Don't let user type what ever they want. If you can provide specific choices, do it. That way you'll be able to control what they select.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
November 08, 2018, 06:21 PM
Hallway
Below is an example fex on the WF_Retail master file that will bring in the controls that you have showing in your picture dynamically from the master file. I also added in my own parameter (&MYLIST) with hard coded options that will display to the end user but the values are stored in the parameter.

Once the controls are created in the page designer as drop-downs, just right-click on the drop-down and select convert to change to a radio or push button control. In that right click menu, there is also a settings choice that will allow you to modify the control (like adding in an 'ALL' option).
  
-DEFAULT &MYLIST = VALUE2;
-SET &MYLIST = &MYLIST.(<DISPLAY1,VALUE1>,<DISPLAY2,VALUE2>,<DISPLAY3,VALUE3>).Choose One.;

TABLE FILE wf_retail
SUM REVENUE_US
BY BUSINESS_REGION
BY PRODUCT_CATEGORY
BY STORE_TYPE
BY TIME_DATE
WHERE BUSINESS_REGION EQ &BUSINESS_REGION.(OR(FIND BUSINESS_REGION IN WF_RETAIL |FORMAT=A15V)).Region:.QUOTEDSTRING;
WHERE PRODUCT_CATEGORY EQ &PRODUCT_CATEGORY.(OR(FIND PRODUCT_CATEGORY IN WF_RETAIL |FORMAT=A40V)).Category:.QUOTEDSTRING;
WHERE STORE_TYPE EQ &STORE_TYPE.(FIND STORE_TYPE IN WF_RETAIL |FORMAT=A11V).Store Type:.QUOTEDSTRING;
WHERE TIME_DATE FROM &FROM_DATE.(|FORMAT=YYMD).From:.QUOTEDSTRING TO &TO_DATE.(|FORMAT=YYMD).To:.QUOTEDSTRING;
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
TYPE=REPORT,GRID=OFF, LINES-PER-PAGE=UNLIMITED,  $
ENDSTYLE
END
-RUN



Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
November 14, 2018, 11:12 AM
ratios
Thanks everyone! I figured it out!! Smiler

I created a table/synonym with my options and tied it into my fex WHERE statement. That gave me the dropdown option in the Page Builder GUI. It doesn't look like the picture I uploaded above with the 3 options side by side (that may be version 8203) but the dropdown option is perfect as users wont have to type anything in.


WebFOCUS App Studio 8202M
Windows, All Outputs