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.
Hi, In the lead focexec, the global variable &&DEPT is set to a value. This focexec then calls an HTML form as follows: -HTMLFORM Dashboard.htm. When the user clicks a link, a Maintain is called. In the Maintain's top case the statement -> Compute xdept/a6 = IWC.GetAppCGIValue("DEPT"); does not retrieve any value. Please inform me what is missing. Thank you, NickThis message has been edited. Last edited by: Kerry,
WebFOCUS 7.7.03 & 8.0.7 Windows HTML, Excel, PDF, etc. Also, using Maintain, etc.
Dear Dr. Nick The lead focexec, Dashboard.htm and the maintain procedure are 3 independent entities.
In order to use the &&DEPT global variale in Dashboard.htm you have to reference or assign it to an object in the htm document (using a hidden input field would be one way).
Is the link to the Maintain procedure a normal hyperlink or is a form submitted? This will determine how you pass the value of &&DEPT to the Maintain procedure.
-------------------------------------------------------------------------------- prod: WF/AS 8.2.05; OmniGen; In FOCUS since 1991
Posts: 104 | Location: United Kingdom | Registered: February 07, 2008
Hi Clinton Side-Kick, Thanks for the response. The Maintain is called by a hyperlink. The global variables will be used to restrict drop-down lists to only those entries for that department. Nick
WebFOCUS 7.7.03 & 8.0.7 Windows HTML, Excel, PDF, etc. Also, using Maintain, etc.
Hi Clinton, This is a multi-part process: 1. User logs into a web portal 2. x.fex sets two global vars: EMPLIDX and DEPT 3. x.fex calls an HTMLFORM 4. HTMLFORM has hyperlink 5. Link calls Maintain
Values are not received by Maintain. Contents of parts 2 through 5 are as follows:
Nick, Have a look at the following example, it sounds like what you are missing is having the value of &&DEPT available in the HTTP header of your HTMLFORM from which the MAINTAIN procedure is being called: Here's an example of drilling down to a JavaScript function that passes 5 parameters and calls Maintain:
-* File DrillToJS.FEX -* - The selection of TITLE, DIRECTOR, RATING, MOVIECODE, and RELDATE will -* be passed to the JavaScript function, RUNMNT. -* -* - RUNMNT is embedded in -HTMLFORM underneath the TABLE request. The -* function will launch the Maintain procedure, TESTPROBLEMS, and pass five -* CGI parameters.
-* - a. The five parameters (TITLE, DIRECTOR, RATING, MOVIECODE, and RELDATE) -* are first passed to the RUNMNT JavaScript function in stylesheet. -* b. Then retrieved as SelTITLE, SelDIRECTOR, SelRATING, SelMOVIECODE, and -* SelRELDATE in RUNMNT -* c. And passed to WebFOCUS CGI as &title1, &director1, &rating1, -* &moviecode1, and &reldate1. -* TABLE FILE MOVIES PRINT DIRECTOR RATING MOVIECODE RELDATE BY TITLE ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * TYPE=DATA, COLUMN=N1, JAVASCRIPT=RUNMNT(TITLE DIRECTOR RATING MOVIECODE RELDATE), $ ENDSTYLE END -RUN -HTMLFORM BEGIN
-HTMLFORM END -***************** END OF FILE ********************
-* TESTPROBLEMS.MNT -* Use IWC.GetAppCgiValue to retrieve the WebFOCUS CGI values into a computed -* field. My example will type out the values and restrict stack to only -* records that fit criteria. MAINTAIN FILE movies Case Top compute GetTitle/a0 = IWC.GetAppCgiValue("title1"); compute GetDirector/a0 = IWC.GetAppCgiValue("director1"); compute GetRating/a0 = IWC.GetAppCgiValue("rating1"); compute GetMoviecode/a0 = IWC.GetAppCgiValue("moviecode1"); compute GetReldate/a0 = IWC.GetAppCgiValue("reldate1");
type "<Reposition movies.MOVINFO.MOVIECODE ; Stack clear stk1 ; For all next movies.MOVINFO.MOVIECODE into stk1 Where (TITLE EQ GetTitle); -* Bind stk1 to a Grid or HTMLTable Winform Show Form1; EndCase END -******************* END OF FILE *********************
-------------------------------------------------------------------------------- prod: WF/AS 8.2.05; OmniGen; In FOCUS since 1991
Posts: 104 | Location: United Kingdom | Registered: February 07, 2008
Hi Clinton, Changed from hyperlink to onclick event as follows:
function image3_onclick(ctrl) { var emplidx = !IBI.GLB.EMPLIDX; var dept = !IBI.GLB.DEPT; var today = new Date(); var cmd = "/ibi_apps/WFServlet?IBIS_connect=on"+ "&" + "IBIC_server=edaserve" + "&" + "IBIAPP_app=tms"; cmd = cmd + "&" + "IBIF_cmd=MNTCON EX Select_Name_PP"; cmd = cmd + "&" + "EMPLIDX=" + emplidx + ";" cmd = cmd + "&" + "DEPT=" + dept + ";"; cmd = cmd + "&" + "CurrentStamp=" + today.getTime(); document.location.href = cmd; } //End function image3_onclick
Technique did pass variable values but yields the following issues:
1. First execution passes dept correctly but emplidx has semi-colon as the last character, e.g. 123456; 2. Second execution gives an error 'IBI' is undefined in the message area. 3. Variable values are stated in the URL. This is a security risk.
Is there another way of passing global variables?
Nick
WebFOCUS 7.7.03 & 8.0.7 Windows HTML, Excel, PDF, etc. Also, using Maintain, etc.
Hi Clinton, Took a different approach and almost there. New approach executes WebFOCUS procedure from a Maintain as follows:
Maintain: INFER TIMEKEEP.EMPLID INTO EMPXSTK; EXEC SET_EMPLIDX KEEP INTO EMPXSTK; COMPUTE EMPLIDX/A7 = EMPXSTK.EMPLID; COMPUTE XDEPT/A6 = EMPXSTK.DEPT;
SET_EMPLIDX: TABLE FILE TIMEKEEP PRINT EMPLID DEPT IF EMPLID EQ &&EMPLIDX ON TABLE PCHOLD END
Get Message 3690. It seems that WebFOCUS is looking to resolve the global variable. If I set the global variable in the focexec to a value, all is OK. For Example: -SET &&EMPLIDX = '1234567'; TABLE FILE TIMEKEEP PRINT EMPLID DEPT IF EMPLID EQ '&&EMPLIDX' ON TABLE PCHOLD END
It seems the setting of the global variable in a previous focexec does not hold.
Feel like a rat in a maze!!!
Thanks for your help, Nick
WebFOCUS 7.7.03 & 8.0.7 Windows HTML, Excel, PDF, etc. Also, using Maintain, etc.
Nick, The trick is to keep things simple. These challenges are only as complicated as we make them out to be. Stop, breath, think (SCUBA advise for underwater crisis management).
I noticed a ; being missing at the end of the line where you add the EMPLIDX parm to the cmd var. To prevent the parameters from displying in the URL (point 3), you should rather submit a form with method="post". Here is another example that combines js and a html form (main objective here is not to cache the URL):
To pass paramters from a FOCEXEC to a Maintain procedure, you can include the HTML in the FOCEXEC using HTMLFORM and then use JavaScript to pass the parameters. To prevent the URL from being cached, use the Expires and Pragma meta tags.
Here is an example of how to pass two parameters from a WebFOCUS report to the JavaScript function in the HTMLFORM, submit the parameters along with the Maintain launch page without caching the URL, and then retrieve the parameters in a Maintain procedure.
DRILLDOWN.FEX ------------- TABLE FILE MOVIES PRINT TITLE BY DIRECTOR ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=DATA, COLUMN=N1, JAVASCRIPT=RunMaintain(DIRECTOR TITLE), $ ENDSTYLE END -RUN
MNTIVP.MNT ---------- MAINTAIN DECLARE GetDirName/a30 = IWC.GetAppCgiValue("DirectorName"); DECLARE GetMovieName/a30 = IWC.GetAppCgiValue("MovieName"); CASE TOP Type "Selected Director Name: < Type "Selected Movie Title: < Winform Show Form1; EndCase END
You should be able to modify this to suite your requirements.
-------------------------------------------------------------------------------- prod: WF/AS 8.2.05; OmniGen; In FOCUS since 1991
Posts: 104 | Location: United Kingdom | Registered: February 07, 2008
Hi Clinton, Tried your technique but received error message "startform not defined". It seems that if there is a way to get the value of a global variable, any one of these techniques would function properly.
The best case, so far, functions properly for the first execution of the code but gets the error message 'IBI' is undefined for the second execution. Here I am using javascript code -> var dept = !IBI.GLB.DEPT; to capture the global variable value.
Any suggestions to retain, pass or store a global variable? Thank you, Nick
WebFOCUS 7.7.03 & 8.0.7 Windows HTML, Excel, PDF, etc. Also, using Maintain, etc.