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     multi selects (combo boxes) don't work the same way ! ???

Read-Only Read-Only Topic
Go
Search
Notify
Tools
multi selects (combo boxes) don't work the same way ! ???
 Login/Join
 
Expert
posted
In the good old days (read v5 or earlier), a self-respecting multi select would produce:
&COUNTRY0
&COUNTRY1
&COUNTRY2
but the new HTML thing in DevStu doesn't yield a form, it yields xml and creates a single statement:
WHERE &COUNTRY EQ 'ENGLAND' OR 'FRANCE'
Well, that's not what we want.
We want to loop thru the choices, doing an included (or EXEC'd) fex once for each value.
So, how do we do that now???
Anybody pulled their hair out over this one yet<

This message has been edited. Last edited by: susannah,




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
Parse the input amper variable and, using a REPEAT, substring the variable using the OR as a delimiter. Then you can index each variable and do your loop.

I might be able to find some code but won't have time till later on this afternoon. You can send me a personal email (like you did before) and I'll try to find it for you.


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
Expert
posted Hide Post
That's the work around we had come up with our own sweet selves . thanks, Ginny, for confirming.
i don't like having to do this...
I may try replacing the .htm with a diy with a regular FORM tag set.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
Susannah, that sounds awful! Why on earth would they change the behaviour? Is there actually a form any more?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Susannah,
In fact, you want to have both, and the you can decide if and when you want to use the separate values or the OR statement!


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
Danny, are you saying that we DO have the choice?
Can you point me to the thing in the gui where you pick?
Frankie, that's right. NO MORE FORMS. its really awful.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
oops i forgot why i came back....
Ginny, would you be kind enough to send me your script if you can locate it?
i'm having ageda turning what gets returned into a character string, even.
'ENGLAND' OR 'FRANCE'
is the returned string
and i can't get that into a variable to POSIT thru. (too much nashville fun, i guess)
-SET &MYVAR = ??
i can't seem to get the '''''''' right.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
Susannah,

1. Try this:
  
-* File Susannah1.fex
-SET &S='''ENGLAND'' OR ''FRANCE'' OR ''W GERMANY''';
-TYPE &S
-SET &SLEN=&S.LENGTH;
-SET &T=STRREP (&SLEN, &S, 4, ' OR ', 1, '|', &SLEN, 'A&SLEN.EVAL');
-SET &TLEN=ARGLEN(&T.LENGTH, &T, 'I4');
-SET &U=STRIP(&TLEN, &T, '|', 'A&TLEN.EVAL');
-SET &ULEN=ARGLEN(&U.LENGTH, &U, 'I4');
-TYPE &SLEN &TLEN &ULEN
-SET &IMAX=&TLEN - &ULEN + 1;
-REPEAT #DO FOR &I FROM 1 TO &IMAX;
-SET &S.&I=GETTOK(&T, &TLEN, &I, '|', &TLEN, 'A&TLEN.EVAL');
-TYPE &S.&I
-#DO


2. I didn't say that it existed, I said that is what should have existed.


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
Virtuoso
posted Hide Post
GETTOK() will do it: use apostrophe ('''') as the delimiter, and take just the odd-numbered tokens, until you hit a blank.

...Provided you know a priori that the values are all non-blank and do not contain apostrophes.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
Jack,
Yes, but what happens when the OR values are numeric? No quotes!


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
but Danny, you don't have the option to do that.
the xml returns exactly
'ENGLAND' OR 'FRANCE'
Jack,
i'ld been trying CTRAN,POSIT, and SUBSTR..
GETTOK seemed to require that i know how many OR's i had..which i dont.
aprioris all ok.
Danny, numeric values are actually easier.
argh.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
agony!
-* File ct_list.fex
 
-*SET &ECHO = ALL ;
-SET &GROUP_ID0 = 1 ;
-SET &KOUNTER = 1 ;
-*TYPE &GROUP_ID
-*TYPE &GROUP_ID.LENGTH
-SET &parent1=CTRAN(&GROUP_ID.LENGTH , &GROUP_ID  , 39, 32, A&GROUP_ID.LENGTH );
-SET &parent2=SQUEEZ(&parent1.LENGTH , &parent1.QUOTEDSTRING, A&parent1.LENGTH );
-SET &parent3=LJUST ( &parent2.LENGTH , &parent2.QUOTEDSTRING , A&parent2.LENGTH )  ;
-* don't mess with this
-SET &arglen = ARGLEN(&parent3.LENGTH, &parent3.QUOTEDSTRING,  I4  );
-SET &aaa     ='A' || &arglen ;
-SET &parent  = SUBSTR(&parent3.LENGTH, &parent3.QUOTEDSTRING, 1, &arglen , &arglen, '&aaa' );
 
-toploop 
-*----------------------
-SET &p1 = POSIT (  &parent   , &parent.LENGTH , ' OR ' , 4 , 'I4');
-SET &pend = &p1 - 1 ;
-SET &pnext = &p1 + 4 ;
-SET &psize  = &parent.LENGTH - &pnext + 1 ;
-TYPE p1= &p1 pend = &pend pnext =&pnext startlength = &parent.LENGTH psize = &psize
-SET &GROUP_ID0 = IF &p1 EQ 0 THEN &GROUP_ID0 ELSE &GROUP_ID0 + 1 ;
-TYPE kount = &GROUP_ID0 ;
-IF &p1 GT 0 GOTO do.substr ;
-SET &GROUP_ID1 = IF &p1 EQ 0 THEN  &parent.QUOTEDSTRING  ;
-GOTO end.substr ;
-do.substr   
-SET &aaa='A'|&pend ;
-SET &GROUP_ID1 =
-      SUBSTR( &parent.LENGTH,    &parent.QUOTEDSTRING   , 1 , &pend, &pend, '&aaa') ;
-*TYPE group_id1 = &GROUP_ID1 
-end.substr;
-SET &GROUP_ID1 = '''' || &GROUP_ID1 || '''' ;
-SET &GROUP_ID1 = 'WHERE GROUP_ID IS ' |  &GROUP_ID1 ;
-TYPE group_id1 = &GROUP_ID1
 
-* include processing  fex here
-IF &p1 EQ 0 GOTO endloop ;
-SET &aaa= 'A' || &psize ;
-SET &parent = SUBSTR(&parent.LENGTH ,   &parent.QUOTEDSTRING , &pnext, &parent.LENGTH , &psize , '&aaa' );
-TYPE newparent = &parent
-GOTO toploop ;
-endloop


note: there is a big difference between ARGLEN and &var.LENGTH. big... huge...major.
and there's a difference in how you get the output size attribute into a SUBSTR phrase..
which is why i say 'don't mess with this'...
this is AGONY...
I need a nap.

This message has been edited. Last edited by: susannah,




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
Susannah,

Very nice. I understood that you wanted to have as in previous versions a list of &variables. This is what my DM gives you. Well, if not for this app, the for another.
Cheers!


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
Susannah,

Are you using amper autoprompting? If not then check the OPERATION attribute of your multiselect. Even back as far as 5.2 (I think) you could change this value to OR to give you what you are now seeing. The default used to be NONE but as I don't (yet?) use 7.6.5 I couldn't tell you if this has changed.

Email me your HTML if you wish to.

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
Expert
posted Hide Post
T, don't quite understand...
i'll build something on car and send.
Do you have access to 5n? anywhere?
Can you 'Publish' me a form from MRE and email it to me so i can get all the funky hidden vars? i want to see if i can make a FORM still work. FrankieM has 5n... i'll ask him ..in a while...




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
quote:
In the good old days (read v5 or earlier), a self-respecting multi select would produce:
&COUNTRY0
&COUNTRY1
&COUNTRY2
but the new HTML thing in DevStu . . . creates a single statement:
WHERE &COUNTRY EQ 'ENGLAND' OR 'FRANCE'


Actually, the fex has:
WHERE COUNTRY EQ &COUNTRY.yada.yada.
(COUNTRY being the database fieldname, &COUNTRY a DM var to be replaced with COUNTRY values)
and after the pre-scan and autoprompt process are done the fex executes for real, with a behind-the-scenes equivalent of
EX ... COUNTRY='''ENGLAND'' OR ''FRANCE'''
to pre-SET the DM variable.
-- such that the WHERE line (after Dialog Mgr substitution for &COUNTRY) resolves to

WHERE COUNTRY EQ 'ENGLAND' OR 'FRANCE'

I agree with Susannah -- the
&COUNTRY0=2
&COUNTRY1='ENGLAND'
&COUNTRY2='FRANCE'
thing was a kludge, but the genii is out of the bottle and it's usefull to have the values.

So (MODEST PROPOSAL) WHY NOT HAVE AUTOPROMPT PROVIDE BOTH

To wit, after the multi-select, set both the combined and individual values behind the scenes:

EX ... COUNTRY='''ENGLAND'' OR ''FRANCE''',
COUNTRY0=2,
COUNTRY1='ENGLAND',
COUNTRY2='FRANCE'

If your fex is built to simply run off the resolved value of &COUNTRY, the extra vars do no harm. But if you need to process the individual values, you've got them.

Two caveats -- neither of them a show-stopper IMO:

1. When the user selects just one value we need special handling: OR(...) returns a quoted string in &COUNTRY, whereas the traditional forms return just an unquoted string (the client, in the traditional scenario, being unaware that the source was a multiple select). But if we arrange for the fex to have
&COUNTRY0 : 1
&COUNTRY1 : ENGLAND
&COUNTRY : 'ENGLAND'
good old code will still work, provided it gives the presence of &var0 precedence over the presence of &var.

2. There are cases where this change in behavior may break a fex, so I guess this behavior would have to be a switchable option.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
IT GETS WORSE
that solution i wrote above only works in 761
it fails in 764, 765.
its the SUBSTR function
something screwed up has happened to it.
argh.
oh no never mind, i fixed my the errant substring function last parm...its me that isn't working in 76n Wink

Jack, i recall there was some universe in which
&COUNTRY was synonymous iwth &COUNTRY1

This message has been edited. Last edited by: susannah,




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
I alluded to that in Caveat #1.

An HTML form with a multi SELECT returns the (0, 1 or more) values you select, each attached to the unadorned NAME appearing as an attribute of the select structure.
Thus, if you select just ENGLAND, the GET would have
?COUNTRY=ENGLAND
-- while for England and France it would have
?COUNTRY=ENGLAND&COUNTRY=FRANCE

WF client, when it sees two or more identical names, converts them into a series of unique names (so they can become separate DM &vars) by appending integers, topping off the list with a counter variable with 0 appended.

BUT, if the JavaScript that WF 7.x generates would cast the values into that series form even when there is only one selection, in addition to generating the strung-together-and-quoted form under the unadorned name, you would have the best of both.

If fex senses that &COUNTRY exists, but &COUNTRY0 also exists, and &COUNTRY0 happens to be 1, you'd perform the same -REPEAT loop as you would for 2 or more, and your logic would terminate the loop after 1.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
yeah.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
If we're talking about the same thing (autoprompting), the generated XML page actually does submit a form:

<body onload="mntFormValidateOnloadFunc( );onLoadDescribeForm( );" xoncontextmenu="return false;">
. . .
<form
 onSubmit="RestoreSubmit();return PostWFForm(this);"
 target="outputFrame"
 method="post"
 name="WFDescribeForm"
 id="idWFDescribeForm"
 action="/ibi_apps/WFServlet">
. . .
<input
 onClick="PostWFForm(document.getElementById('idWFDescribeForm'))" ...
 value="Run" ... type="submit"/>
. . .


There's tons of javascript there -- both generic functions pulled in from the library, and specific (to the particular prompts) code generated inline in the page. It's perfectly possible for IBI to craft js functions that will do as I described -- serializing the NAMEs so they are all unique (var var0=N var1 var2 ... &varN) before Client sees them, and the values will all flow to the fex as correspondingly-named DM vars.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
lo and behold i figured this out:
1) if you use HTML painter, you get a single compound WHERE statement
WHERE COUNTRY EQ 'ENGLAND' OR 'FRANCE' OR 'BURKINA FASO'
2) if you go to MRE, and use PUBLISH, you get a regular FORM (well, sort of). You clean out all the .js gibberish, write your own
<select name='MYCOUNTRY'>
<OPTION VALUE='ENGLAND'>ENGLAND</OPTION>
..etc.
</select>

you THEN get &MYCOUNTRY0, &MYCOUNTRY1, etc
SO..
If your launch page needs individual variables, so you can loop, you gotta use PUBLISH from MRE, or hand-write your own gibberish-free launch pages.
Whew.
World still on its axis.
At least until after the election.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
quote:
At least until after the election.


You mean "... will be after the election" or "... may be after the election".


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 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     multi selects (combo boxes) don't work the same way ! ???

Copyright © 1996-2020 Information Builders