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     [SOVLED] Default dynamic parameter in html page

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOVLED] Default dynamic parameter in html page
 Login/Join
 
Gold member
posted
How can I default a dynamic dropdown parameter in an htm file based on the &FOCSECUSER? I have a fex that retrieves the States from a table and that is how I get the States drop down parameter in the html page. Right now I have the Add "ALL" option checked off so that is always the first option. I need to be able to default to say for example: "FL" if &FOCSECUSER is "Gary".

This message has been edited. Last edited by: Mikey,


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report This Post
Virtuoso
posted Hide Post
Haven't been tested, but something like this.
In a fex, assign a variable to the State you want for the user.
Below SET is not the better way to do it, but if you can have it from a TABLE FILE, it will be better:
-SET &#DFLSEL = DECODE &FOCSECUSER ('Gary' 'FL' 'Ted' 'NY' ELSE '_FOC_NULL');


In your HTML (where DropList is the unique identifier of your control):
function onInitialUpdate()
{
	dflSel = '!IBI.AMP.#DFLSEL;';
	IbComposer_setCurrentSelection('DropList', dflSel, false);
}


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
im not 100% sure if this is the solution Im loking for. What I have now is a parameter for States that is a drop down. I also created a fex that just returns the current user and added that as a hidden parameter. is there a javascript way to say: if user parameter = Gary then State default FL, if user = Jim then State default CA else _FOC_NULL. Also, if Gary runs report and the default is FL, he still needs to be able to see all other states in the drop down so he can change it.


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report This Post
Virtuoso
posted Hide Post
Indeed, it's the solution.

From your fex that returns the current user, assign the default State as well as I shown in my previous post (the DECODE statement).
If the default State can be retrieve from a TABLE it's even better.
Doing it from the fex it's easier than doing it in JS.

Then the code in onInitialUpdate() function only assign a the selected value for the dropdown.
Your dropdown for States must still be filled with your fex that list every States.
onInitialUpdate() is ran after all the default are loaded.


Otherwise in JS it may look something like this
function inInitialUpdate()
{
	logUsr = IbComposer_getCurrentSelection('HiddenParmLogUser');


	if (logUsr == 'Gary')
		IbComposer_setCurrentSelection('StateDropList', 'FL', false);
	else if (logUsrl == 'Jim')
		IbComposer_setCurrentSelection('StateDropList', 'CA', false);
	else
		IbComposer_setCurrentSelection('StateDropList', '_FOC_NULL', false);
}


But having hard coded user's name it's really not the good thing to do.

This message has been edited. Last edited by: MartinY,


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
Hi Mikey

You can get the userid and put in a default and return it to a hidden control and in onInitialUpdate function you can IbComposer_setCurrentSelection( controlName, IbComposer_getCurrentSelection( hiddenControlNamed), false); if you have any issues open a case and ask for Barry.

Thanks Barry


WebFOCUS 8103, Windows, App Studio
 
Posts: 80 | Location: NYC | Registered: November 13, 2008Report This Post
Gold member
posted Hide Post
MartinY,
This is my first attempt at JavaScript and your second post helped it make more sense and this works, thanks!

function onInitialUpdate()
{
dflSel = IbComposer_getCurrentSelection('USER_STATE');
IbComposer_setCurrentSelection('STATE', dflSel, false);
}

BarryS, this looks similar to what you recommended too.

Thanks!


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report This Post
Virtuoso
posted Hide Post
My pleasure.

Edit the first post of this thread and add [SOVLED] at the beginning of the subject.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
Will do. And wanted to mention, there is a "Save Selections Button" I just found out about from a co-worker. Apparently we are going to use that now.


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report This Post
Virtuoso
posted Hide Post
You know that the "SaveSelection" button will only save the selections made by the user from your HTML page ? It is saved into a file which can be then re-opened and have the HTML already filled up with saved values.
Each saved file will be located under user's personal folder.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
Yes, Ive emailed this javascript option too and let the business decide. Thanks again!


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report 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     [SOVLED] Default dynamic parameter in html page

Copyright © 1996-2020 Information Builders