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     [CLOSED]-DEFAULT prompt to show the value of an amper variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]-DEFAULT prompt to show the value of an amper variable
 Login/Join
 
Master
posted
I have the following code to dynamically choose a 4 week period:
 
-SET &DATE1 = AYMD ( &YYMD , - 35 , 'I8YYMD'); 
-SET &BEGDATE = AYMD ( &DATE1 , - DTPART( '&DATE1', WEEKDAY ) + 1 , 'I8YYMD'); 

-SET &DATE2 = AYMD ( &YYMD , - 7 , 'I8YYMD'); 
-SET &ENDDATE = AYMD ( &DATE2 , - DTPART( '&DATE2', WEEKDAY ) , 'I8YYMD'); 

-DEFAULT &FROM_DATE = &BEGDATE.EVAL;
-DEFAULT &TO_DATE = &ENDDATE.EVAL;

-TYPE &FROM_DATE.EVAL
-TYPE &TO_DATE.EVAL
 


I would like to have the default parameters actually show the amper values of 20160403 and 20160430 in this example. The values are passed as you can see in the -TYPE output, but I would like to see those values in the prompt that the end user will see to give them the option to change the date if they would like.

This message has been edited. Last edited by: <Emily McAllister>,


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Master
posted Hide Post
The auto prompt is because you don't have a value in it. If your wanting to prompt with default values, then you need to build your page to prompt via your own code, then pass the values to use.

-DEFAULT &FROM_DATE = _FOC_NULL;
-DEFAULT &TO_DATE = _FOC_NULL;

-SET &DATE1 = AYMD ( &YYMD , - 35 , 'I8YYMD');
-SET &BEGDATE = AYMD ( &DATE1 , - DTPART( '&DATE1', WEEKDAY ) + 1 , 'I8YYMD');

-SET &DATE2 = AYMD ( &YYMD , - 7 , 'I8YYMD');
-SET &ENDDATE = AYMD ( &DATE2 , - DTPART( '&DATE2', WEEKDAY ) , 'I8YYMD');

-IF &FROM_DATE EQ _FOC_NULL THEN GOTO PROMPTDATA;

-TYPE &FROM_DATE
-TYPE &TO_DATE
-GOTO EOF

-PROMPTDATA
-HTMLFORM BEGIN
<html>
<script>
function submit() {
	var from_date = document.getElementById('FROM_DATE').value;
	var to_date = document.getElementById('TO_DATE').value;
	var url=location.href+'&|FROM_DATE='+from_date+'&|TO_DATE='+to_date;
	location.href=url;
}
</script>
<style>
.button {
	width: 60px;
	height: 20px;
	line-height: 20px;
	background-color: #c0c0c0;
	border: 1px solid #000;
	cursor: pointer;
	text-align: center;
	margin: 2px;
	color: #fff;
}
</style>
<body>
From Date: <input id="FROM_DATE" name="FROM_DATE" value="&BEGDATE.EVAL"><br/>
To Date: <input id="TO_DATE" name="TO_DATE" value="&ENDDATE.EVAL"></br>
<div class="button" onclick="submit()">Run</div>
</body>
</html>
-HTMLFORM END
-EOF



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Guru
posted Hide Post
Good One


WebFOCUS 8.1.05 / APP Studio
 
Posts: 272 | Location: Brazil | Registered: October 31, 2006Report This Post
Master
posted Hide Post
...or make an HTML.

And dynamically fill the inputboxes with a .fex ( producing an XML ) with the correct value.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Master
posted Hide Post
quote:
...or make an HTML.

And dynamically fill the inputboxes with a .fex ( producing an XML ) with the correct value.


That's basically what my code does. It's an HTML within a fex and auto fills with set defaults.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Master
posted Hide Post
Gavin,

I know. But it's handcoded.
If you just make an .fex like:

 TABLE FILE CAR
 SUM FST.CAR
 BY HIGHEST 1 COUNTRY
 ON TABLE PCHOLD FORMAT XML
 END


You can do the rest in the HTML-composer GUI. ( without coding )
And you can even reuse it for other HTML-screens.



...
Or do it like this:
I use this to drill from a list to a HTML-prompt screen and auto-run.
The user can also directly start the HTML-prompt screen without auto-run.

-DEFAULTH &SELECTED_LIST_VALUE = '';
-* prevent auto-prompting 

-HTMLFORM IBFS:/WFC/Repository/d1frsupp/std_reports/1026/1026_artikelzoeker.htm

-IF &SELECTED_LIST_VALUE NE '' OR ' ' THEN CONTINUE ELSE EXIT;
-HTMLFORM BEGIN
<SCRIPT LANGUAGE='JSCRIPT'>
document.getElementById('input_user_value').value = '!IBI.AMP.SELECTED_LIST_VALUE;';
document.getElementById('form1Submit').click();
</SCRIPT>
-HTMLFORM END


...It can be done in all sorts of ways.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Master
posted Hide Post
I'm a big components of "handcoding" or find yourself limited to UI restraints and have your job replaced by a BA as it's no longer development if your relying on something to write the code for you.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Master
posted Hide Post
I'm a BA :-)


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report 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     [CLOSED]-DEFAULT prompt to show the value of an amper variable

Copyright © 1996-2020 Information Builders