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     [WORKAROUND] Assign Parameter value using Javascript

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[WORKAROUND] Assign Parameter value using Javascript
 Login/Join
 
Gold member
posted
Is it possible to assign the username parameter directly, using javascript, instead of a procedure?

For example, we want to grab the IBI user during the on initial update phase. Is it possible to get something like this working?

  
edit1.value=&IBIMR_user;



Thank you,

This message has been edited. Last edited by: Joey Sandoval,




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


 
Posts: 94 | Location: Austin, TX | Registered: August 08, 2012Report This Post
Expert
posted Hide Post
var edit.value = !IBI.AMP.IBIMR_user;;


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
in quotes:
var edit.value = '!IBI.AMP.IBIMR_user;';
and only if the html page was launched from a -HTMLFORM in a fex. If you run the html page by itself, !IBI.AMP is not available.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Yes, as Francis says, the will only work if WebFOCUS is called.

It also relies on validation against MRE.

What do you mean by update phase ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
We want to dynamically change the design of the HTML, based on the user that is logged into MRE, before the page loads - using the on initial update function.




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


 
Posts: 94 | Location: Austin, TX | Registered: August 08, 2012Report This Post
Virtuoso
posted Hide Post
Having the userid embedded in the web page that is sent to the browser makes it available to people with less than honorable intentions. They could change their username to that of another user. I don't know if that's a concern for you, but it's generally bad form to have an unencryped username embedded in the html file.

If it's not used for anything particularly interesting ("Welcome Joey_Sandoval!") then it doesn't really matter. but at that point you'd just be embedding it in the html, not in a Javascript function that is presumably using it for something.

Once the user has logged in to MRE the IBIMR_user variable is always present on subsequent calls to the server. You can adjust the html returned to the end-user each time on the server prior to delivery, and then leave the ID out of the page that is returned.

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Gold member
posted Hide Post
J,
I do see your point in that regards. For this project, we essentially just want to display a small administritave groupbox for a very small # of users (dept managers) and hide these controls for all other users of this dashboard.

Rather than create 2 dashboards (2 domains) , we thought we could implement some simple javascript to hide and display controls before the page loads based on user id.




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


 
Posts: 94 | Location: Austin, TX | Registered: August 08, 2012Report This Post
Virtuoso
posted Hide Post
I believe that, if someone has JavaScript turned off, they may get an unintended result. That's pretty common these days with all the malicious stuff going around the Internet.

You may do better to use the IBIMR_user value to simply skip that part of the source code in the unit that is presented to them. If you put the entire html file you want to present inside an HTMLFORM BEGIN/HTMLFORM END block in a Focexec (that is, code it as a focexec instead of an html file in WF) you can use the IBIMR_user variable to simply step past the group box. An IF statement would do the trick.

With this method the source code is adjusted on the server prior to being delivered to the client's browser, so you have guaranteed control of what they get and what they can do with it.

You're essentially using the focexec as a jsp where you can adjust the source code returned based upon the user's information. This will give you a guaranteed result regardless of the browser's js configuration.

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report 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     [WORKAROUND] Assign Parameter value using Javascript

Copyright © 1996-2020 Information Builders