Focal Point
HTML NULL Option

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

October 13, 2006, 01:14 PM
slfmr
HTML NULL Option
I have a few listbox's where the "ALL" option is available, but is there an option to add a blank to allow them to NOT select anything?

Would it be an easy HTML edit or would you recommend I do it in FOCUS?

Web Focus Dev Studio: Ver 711
Server: 711


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
October 13, 2006, 01:19 PM
mgrackin
slfmr,
What would be the purpose of not selecting anything? Are you looking for an alternative to the ALL option? Are you looking to eliminate the variable from the call to WebFOCUS? Why would you want to do what you asked about?


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
October 13, 2006, 01:29 PM
slfmr
The reason we want that to be an option is because a user can select for example:

Give me all the salaries of people in

Department
Country
State
Region

So we have 4 dropdowns... 1 for country and 1 from department etc... They don't have to select a country but can select a state and department or a region only.. meaning the other ones would be blank. So when they hit submit, I don't want a value passed in for the others.

Thanks for the speedy response!


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
October 13, 2006, 01:44 PM
mgrackin
So if the user does not select a specifc country (for example) you want to see information for all of them? Of course record selection for the other options would narrow the results of the request. OR are you trying to give the user control over what columns of information to show on the report?


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
October 13, 2006, 02:01 PM
slfmr
Okay I think i am starting to understand your logic. So the ALL should take care of all AND would essentially be the same as none (because none is not specific) to any... and unless a blank is an option in the database, then they would never get results back for selecting NONE or ' ' anyway.

Thanks! Makes sense... I was just trying to give them the option of "skipping" a selection in that box. It was also to help determine if I needed to join on tables or not... but I think the all should do it.

Thank you again!

(generally walking through the reaoning and asking the questions you did will help a person rationalize, so thanks!)


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
October 13, 2006, 02:10 PM
mgrackin
You CAN put a blank selection in your drop-down if you would like to make your user interface cleaner and better understood. In this case, pass a value of 'NONE' for that variable and then use Dialogue Manager to skip around the WHERE clause in your code.

TABLE FILE CAR
PRINT COUNTRY CAR MODEL
-IF (&COUNTRY EQ 'NONE') GOTO NOCNTY;
WHERE COUNTRY EQ '&COUNTRY'
-NOCNTY
.
.
.
END

Another alternative I just learned today is to pass the value 'FOC_NONE'. If a WHERE clause tests a field against a value of 'FOC_NONE' the selection is ignored or functions like an ALL selection or a value of '%'. Pass the value of 'FOC_NONE' if the blank is selected in the drop-down and then leave your WHERE clause in the request like the following. I have never used this but it should work.

TABLE FILE CAR
PRINT COUNTRY CAR MODEL
WHERE COUNTRY EQ '&COUNTRY'
.
.
.
END

Glad I could help.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
October 13, 2006, 02:31 PM
slfmr
How would I put the blank section in the dropdown?


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
October 13, 2006, 02:45 PM
mgrackin



Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
October 13, 2006, 02:46 PM
mgrackin
Here's the HTML code:

<select name="COUNTRY">
<option value="FOC_NONE"></option>
<option value="ENGLAND">ENGLAND</option>
<option value="FRANCE">FRANCE</option>
</select>


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
October 13, 2006, 03:18 PM
slfmr
Well I am populating that drop down with a procedure and I tried adding the none option as an additional option (the way you have above), but it doesn't recognize it.

I was thinking I would have to get it done in the procedure, and I have tried to do a compute the same field name as blank in a hold file then did a more on the final print, but when I put it in XML format, it is not recognizing the values after the MORE.

Thanks again for your help!


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6