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     use javascript in a fex-file... possible?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
use javascript in a fex-file... possible?
 Login/Join
 
Silver Member
posted
Hi @all!
Is it possible to use javascript in a fex file?
example: i have a form in a html file.. i select a value from a dropdown-field. this value i want to use as a variable in an fex and work with it..
hope you can guess what i wanna do ;-)
are there any suggestions how to use javascript in a fex???
maybe:

-SET value1 = document.form.element.options[xyz].text

is there something like that???
furhter info: th htmlpage is created as htmlform from the fex-file...

mission impossible???
 
Posts: 30 | Registered: September 22, 2003Report This Post
<Pietro De Santis>
posted
Ernst, please provide more details.

The -SET command you mentioned is in the FEX before the HTMLFORM is displayed or is it in the FEX that's called after the submit button is clicked on in the HTMLFORM?

Pietro.
 
Report This Post
Master
posted Hide Post
You can include javascript in a FEX if you use HTMLFORM syntax. We do this all the time. You can have the script appear as functions or as inline in a [script] block and call them via onxxxx events in your HTMLFORM.

If you've got a report and want the HTMLFORM to embed it, hold the report to a FORMAT HTMTABLE file and then use the standard !ibi.file.filename; syntax to embed it. You can place it anywhere. Very powerful stuff, similar to ASP or JSP in many ways.

Hope this helps.

Bob
 
Posts: 919 | Registered: March 26, 2003Report This Post
Silver Member
posted Hide Post
ok, i try to explain it from another point..

i have a form on an html page. a drop-down field where i can select years.

and if i select a year, i will use this value in a fex as a variable, to show me tables with values only in this year...

i tried to fetch the value with javasript, and it works, but now i dont know how to bring the value into the fex..thats my problem...

can you guess now, what i want? ;-)
 
Posts: 30 | Registered: September 22, 2003Report This Post
Gold member
posted Hide Post
Hi Ernst,

I think you want to populate the dropdown value form a fex and then you want to pass that value selected from the drop down to another FEX is that correct?

This is what I do.

DEFINE FILE CAR
CARNAME/A150 = '<OPTION VALUE="'|| CAR_MODEL ||'">'
| CAR_MODEL | '-' | CAR_DESC | '</OPTION>' ;
END

TABLE FILE CAR
SUM CARNAME
BY COUNTRY
WHERE COUNTRY EQ '&COUNTRY'
ON TABLE HOLD AS HOLD1 FORMAT DD ALPHA
END

-HTMLFORM BEGIN
...
...
...
...
...
..
<!-- BELOW IS THE DYNAMIC DROPDOWN BOX -->
Choose CARNAME:<TD width="236">
<p align="left"><SELECT NAME="CAR_MODEL ">!IBI.FIL.HOLD1;
</SELECT><BR></TD>
</TR>
<input type='hidden' name='IBIMR_domain' value="XYZ1">
<input type='hidden' name='IBIMR_action' value="MR_RUN_FEX">
<input type='hidden' name='IBIMR_sub_action' value="MR_STD_REPORT">
<input type='hidden' name='IBIMR_fex' value="car1.fex">
<input type='hidden' name='IBIF_ex' value="car1.fex">
<input type='hidden' name='IBIMR_folder' value="#xyz2">
<input type='hidden' name='IBIMR_defer' value="">
<input type='hidden' name='IBIMR_random' value=''>


-HTMLFORM END

Now the carname value that you select would be passed to CAR1.fex.

Does that help or did I deviate from the actual question?
 
Posts: 76 | Registered: October 28, 2003Report This Post
Master
posted Hide Post
Ernst

If I understand you! you can use the onClick or onChanged event of the dropdown and then call the form.submit() function to submit the form to webFOCUS. The submit function will automaticlly pass all variables that are in to form section for the HTML file back to WebFOCUS. For example: if I have a field called COUNTRY which is a select box I can trigger an event to call WebFOCUS and the variable &COUNTRY will automaticlly be pass back to WebFOCUS.

Hope This Helps
 
Posts: 865 | Registered: May 24, 2004Report This Post
Silver Member
posted Hide Post
thanks for answering so fast.. but as a newbie, its not very clear to me.. where ist the variable in the fex? i dont want 2 fex.. its just one fex and one html file..
there is a start value, its the actual year.. and a dropdown box is filled with the years where there are datasets..
and in the html is a table with values only from the year which is selected from the drop down above..
till now, everything is ok and working!!
but if i change the dropdown box to another year.. ther are just mistakes, or i allways get the starting year.. so there is the problem.. i dont know what to do, to get the values of the selected year into the table...

so: i have a fex to get the years

KURZDAT/MDYY=HDATE(DATUM,'MDYY');
JJ/YY=KURZDAT;
PART1/A15 = '';
END
TABLE FILE STUNDEN
SUM
PART1 JJ PART2 JJ PART3
BY
JJ NOPRINT
ON TABLE HOLD AS DYNAMLST FORMAT ALPHA
these small fex i have included
in another fex with an "EX" execution on the beginning..

and in the second fex i want to create a table
with values just from the selected year..
but i really dont know, how i get a variable into the second one which shows these values..

in the html-file there are the form & select & value tags.. and with javascript-onchange i would like to make the page reloading and use the new year-values...

hope that someone is understanding me, and can show me a simple solution.. would be great from you!! thanksssssss!

This message has been edited. Last edited by: <Mabel>,
 
Posts: 30 | Registered: September 22, 2003Report 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     use javascript in a fex-file... possible?

Copyright © 1996-2020 Information Builders