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     Traversing a Multi-select selection list

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Traversing a Multi-select selection list
 Login/Join
 
Member
posted
I've been reviewing the messages in Focal Point looking for insight into a problem I'm trying to solve, and I'm hitting a brick wall. Hopefully someone can help.

The task: write in a Header, the list of selected values from a multi-select drop down list built in RLP, in the form of selection1, selection2, selection3 ...

I'm been trying to get to the, I would call it an array, in which the selections are stored behind the scenes but without success.

As I am understanding this, the syntax:
WHERE ( COUNTRY EQ &COUNTRY.(OR(FIND COUNTRY IN CAR)).Select COUNTRY. );
creates a list of ampervariables from &COUNTRY0 (in which the count of selected values is stored), to &COUNTRY (which has the complete list of values to be passed to the database as the OR-ed query [ WHERE 'A' OR 'B' OR 'C' ]) to &COUNTRY1 which has the first selected value, to &COUNTRY2 which has the second selected value, and so on.

Or is my understanding incorrect?

I had hoped to loop through the &variables[count] to &COUNTRY0, concatenating the values into a new, Header-ready variable to print out, but I can't "see" the ampervariables WF creates. Nothing in -TYPE, -SET, ? &.

I can parse through the OR statement found in &COUNTRY.EVAL to do what I need to do, but that's rather inelegant compared to traversing a list.

We're running 5.3.5 now, and upgrading to 7.3 in the near future. I see where there are issues with this in the newer version but I would like to get this working in what we have now and deal with the other, later.

Thanks.


WebFocus 7.1.4 Win2K Client

WebFocus 7.1.6 Server
 
Posts: 22 | Location: san antonio texas | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
So the bottom line is ...you want what ever the person picks in the Multi-select..to print in the Heading?


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Member
posted Hide Post
Yes.


WebFocus 7.1.4 Win2K Client

WebFocus 7.1.6 Server
 
Posts: 22 | Location: san antonio texas | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
I'm not an expert on multi-select, but if an amper variable is created, it's name can always be put in the heading by putting &VARIABLENAME
in the heading has been my experience. However, as I say, haven't done a lot of multi-selections. Will have to see if one of my playing with Dev Studio used that form.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Member
posted Hide Post
Thanks, Leah.

I found the Java code that runs behind the HTML, and it looks like the @variable comes from the ProcessMultiSelect function there. I don't think the individual selections will be available to the FEX in any form other than the result string that comes from that function.

Parsing the string for the components will probably be the best, if not only, way to go.

Thanks again.


WebFocus 7.1.4 Win2K Client

WebFocus 7.1.6 Server
 
Posts: 22 | Location: san antonio texas | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
When you create your multi select you should give it a "name" attribute. This will be the variable name once it gets to WebFOCUS. When you execute a web form with your multi select a value for each selected value will get passed in the resultant URL. The servlet, cgi prog etc will take those values and create a kind of array from them (not an actual array but see below).

For instance, say your multi select has the name "Country", and you select 3 values (call them ENGLAND, FRANCE and GERMANY) before submitting your form. The process of form submission will create the URL from the action string followed by something like this

.....&Country=ENGLAND&Country=FRANCE&Country=GERMANY&......

WebFOCUS interprets them and produces several variables from them.

Pre version 7 you would have access to the following -

&Country = ENGLAND
&Country0 = 3
&Country1 = ENGLAND
&Country2 = FRANCE
&Country3 = GERMANY

Early version 7 you will only get -

&Country0 = 3
&Country1 = ENGLAND
&Country2 = FRANCE
&Country3 = GERMANY

Now combine that knowledge with other details from this forum (there are so manyand I don't want to repeat them) and you should be able to get your heading the way you want.

Good luck

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, 2004Report This Post
Member
posted Hide Post
Thanks for the response, Tony. Yours was the thread that got me interested in trying this, but we've got some confused developers sitting around the screen at the moment.

I see what you are saying, but this is my FEX and then the results. Not given here is the HTML created by WF in Resource Layout (highlighting the fex and right-clicking Edit in Resource Layout and letting WF create the page, just to be specific). The Heading is just to display the multi-select results.

TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
WHERE ( COUNTRY EQ &SELCOUNTRY.(OR(FIND COUNTRY IN COUNTRY)).COUNTRY. );

HEADING
" &SELCOUNTRY"

ON TABLE HOLD
END
-? &

Selecting 3 countries gives this result:

CURRENTLY DEFINED & VARIABLES:
&&APP_PERMIT = ALL
&&CLIENTOFFSE>=
&&CLIENTOFFSE>=
&&CLIENTTIMEZ>=
&&CLIENTTIMEZ>=
&&EDAAPP = APP-ENABLED
&&EDACONF = D:\ibi\srv53\wfs
&&OSTYPE = WINNT
&&SRVTYPE = PTH
&ACCEPTS = 0
&APPROOT = D:\ibi\apps
&AUTOINDEX = NO
&BASEIO = 0
&CHNGD = 0
&DATE = 08/21/06
&DBMSERR = 0
&DELTD = 0
&DMY = 210806
&DMYY = 21082006
&DUPLS = 0
&ECHO = OFF
&EXITRC = 0
&FOCEXURL = /ibi_apps/WFServlet?IBIF_webapp=/ibi_apps&IBIC_server=EDASERV
&FOCFOCEXEC = _car_test
&FOCHTMLURL = /ibi_html
&FOCINCLUDE = car_test
&FOCNEXTPAGE = 0
&FOCREL = R720535B
&FORMAT = 0
&IBIMR_user =
&INDEXIO = 0
&INPUT = 0
&INVALID = 0
&IORETURN = 0
&LINES = 0
&MDY = 082106
&MDYY = 08212006
&NOMATCH = 0
&READS = 0
&RECORDS = 0
&REJECTS = 0
&REMOTE_ADDR = 10.206.60.6
&RETCODE = 0
&SELCOUNTRY = 'ENGLAND' OR 'FRANCE' OR 'ITALY'
&SETFILE =
&SORTIO = 0
&TOD = 16.27.19
&TRANS = 0
&VSP_CLIENTID = 10.206.60.6
&VSP_CLIENTIP = 10.206.60.6
&VSP_MREUSRID =
&VSP_SERVNAME = WEBFSAHQD1
&VSP_WHATSYS = Self Service
&WFDESCRIBE = XMLRUN
&YMD = 060821
&YYMD = 20060821
&button2 = Submit
0 NUMBER OF RECORDS IN TABLE= 9 LINES= 9

We never see a &SELCOUNTRY0, &SELCOUNTRY1 or any other flavor of it, and that is what has us puzzled.

I wonder if this is apples and oranges in how you are creating and implementing and how I am.


WebFocus 7.1.4 Win2K Client

WebFocus 7.1.6 Server
 
Posts: 22 | Location: san antonio texas | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
Ok, seeing the variable listing tells me how your HTML is constructed.

One of the IBI attributes for a multi select is "operation" and it is normally set to "NONE". However, you can change this to "OR" or "AND" to give you alternative variables. Yours must be set to "OR" which gives you a single variable with all selected options included in a compound "OR" statement.

Using that variable must give you the heading you want right? If not what do you want the heading to show?

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, 2004Report This Post
Member
posted Hide Post
Using the "OR" gives us the select statement in the WHERE clause we want, so the users can select which "countries" they want to have in the report. The heading is secondary. Seeing the earlier discussions about the ampervariables led me to pursue them as a alternate way (to parsing the returned statement with "OR"'s) to build the heading, but I could not figure out where the alternative variables as you call them, were.

I can now see from the complete help file that the multi-select values are being built, whereas with Resource Layout building the HTM and the multi-select, they are being assigned back, if you will. The array-like variables are not there and to build the heading I want, I will have to parse the ampervariable containing the "ORS".

That's the question I needed answered.

Thanks.


WebFocus 7.1.4 Win2K Client

WebFocus 7.1.6 Server
 
Posts: 22 | Location: san antonio texas | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
Well done for figuring out the additional attributes and getting your WHERE clause to use the compound variable! ... and finding out there is always a downside to possible advantages!Wink

This is another example of the grey areas that people encounter of "Where does WebFOCUS end (or start in this case) and the other application s/w begin.

To help make this situation clearer for anyone who is still is a quandry, any web browser used to execute a form will always supply one value for each selection in a multi select (as in my previous post). We have WebFOCUS to thank for rearranging those multiple values into something a little easier to use. If you were to use ASP to perform a similar function you would have to parse the URL string and establish how many values there were.
So the web browser supplies one value for each selected option in a multi select.
WebFOCUS arranges those values according to the attribute sets applicable to that multi select.

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, 2004Report 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     Traversing a Multi-select selection list

Copyright © 1996-2020 Information Builders