Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Pass NO_SELECTION From HTML ListBox To FEX

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Pass NO_SELECTION From HTML ListBox To FEX
 Login/Join
 
Guru
posted
Hi,

I'm creating a structured ad-hoc reporting application. For my verb objects and sort objects I am using the double-list control on the html page. It is possible that a user may not want to select any sort objects. In this case the right-side of the double-list box will be empty and it will pass nothing to the fex. I'm not sure if it's passing NULL or an empty string. All I know is that is shows up blank when I execute
-? &
. That's okay because my fex defaults the value of &SORTOBJ to 'NO_SELECTION'. From there I evaluate the variable further and do other stuff with it. If &SORTOBJ EQ 'NO_SELECTION' do some stuff...

For the ACROSS object I am limiting the user to one selection for the time being so my options are to use a drop-down box or a listbox that does not allow multiple selection. There are too many choices for radio buttons or checkboxes.

The problem with these controls is that the first item in the list is selected by default. For example, in my test application I am dynamically populating the list with the fieldnames from the car file. Therefore the first item in the list (AND selected) is ACCEL. What if the user doesn't want to select anything from that particular listbox? DevStudio gives me the option to add an ALL selection item which passes FOC_NONE to the fex. That's fine if the AmperVariable is going to be used in a WHERE clause or some other line of code that won't break the rest of the procedure if it goes away. However, you can't evaluate FOC_NONE because the parser removes the very line that contains it!

What I really want to do is pass the opposite of an ALL selection and pass a NONE selection. Any ideas on how to do that? Or to modify the listbox or dropdown box so the first item listed is not automatically selected? Another option would be to prepend the NO_SELECTION option to the beginning of the list that populates the dropdown/listbox. Either way, I'm not sure how to accomplish any of these.

Thanks!

Dan Pinault

This message has been edited. Last edited by: Dan Pinault,


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
 
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007Report This Post
Virtuoso
posted Hide Post
Dan,

You can probably prepend the listbox with a -WRITE command:
  
FILEDEF MYLIST DISK MYLIST.FTM (APPEND
-RUN
-WRITE MYLIST NO_SELECTION
-RUN
TABLE FILE some_file
PRINT some_field
ON TABLE SAVE AS MYLIST
END
-RUN


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Expert
posted Hide Post
To build on what Danny said, you can use a procedure to populate the box. But there must be two fields in the output, the display and the value, and the output line must be ON TABLE PCHOLD FORMAT XML. Use the MORE command, i.e. Universal Concatenation, to put the two files together.

There are lots of posts on this process.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Dan Pinault:
. . .
However, you can't evaluate FOC_NONE because the parser removes the very line that contains it!


No. Parsing of a Focexec happens in two stages -- a Dialog Manager scan (that perform &var substitutions on lines of Focus code and executes the dialog manager lines identified by the leading hyphen), and a Focus execution stage that interprets the Focus code stacked by D.M.

The Dialog Manager scan can "see" the FOC_NONE value and act on it. For example, it can test
-IF (&SORTOBJ EQ 'FOC_NONE') THEN GOTO ... ;
or
-SET &SWITCH = IF (&SORTOBJ EQ 'FOC_NONE') THEN 'something special' ELSE 'the usual' ;

When D.M. is finished scanning a line of Focus code (in the process replacing amper variable references with their current values), it releases the resolved line to go into Focstack. At that point a filter process steps in and discards the line if it contains "FOC_NONE", so when Focstack gets executed the line of code is absent.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Guru
posted Hide Post
Hey this is great stuff, thanks!

Danny / Ginny - I'm glad to see my thinking was on the right track. Last night I was trying to figure out how to use the MORE command to add the additional row(s) of data to the listbox.

Jack - Thanks for the explanation of how Dialog Manager handles the FOC_NONE value. Based on what you say here I should be able to change the display text for the ALL option to NO_SELECTION and then evaluate my variable based on the value of FOC_NONE.

I'll try these and post what ends up working.

Regards,

Dan


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
 
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007Report This Post
Guru
posted Hide Post
OK - Here is what I did to get this to work...

In the HTML Composer I checked the box to add the "ALL" option and I changed the display text to "No Selection". This then becomes the initially selected value. If the user makes no selection the HTML page passes FOC_NONE to the procedure.

Then, in the procedure I have the following...
-SET &ECHO = ALL;

-DEFAULT &VERB = 'SUM'
-DEFAULT &VERBLIST = 'NO_SELECTION'
-DEFAULT &SORTLIST = 'NO_SELECTION'
-DEFAULT &FOOTTXT = 'Copyright 2009 - Power Systems Research - www.powersys.com - info@powersys.com - +1 651 905 8400'
-DEFAULT &WFFMT = 'HTML'
-DEFAULT &BYDISP = 'NO'
-DEFAULT &COLTOT = 'NO'

-SET &VERB = IF (&VERB EQ 'PRINT') THEN ('PRINT') ELSE ('SUM');
-SET &VERBOBJ1 = IF (&VERBLIST EQ 'NO_SELECTION') THEN ('NO_SELECTION') ELSE STRREP(&VERBLIST.LENGTH, &VERBLIST, 1, '''', 0, 'x', &VERBLIST.LENGTH, A&VERBLIST.LENGTH);
-SET &VERBOBJ  = IF (&VERBOBJ1 EQ 'NO_SELECTION') THEN ('*') ELSE STRREP(&VERBOBJ1.LENGTH, &VERBOBJ1, 3,' OR', 0, 'x', &VERBOBJ1.LENGTH, A&VERBOBJ1.LENGTH);
-SET &SORTOBJ1 = IF (&SORTLIST EQ 'NO_SELECTION') THEN ('NO_SELECTION') ELSE STRREP(&SORTLIST.LENGTH, &SORTLIST, 1, '''', 0, 'x', &SORTLIST.LENGTH, A&SORTLIST.LENGTH);
-SET &SORTOBJ  = IF (&SORTOBJ1 EQ 'NO_SELECTION') THEN ('') ELSE 'BY ' | STRREP(&SORTOBJ1.LENGTH, &SORTOBJ1, 2, 'OR', 2, 'BY', &SORTOBJ1.LENGTH, A&SORTOBJ1.LENGTH);
-SET &ACROSSVAL = IF (&ACROSSLIST EQ FOC_NONE) THEN ('NO_SELECTION') ELSE &ACROSSLIST;

-* //Use next two lines if allowing multiple selections for the ACROSS value//
-*SET &ACROSSOBJ1 = IF (&ACROSSVAL EQ 'NO_SELECTION') THEN ('NO_SELECTION') ELSE (STRREP(&ACROSSVAL.LENGTH, &ACROSSVAL.QUOTEDSTRING, 1, '''', 0, 'x', &ACROSSVAL.LENGTH, A&ACROSSVAL.LENGTH));
-*SET &ACROSSOBJ  = IF (&ACROSSOBJ1 EQ 'NO_SELECTION') THEN ('') ELSE ('ACROSS ' | STRREP(&ACROSSOBJ1.LENGTH, &ACROSSOBJ1.QUOTEDSTRING, 2, 'OR', 6, 'ACROSS', &ACROSSOBJ1.LENGTH, A&ACROSSOBJ1.LENGTH));

-* //Use next one line if limiting ACROSS value to one selection//
-SET &ACROSSOBJ = IF (&ACROSSVAL EQ 'NO_SELECTION') THEN ('') ELSE ('ACROSS ' | &ACROSSVAL);

-SET &BYDISP = IF (&BYDISP EQ 'YES') THEN ('') ELSE ('-*');
-SET &COLTOT = IF (&COLTOT EQ 'YES') THEN ('') ELSE ('-*');

TABLE FILE CAR
&VERB
&VERBOBJ
&SORTOBJ
&ACROSSOBJ
HEADING
"&HEADTXT"
FOOTING
"&FOOTTXT"
ON TABLE PCHOLD FORMAT &WFFMT
&BYDISP.EVAL ON TABLE SET BYDISPLAY ON
&COLTOT.EVAL ON TABLE COLUMN-TOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
     SUMMARY='&RPTTITLE',
     TITLETEXT='&RPTTITLE',
$
ENDSTYLE
END

-? &


Thanks again everybody Smiler


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
 
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Pass NO_SELECTION From HTML ListBox To FEX

Copyright © 1996-2020 Information Builders