Focal Point
multi-select technique

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

June 01, 2005, 12:38 PM
gypsy
multi-select technique
I have seen this code and used it to handle multi-selects but I am not sure why or how it works! (but it does) Big Grin

-IF &SOMEINPUTFIELD.EXISTS EQ FOC_NONE OR ' ' THEN GOTO NEXT10;
WHERE SOMEDATAFIELD EQ &SOMEINPUTFIELD.(OR(1,2)).;
-*
-NEXT10

What I haven't found documented anywhere is the syntax .(OR(1,2)).

Can anyone tell me what it is doing and/or where its documented? Obviously, I snipped it from somebody else.

Thanks!
June 01, 2005, 03:20 PM
<JG>
gypsy try Developing Reporting Applications Version 5 Release 3 (DN4500578.0904) page 312
June 01, 2005, 08:29 PM
gypsy
Yes, this is halfway there...but I am still guessing about:

.(OR(1,2))

if anyone knows why I wouldn't put 1, 10 for example that would be helpful.

Thanks!
June 01, 2005, 08:38 PM
<JG>
the 1,2 are the choices that a user will see in the dropdown box.
You would put there what you wanted to offer the user as valid selections such chalk,cheese
June 01, 2005, 08:41 PM
N.Selph
That code is for amper-auto prompting, giving a drop-down list with "1" and "2" in it.
June 02, 2005, 12:46 AM
j.gross
I read the documentation, and I'm a little bit puzzled.

The "Amper Auto-Prompting in CGI Servlet" topic (http://documentation.informationbuilders.com/masterinde...vapps/codingui10.htm) gives syntax for four varieties of Select prompting.

Static Single-Select List of Values:
'&variable.(value,value2[,value3]...).[description.]'

Dynamic Single-Select List of Values:
'&variable.(FIND fieldname IN datasource).[description.]'

Static Multi-Select List of Values:
&variable.({AND|OR}(value1,value2,...valueN)).[description].

Dynamic Multi-Select List of Values:
&variable.({AND|OR}(FIND fieldname IN datasource)).[description].

So adding AND( ), or OR( ), turns a single select into a multi-select.

But is there a difference between AND and OR? Are they synonyms in this context?
June 02, 2005, 07:03 AM
<JG>
Not surprised that your confused because it�s not explained
.
From a multi-select point of view AND does not work when EQ is chosen as the test.

A WHERE statement like WHERE ( COUNTRY EQ 'JAPAN' AND 'ENGLAND' ); is totally wrong unless you always want to select zero records.

However a statement like WHERE ( COUNTRY OMITS 'JAPAN' OR 'ENGLAND' ); is valid.

You�ve just got to use the correct logic.
June 02, 2005, 04:03 PM
j.gross
I am quite aware of how to deal with IF or WHERE clauses in a TABLE request.

My question is with ergard to the extensions to traditional autoprompt syntax when Dialog Manager variables appear in Focus statements: is there a semantic difference between
&foo.(OR(a,b,c)).Choose your FOOs.
and
&foo.(AND(a,b,c)).Choose your FOOs.
?
Other questions:

- Does the -DEFAULT feature apply to "multiple" selects, or only "singles".

- How does execution proceed? Clearly the agent must first parse the fex, recognize that there is auto-prompt syntax, and return a form. Since agents operate nonpersistently, the form has to re-invoke the fex upon submit. How does the second call make it clear that it is not a first call? How is the context preserved and restored (e.g., if the fex was originally called with some &vars set; or if there are && global vars set)?

- Note that autoprompt occurs even for &vars with -DEFAULT values supplied -- even though, in traditional Focus and WebFocus fex execution, they would not be considered undefined.
June 02, 2005, 04:46 PM
<JG>
I did not mean to imply that you did not understand standard logic. I merely wanted to give a fuller explanation for those who have less understanding of what we are talking about.

The semantic difference for OR/AND is purely the operand that you choose.

The wrong one, it does not work the correct one and it does.

Execution is very simple,

The first request is EX FEX

The second request is EX FEX var1=xx,var2=yy

WebFocus Knows that when variables have a value it does not need to prompt for them.

You can test this by creating a report with an auto prompt but supply the required variable name and value on the input line in a browser.
Supply the value and it will not ask you for it.

Auto prompt when enabled disables �DEFAULT, because Auto prompt means give me a value. Personally I think that this is wrong and it should say if you haven�t given me a value I�ll use the �DEFAULT instead. Perhaps an NFR is required.
June 02, 2005, 06:45 PM
j.gross
[qb] WebFocus Knows that when variables have a value it does not need to prompt for them.[/qb]

A -SET value, as distinct from a -DEFAULT one. (They are distinguishable.) As I noted, that varies from traditional autoprompting rules.

[qb]...
Auto prompt when enabled disables �DEFAULT...[/qb]

I didn't see that in the cited document for self-service apps. In fact, I didn't see any way to turn autoprompt off. -- By its nature it would have to be a DM directive, since this all happens before -RUN.