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     [CASE OPENED] Dynamic Selected Value for parameters in HTML

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CASE OPENED] Dynamic Selected Value for parameters in HTML
 Login/Join
 
Gold member
posted
Seemingly simple question, but;

I have a yyyymm parameter and I want the HTML Selected Value to default to the current month.

In a Fex I would use (&YYMD / 100). When I try this in the HTML it just defaults to the top value.

Thanks!

This message has been edited. Last edited by: Nicholas Spyrison,


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Virtuoso
posted Hide Post
Use
-* With slash
-SET &WSLASH = &DATEYYM;
-TYPE &WSLASH
-* Without slash
-SET &WOSLASH = EDIT(&DATEYYM,'9999$99');
-TYPE &WOSLASH


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
OK, then I plug &WOSLASH in the Selected Value in the HTML and defaults to the top value.

Will the HTML Page evaluate &WOSLASH ?


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Virtuoso
posted Hide Post
Yes, using something such as:
YourField.value = '!IBI.AMP.WOSLASH;';


But &WOSLASH as to be initialized in a fex which call the HTML.

Or other technics are available depending on the nature of your parameter that must have the WOSLASH value.


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
Do this in the Embedded JavaScript/CSS tab?

I have Selected Value: &CURYM
and the the following in the JS/CSS:
 DM.DM.Date_Calendar_Month_YYYYMM.value = '!IBI.AMP.CURYM;'; 


Still no dice


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Virtuoso
posted Hide Post
Yes in the embedded javascript tab.
Try displaying your value first to be sure that it is properly initialized:
var curval = '!IBI.AMP.CURYM;';
alert (curval);


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
returns
 !IBI.AMP.CURYM; 


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Virtuoso
posted Hide Post
Create a procedure (fex) in DefaultDomain with the following:
-SET &CURYM = EDIT(&DATEYYM,'9999$99');
-HTMLFORM IBFS:/WFC/Repository/DefaultDomain/z.htm


Then create an HTML form (named "z" as per my sample) in the same Content having this in the embedded java script tab

function window_onload() {
 
UpdateData();

var curval = '!IBI.AMP.CURYM;';
alert (curval);
}


Then run the procedure, you should have a popup displaying 201509.


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
I have the popup displaying 201509.

commented out the alert.

It looks like it is trying to replicate the HTML file with the fex's frame. Do I need to specify a frame in the html filepath?

I also have curval in the Selected Value box it populates the first value rather than 201509.


Thanks for the continued support!


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Silver Member
posted Hide Post
Hi Nicholas

I just saw your post and if you are using App Studio go to the settings panel or in Dev Studio go to the properties and setting window and look for "Selected Value" that will be the default and if you want a dynamic value set the Dynamic radio button and select a proc which will return the current date or the calculated date for the control to use. In App Studio you can set the current date with a check box.

Thanks Barry


WebFOCUS 8
Windows, All Outputs
 
Posts: 34 | Registered: September 08, 2015Report This Post
Gold member
posted Hide Post
quote:
I just saw your post and if you are using App Studio go to the settings panel ... and look for "Selected Value" that will be the default and if you want a dynamic value set the Dynamic radio button and select a proc which will return the current date or the calculated date for the control to use.


Right I have all this, the date is stored in &CURYM, the "Selected Value" doesn't evaluate &CURYM how do I apply it?

quote:
In App Studio you can set the current date with a check box.

Where? still on the Settings tab. keep in mind that I need yyyymm rather than the date.


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Virtuoso
posted Hide Post
You can do this completely in JS. In an onInitialUpdate function, add:
    var d = new Date();
    var n = d.getMonth();
    var dt;
    if (n < 9) {
       dt = d.getFullYear().toString() + "/0" + (n+1).toString();
    } else {
       dt = d.getFullYear().toString() + "/" + (n+1).toString();
    }
    DM.DM.Date_Calendar_Month_YYYYMM.value = dt;
 


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Gold member
posted Hide Post
do so then how do I get the DM.DM.Date_Calendar_Month_YYYYMM.value dropdown conrol to default to dt?

I can't put dt in the "Selected Value" setting


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Virtuoso
posted Hide Post
All kinds of ways


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Gold member
posted Hide Post
function window_onload() {

    var d = new Date();
    var n = d.getMonth();
    var dt;
    if (n < 9) {
       dt = d.getFullYear().toString() + "/0" + (n+1).toString();
   } else {
       dt = d.getFullYear().toString() + "/" + (n+1).toString();
    }
    DM.DM.Date_Calendar_Month_YYYYMM.value = dt;


UpdateData();
}  


won't load. any thoughts?


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Virtuoso
posted Hide Post
Re-read my second last post carefully!

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


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Gold member
posted Hide Post
 function onInitialUpdate() {
    var d = new Date();
    var n = d.getMonth();
    var dt;
    if (n < 9) {
       dt = d.getFullYear().toString() + "/0" + (n+1).toString();
    } else {
       dt = d.getFullYear().toString() + "/" + (n+1).toString();
    }
    DM.DM.Date_Calendar_Month_YYYYMM.value = dt;
}
 


and without function and the code with-in parentheses doesn't work.


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report 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     [CASE OPENED] Dynamic Selected Value for parameters in HTML

Copyright © 1996-2020 Information Builders