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     passing parameters from multi select list box

Read-Only Read-Only Topic
Go
Search
Notify
Tools
passing parameters from multi select list box
 Login/Join
 
<delvegas>
posted
hi guys

I dont know how to pass multi selected values to a procedure.fex -- help me guys

Let say that i got
A
B
C
D
E
in multi select list box.
So i selected A B C and when i clicked "Submit" button all 3 values which i have selected should be passed to a procedure.fex

Iam able to call procedure.fex but not able to play around with these 3 selected values in procedure.fex

<SELECT NAME="TestRequest" SIZE="10" MULTIPLE><!--WEBFOCUS TABLE DYNAMLST> </SELECT>
-- by using this i will display values in Multiselect list box.

If iam not wrong, when we select 3 values, those 3 values will be referred as "TestRequest1/2/3" --right..?

I should be able to access TestRequest1/2/3 in Procedure.fex program.

suggest me guys.
Can anybody send me the code for the above situation.

delvee
 
Report This Post
Expert
posted Hide Post
del, first you gotta stop posting your questions as POLLS. Its making us crazy.. Big Grin
From a multiselect,
you'll have 3 variables
&TESTREQUEST1
&TESTREQUEST2
&TESTREQUEST3
and the cool unique to multi-drills,
&TESTREQUEST0 which is the number selected, in this case , 3.

Now you should be able to handle all these vars in your fex. knock yourself out.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
<delvegas>
posted
hi susan,
function onload2(form)
{
document.form.IBIF_ex.value="app/mult.fex";
document.form.IBIMR_fex.value="app/mult.fex";
}

-SELECT NAME="COUNTRY" SIZE="10" MULTIPLE><!--WEBFOCUS TABLE DYNAMLST> -/SELECT-
-INPUT TYPE="SUBMIT" VALUE="" onclk="onload2(form)"-

When i select 5 countries which are displayed in multi select list box. and click submit button.. Onclick even will call multi.fex program. which will pass all parameters to this Fex prg.

Here is Fex prg;-
-SET &COUNTER=1;
TABLE FILE SHORT
SUM PROJECTED_RETURN
BY COUNTRY
-IF &COUNTRY.EXISTS THEN GOTO LOOP1 ELSE GOTO DONE;
-LOOP1
WHERE COUNTRY EQ '&COUNTRY&COUNTER'
-IF &COUNTRY.EXISTS NE 1 THEN GOTO OUTLOOP;
-REPEAT OUTLOOP FOR &COUNTER FROM 1 TO &COUNTRY0
OR '&COUNTRY.&COUNTER';
-OUTLOOP
-DONE
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF,$
TYPE=DATA, COLUMN=N1, COLOR=RED, $
ENDSTYLE
END

It actually prompts for value. which it shouldn't do, it should take directly from parameters, "&Country0".

Iam un able to figure out the problem.

thanks in advance
delvee
 
Report This Post
Virtuoso
posted Hide Post
[qb]
-SET &COUNTER=1;
TABLE FILE SHORT
SUM PROJECTED_RETURN
BY COUNTRY
-IF &COUNTRY.EXISTS THEN GOTO LOOP1 ELSE GOTO DONE;
-LOOP1
WHERE COUNTRY EQ '&COUNTRY&COUNTER'
-IF &COUNTRY.EXISTS NE 1 THEN GOTO OUTLOOP;
-REPEAT OUTLOOP FOR &COUNTER FROM 1 TO &COUNTRY0
OR '&COUNTRY.&COUNTER';
-OUTLOOP
-DONE
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF,$
TYPE=DATA, COLUMN=N1, COLOR=RED, $
ENDSTYLE
END
[/qb]
The solution has to work in 3 cases: 0, 1 or >1 selections. If there is only one value selected, only the bare variable is passed (&COUNTRY, but not &COUNTRY0 or &COUNTRY1).

Your code would appear to fail in the latter two cases (referencing &COUNTRY1 when it does not exist; and inserting extraneous semicolons in the WHERE list when multiple values are selected).

There's an ample supply of models in tech support that do work in all three cases.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
<delvegas>
posted
hi

Can anybody give me the sample code.

Thanks
 
Report This Post
<delvegas>
posted
hi

Can anybody give me the sample code.

Thanks
 
Report This Post
Gold member
posted Hide Post
delvegas:

I think it is asking for a parameter because I think there is a syntax error in your code.

Change the line:
WHERE COUNTRY EQ '&COUNTRY&COUNTER'
to
WHERE COUNTRY EQ '&COUNTRY.&COUNTER' (missing period)

Tim
 
Posts: 57 | Registered: February 24, 2004Report This Post
<delvegas>
posted
Tim j: Thank you for you suggestion. Ur suggestion has really helped a lot.

Thanks
delvee
 
Report This Post
Virtuoso
posted Hide Post
http://techsupport.informationbuilders.com/ibase/master...0/wf_devrepapp52.pdf
(page 254) provides the following example.

Using a Dynamic Multi-Select Drop-Down List

-SET &COUNTER=1;
TABLE FILE SHORT
SUM PROJECTED_RETURN
BY COUNTRY
-IF &COUNTRY.EXISTS THEN GOTO LOOP1 ELSE GOTO DONE;
-LOOP1
WHERE COUNTRY EQ '&COUNTRY'
-IF &COUNTRY0.EXISTS NE 1 THEN GOTO OUTLOOP;
-REPEAT OUTLOOP FOR &COUNTER FROM 2 TO &COUNTRY0;
OR '&COUNTRY.&COUNTER'
-OUTLOOP
-DONE
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF,$
ENDSTYLE
END

(Familiar looking?)

It's not very tight code (the initial -SET &COUNTER is unneeded; there are more labels than needed; there is no semicolon closing the WHERE), but it will work when zero, one, or more values are selected.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
<delvegas>
posted
Thanks everybody. I appreciate for your time.

At last I solved the problem.
Now my program works fine with multi select list box.

thanks
 
Report This Post
Virtuoso
posted Hide Post
How would you make this loop if you selected 3 options in the multi-select list box and with each one run the Focexec, then run it again with the 2nd parameter, then again with 3rd?
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post



-
Member
posted Hide Post
I create my launch page multselect drop down box using the HTML GUI and by calling an .fex procedure (code below). The drop down populates correctly and allows multiple selections. However, the procedure invoked by the launch page can only see the first selection. It doesn't recognize &variable0, &variable1, etc., only &variable. I suspect it the procedure that populates the box which is the issue. Any suggestions?

SQL DB2
SELECT PRC_GRP_SID AS PGSID, PRC_GRP_DS AS PRCGRP FROM PWSDBO.T_PRC_GRP ORDER BY 2;

TABLE FILE SQLOUT
PRINT PGSID AND PRCGRP
ON TABLE HOLD AS HOLDPG
END

TABLE FILE HOLDPG
PRINT PGSID NOPRINT PRCGRP
ON TABLE PCHOLD FORMAT XML
END

The XML produced looks like this:


-
-

-

-



-




etc.

This message has been edited. Last edited by: <Mabel>,
68 01C GOLDMAN SACHS
573 01F BERMUDA WRAPPER NAVS
 
Posts: 9 | Location: Boston | Registered: November 10, 2005Report This Post
Expert
posted Hide Post
You need to edit your post and enclose the code between UBBcode tags by using
[code]your code goes here
[/code]



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
Expert
posted Hide Post
I will try an advise you tonight once I am at home (I'm off imminentlySmiler). There are a couple of methods to use, one using dialogue manager and the other harnessing the internals that ibirls.js provides.



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
Expert
posted Hide Post
When you have a multi select on your launch page, without alteration, the form submission will actually send an occurence of the parameter for each selection your User has made. So in Carl's example for three selections, there will be &variable, &variable and &variable. WebFOCUS changes these to &variable1, &variable2 and &variable3. It will also set &variable0 to the count of the variables, in this case 3. Then you should be able to use the myriad of samples and explanations that have been given above and elsewhere in this forum.

However, there is another way, and that requires amendments to the HTML launch page (not sure how it is done within the GUI I'm afraid - I don't use it Smiler). I can't find any documentation on it, but I found this out by analysing the functions within ibirls.js when I was looking at how chaining actually worked. Sad boy, I know!! Frowner

When you create your multi select, WF terms it a listbox, there are certain attributes within the SELECT tag pairing that you can adjust to provide a single variable for you to use in your report fex.

The first one is DATATYPE. When this is set to 1, it signifies that the select is to be populated by the ibirls.js script, either via a fex or mfd. When set to 0, the OPTION tags should be used, i.e. hard code your selections or use an instream file (!IBI.FIL.filename; ).

Another attribute is OPERATION, and this is normally set to "NONE". However you can change the value to "OR" or "AND". What this will do for you is provide you with a single &variable containing all the selected values seperated by the OR or AND value of the attribute.

DATAFIELDTYPE is normally at the end of the attribute list and controls whether quotes are placed around the individual values. Set to "CHAR" or "INTIGER" (arghh can't they spell?).
So for example, if your User chooses ENGLAND, FRANCE and JAPAN from a Country selection and you have OPERATION="OR" and DATAFIELDTYPE="CHAR" then your variable will emerge as 'ENGLAND OR 'FRANCE' OR 'JAPAN', which will make a perfect addition to your coding.

Try this out by adding -? & at the end of your fex and viewing the output to see the variables. This could make fexes using pure FOCUS language and multiple values from a select so much easier.

Enjoy

T

This message has been edited. Last edited by: Tony A,



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
Expert
posted Hide Post
Carl,

You needed to change your previous post. However, I can see from your new post that your XML appears to be OK. Do you have the MULTIPLE attribute applied to the SELECT in your HTML? If you do and you are able to select multiples, then your report fex must be at fault.

Use the -? & at the end of your fex to see what variables are being passed.

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
Silver Member
posted Hide Post
Should also work and a little simpler to code...

TABLE FILE SHORT
SUM PROJECTED_RETURN
WHERE ( COUNTRY EQ &COUNTRY.(OR(FIND COUNTRY IN SHORT)).Enter Country. );
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF,$
ENDSTYLE
END

P
 
Posts: 42 | Location: UK | Registered: October 23, 2005Report 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     passing parameters from multi select list box

Copyright © 1996-2020 Information Builders