Focal Point
[SOLVED] Dynamic Parameter Name

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

August 18, 2017, 10:03 AM
evan.brown
[SOLVED] Dynamic Parameter Name
I have multiple charts on a html page, and a single fex I do an -INCLUDE on each chart to set my parameters for the chart in focus at runtime.

When I add the first chart to my page (GUI), I'm prompted to create controls for my chart. Then, when I go to add my next chart, I want a separate set of controls that will only change the chart above it. But, because my parameters are the same name (single fex with parameters), I don't get prompted to add these new controls.

One way I've thought of doing this is naming my parameters dynamically like below, but I can't get it to work:

-SET &ECHO=ALL;
-DEFAULT &CHT='_CHT_A'

-SET &SORTORD|&CHT='INVERT';

I want the line above to read:

-SET &SORTORD_CHT_A='INVERT';

Can anyone assist in what I need to do? I feel it's obvious, but I'm still missing it...Thanks!

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


WF 8.0.08 (Prod); WF 8.2.06 (Dev)
August 18, 2017, 10:21 AM
MartinY
A dynamic parameter as you stated (-SET &SORTORD|&CHT) can only exist at run time. So it is "normal" that the GUI is not aware if its existence.

I'm wondering one thing : why would you like to include several charts on a same HTML page of they all have different update parameters ?
It's going to be a nightmare to associate the proper parameter with the proper chart : and I'm not talking of programming side but user side.
They will have to figure that if they change param-1 it will update chat-1, param-2 for charts-2 and param-3 for chart-1 and chart-2 ?
It may be your need, but I found it confusing.

As far as I can know without doing a lot of research, you will need to have distinct parameter per chart.

Or a thing that you can do is to keep the unique parameter's name in the charts but have your main fex with the distinct one.

-* Main fex to call chart A and receive parameters from HTML
-* -------------------------------------
-SET &ECHO=ALL;
-DEFAULTH &SORTORD = ''
-DEFAULT &SORTORD_CHT_A = 'INVERT'

-SET &SORTORD = &SORTORD_CHT_A;
-INCLUDE app/CHART_A.fex


-* Main fex to call chart B and receive parameters from HTML
-* -------------------------------------
-SET &ECHO=ALL;
-DEFAULTH &SORTORD = ''
-DEFAULT &SORTORD_CHT_B = 'REGULAR'

-SET &SORTORD = &SORTORD_CHT_B;
-INCLUDE app/CHART_B.fex

Having the main 2 fex in your HTML should then popup for distinct parameters but your charts keep unique one.
Do not reference the charts in your HTML, but the above fex.


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
August 18, 2017, 10:37 AM
evan.brown
That makes sense. I'll give that a shot. Thanks!


WF 8.0.08 (Prod); WF 8.2.06 (Dev)
August 29, 2017, 03:28 AM
Dave
You can use a . ( period ) for that.

-SET &A = 1;
-SET &PARAM.&A = 'this is a';

-SET &A = 2;
-SET &PARAM.&A = 'this is b';


-SET &A = 1;
-TYPE &PARAM.&A
-SET &A = 2;
-TYPE &PARAM.&A



_____________________
WF: 8.0.0.9 > going 8.2.0.5
August 29, 2017, 08:35 AM
evan.brown
Perfect! Thanks!


WF 8.0.08 (Prod); WF 8.2.06 (Dev)
August 29, 2017, 09:51 AM
j.gross
Instead of dynamic naming, for simplicity and clarity I would prefer to create a driver fex for each of the respective charts on the page, with distinct parameters.



In the common charting fex, adjust the -DEFAULT/-DEFAULTH directives so they won't trigger creation of controls for its parameters.

And let nature take its course.


- Jack Gross
WF through 8.1.05
August 29, 2017, 10:19 AM
evan.brown
I've actually done something along these lines...thanks.


WF 8.0.08 (Prod); WF 8.2.06 (Dev)