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     Populating dynamic drop-down list...

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Populating dynamic drop-down list...
 Login/Join
 
Member
posted
Hi,<br /><br />
I found an example of how to
populate a dynamic drop-down
on a static html page by using
a .fex that calls the html form.
However, I have multiple drop downs
that I want to populate.
I was trying to build off the
example and create multiple
define and hold files. However,
I can't get the second select
box to populate. Any help
would be greatly appreciated.
Here is the code I'm trying to run...
<br />
-* File dynammul.
FILEDEF DYNAMLST DISK C:\IBI\APPS\GGDEMO\DYNAMLST.TXT
FILEDEF DYNAMLST2 DISK C:\IBI\APPS\GGDEMO\DYNAMLST2.TXT
DEFINE FILE SHORT<br />
OPTCOUNTRY/A40 = '<option>'|COUNTRY;
<br />END<br /><br />DEFINE FILE GEN_COMM_MRKT_APP<br />
SELECTOPTION/A255= '
<option value = "' 
|| COMM_MRKT_APP_NAME || '" >' || COMM_MRKT_APP_NAME || '</option>' ;
<br />END<br /><br />TABLE FILE SHORT
<br />SUM OPTCOUNTRY<br />
BY COUNTRY NOPRINT<br />
ON TABLE HOLD FORMAT ALPHA AS DYNAMLST
<br />END<br />-RUN<br /><br />
TABLE FILE GEN_COMM_MRKT_APP<br />
SUM SELECTOPTION<br />WHERE ACTIVE_FLAG = 'yes'<br />BY SELECTOPTION NOPRINT
<br />ON TABLE HOLD FORMAT ALPHA
 AS DYNAMLST2<br />END<br />-RUN
<br />-HTMLFORM DYNAMIC2<br />-
RUN
Here is the html file
that gets called by the .fex.
<br /><br />
-* File DYNAMIC2.htm
<br /><HTML><br />
<TITLE> DYNAMIC DROP-DOWN LIST 
REPORT </TITLE><br /><H4> 
PROJECTED RETURN BY COUNTRY 
<FORM ACTION="/ibi_apps/WFServlet" METHOD="GET"><br />
<INPUT TYPE="HIDDEN" NAME="IBIF_ex" VALUE="MULRPT"><br />
<SELECT NAME="COUNTRY" SIZE="3" MULTIPLE>
<br />!IBI.FIL.DYNAMLST;<br />
</SELECT>
<br /><br><br />
<SELECT NAME="SELECT2" SIZE="3">
<br />!IBI.FIL.DYNAMLST2;<br />
</SELECT><br /><BR><BR>
<INPUT TYPE="SUBMIT" VALUE="RUN REPORT!">
<br /></FORM><br /></BODY><br /></HTML>

This message has been edited. Last edited by: <Mabel>,
 
Posts: 19 | Registered: January 04, 2005Report This Post
Expert
posted Hide Post
It's as simple as the fact that the second HOLD file name is longer than 8 characters!

It would be nice to get an error message! Simply change the file name of the second file to one of 8 characters.

Cheers.
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
Thanks Francis...it worked. However,
I've run into another problem. Now I
can't get the third drop-down to
populate. Is there something else
I'm missing?<br /><br />Here is
the .fex<br />
-* File ipinit.fex
SET ECHO=ALL;
FILEDEF TECHATTR DISK C:\IBI\APPS\PALS\TECHATTR.TXT
<br />
FILEDEF COMMAPP  DISK C:\IBI\APPS\PALS\COMMAPP.TXT
<br />FILEDEF PORTFOL  DISK C:\IBI\APPS\PALS\PORTFOL.TXT
<br /
><br />DEFINE FILE GEN_COMM_MRKT_APP
<br />SELECTOPTION/A255= '
<option value = "' || COMM_MRKT_APP_NAME || '" >' || COMM_MRKT_APP_NAME || '</option>' 
END<br /><br />DEFINE FILE GEN_TECH_ATTRIBUTE >SELECTOPTION2/A255= '
<option value = "' || 
TECH_ATTRIBUTE_NAME || '" >' || TECH_ATTRIBUTE_NAME || '
</option>' ;
<br />END<br /><br />DEFINE FILE GEN_PORTFOLIO<br />SELECTOPTION3/A255= 
'<option value = "' || PORTFOLIO_NAME || '" >' || PORTFOLIO_NAME || '
</option>' ;<br />END
<br />TABLE FILE GEN_COMM_MRKT_APP
SUM SELECTOPTION<br />
WHERE ACTIVE_FLAG = 'yes'
BY SELECTOPTION NOPRINT<br /
>ON TABLE HOLD FORMAT ALPHA AS 
COMMAPP <br />END<br />-RUN
TABLE FILE GEN_TECH_ATTRIBUTE<br />
SUM SELECTOPTION2<br />
WHERE ACTIVE_FLAG = 'yes'
BY SELECTOPTION2 NOPRINT
ON TABLE HOLD FORMAT ALPHA AS TECHATTR
<br />END<br />-RUN
TABLE FILE GEN_PORTFOLIO
SUM SELECTOPTION3
WHERE ACTIVE_FLAG = 'yes'
BY SELECTOPTION3 NOPRINT
<br />ON TABLE HOLD FORMAT ALPHA 
AS PORTFOL<br />END
<br />-RUN<br />-HTMLFORM INTELLECTUAL_PROPERTY_REPORTS
<br />-RUN

This message has been edited. Last edited by: <Mabel>,
 
Posts: 19 | Registered: January 04, 2005Report This Post
Expert
posted Hide Post
Have you viewed the source of the HTML page? Perhaps there is a WebFOCUS error.

By the way, may I recommend removing the FILEDEF's at the beginning of the fex? Unless you're working with WebFOCUS older than Version 5, the FILEDEF's are not required for populating the dropdown boxes, in fact, in your case, you may get into trouble if two users run the same request at exactly the same time.
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
There was a problem with my query...it is working now. We are using 5.3.2 so I guess I have to use the filedefs. There is another issue that I've run into. I want the option value of the select box to be the field_id coming from the database (it is a numeric field). However, when I modify my filedefs to select this field I get this error...

0 ERROR AT OR NEAR LINE 17 IN PROCEDURE dynammulFOCEXEC *
(FOC280) COMPARISON BETWEEN COMPUTATIONAL AND ALPHA VALUES IS NOT ALLOWED

Do you know how I can get around this? Once again, thanks for the help.
 
Posts: 19 | Registered: January 04, 2005Report This Post
Platinum Member
posted Hide Post
Use the edit function to conver to alpha:
EDIT(numField)

Should be able to convert it right in the DEFINE with the concatentation.
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
Member
posted Hide Post
Thanks...that worked.
It looks like the EDIT() prepended a
bunch of zeros to the field...I'll
have to find a way to remove them when
I pass it into my query.
DEFINE FILE GEN_PORTFOLIO
SELECTOPTION3/A255= 
'<option value = "' || 
EDIT(PORTFOLIO_ID) 
|| '" >' || PORTFOLIO_NAME || 
option>' ;<br />END

This message has been edited. Last edited by: <Mabel>,
 
Posts: 19 | Registered: January 04, 2005Report This Post
Platinum Member
posted Hide Post
To get rid of leading zeroes use FTOA instead of edit. May need to use LJUST function too in order to get the data left justified.

Format is like this:
TEMP1/A9 = FTOA(fld_to_convert, '(format'), 'A9');
TEMP2/A9 = LJUST(9,TEMP1, 'A9');

Then use TEMP2 in the concatenation. For more info on these two functions (and others), download the "Using Functions" manual from doc services for whatever release you are using.

Good Luck!
 
Posts: 118 | Location: DC | Registered: May 13, 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     Populating dynamic drop-down list...

Copyright © 1996-2020 Information Builders