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:
is there something like that??? furhter info: th htmlpage is created as htmlform from the fex-file...
mission impossible???
November 12, 2004, 06:27 PM
<Pietro De Santis>
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.
November 12, 2004, 07:43 PM
Bob Jude Ferrante
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
November 15, 2004, 11:31 AM
Ernst
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? ;-)
November 15, 2004, 11:55 AM
RB
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
Now the carname value that you select would be passed to CAR1.fex.
Does that help or did I deviate from the actual question?
November 15, 2004, 03:21 PM
TexasStingray
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
November 16, 2004, 04:51 PM
Ernst
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>,