Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     setting a default in a drop-down
Go
New
Search
Notify
Tools
Reply
  
setting a default in a drop-down
 Login/Join
 
Platinum Member
posted
Users...? You never know what they'll like and not like. My user would like a particular value to be set as the default in the drop-down options. My focexec to create the drop-down looks like this:

FILEDEF YEARLST DISK YEARIS.HTM

-DEFAULT &TRANS = ' ';

TABLE FILE BU01TB06
SUM
COMPUTE YEARVAL/A8 =
IF CD_YEAR EQ '&TRANS' THEN 'SELECTED' ELSE ' ' ; NOPRINT
COMPUTE OPC/A128 =
'';
ON TABLE SET HOLDLIST PRINTONLY
BY CD_YEAR NOPRINT

ON TABLE HOLD AS YEARIS FORMAT ALPHA
END
-RUN

The drop down then has
All Years
2003
2004

My user wants the default to be set to current year. "All Years" comes from my HTML code and 2003/2004 comes from my focexec code.

Question is: How do I set a default selection ?
 
Posts: 132 | Location: Kansas | Registered: November 12, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
well, what works for me is to write my entire option list using focus defines
DEFINE FILE thing
PICK/A10=IF CDYEAR IS &SOMETESTVAL THEN ' SELECTED ' ELSE ' ' ;
OUTPUT/A100=
'';
END
TABLE FILE thing
PRINT OUTPUT BY CDYEAR NOPRINT
ON TABLE HOLD AS MYDDLIST FORMAT ALPHA
END
..and myddlist is filedefed into my site
..and my html page has 'ALL' with value $
as the first entry hardcoded into the page.
Then i reference this list

This works for an .asp launch page. if yours is html, you can issue a filedef at the top, make it a fex, and use !ibi.fil...but you know that already. Hope this helps; it works great for me.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     setting a default in a drop-down

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.