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     [SOLVED] Dev Studio HTML Composer - Calendar - Default Date

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Dev Studio HTML Composer - Calendar - Default Date
 Login/Join
 
Expert
posted
I've searched the forum and it seems like you require JavaScript to set a default date for a Calendar control.

I'm working with v7.7.03 - does any one know if this much-appreciated function is built in to the GUI?

I have a Date with Data type set to static and Date Range set to Relative with a range of five years. I can set a default date in the Selected Value by typing a date, but I'd like that to be a variable, which seems to me as more useful.

Any ideas? I guess I'll have to do it with JavaScript if this is not built-in.

Thanks,

This message has been edited. Last edited by: Francis Mariani,


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
Solved!

I added this in the fex that includes the parm screen:
-* Determine Previous Business Date for parameter screens
-SET &PREV_BUS_DT =
- DATECVT(( DATEMOV((DATECVT(&YYMD,'I8YYMD','YYMD')),'PBD')),'YYMD','I8YYMD');
-SET &PREV_BUS_DT = EDIT(&PREV_BUS_DT,'9999/99/99');


Then I set the Selected Value for the Calendar control to
!IBI.AMP.PREV_BUS_DT;


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
Virtuoso
posted Hide Post
Yep! That's the way to do it.

Have you tried using &PREV_BUS_DT directly in the HTML?

Apparently you can do that now ... at least that's what I found the hard way. I had some   HTML attributes here and there in my HTML code for "styling" and when I run the form I could see a bunch of semicolons in my screen ... apparently the engine tried to resolve &nbsp to a variable (which was empty) leaving the ';' alone Frowner



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
Just for the record, I'm sticking to the proven and classic method of !IBI.AMP.zzz; I think loyalty always pays off in the long run ... Music



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
Me too!

I think the Amper method is even older than the Bang method...


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
Silver Member
posted Hide Post
Upgrading from 7.6.11 to 7.7.3 we found that date amper variables generated from the java calendar of an html launch are passed in DevStudio with slashes.
7.6.11 > &beg_date=20110621
7.7.3 > &beg_date=2011/06/21
The field on the launch page displays the date as '2011/06/21' in both versions but 7.7 actually loads the slashes into the &variable
Has anyone else seen this? Is there a way to configure how the fex gets the variable?


8105 Tomcat and AIX reporting server
input: Teradata, SQL, DB2, Essbase, Oracle, text
output:html, excel, PDF,
 
Posts: 35 | Location: DFW Texas | Registered: May 30, 2008Report This Post
Virtuoso
posted Hide Post
I have. I even filed a bug report about it with IBI.

According to IBI, the behaviour in 7.6.11 is at fault. It has only behaved like that for a few hotfixes too.

The numeric format is much more convenient to work with for us, as our dates are stored in the database in the same fashion. Unfortunately for us, the rest of the world seems to have moved on :P


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Platinum Member
posted Hide Post
Francis,
I saw this old post you submitted. I like to do the same with previous date as well. However, when I place !IBI.AMP.PREV_BUS_DT; on the Selected Value section of HTML Composer I do not get the correct date. What I get is the text !IBI.AMP.PREV_BUS_DT; being displayed. I added your sample code to the fex as well. Any help you could provide would be appreciated.

Thanks,

Joe


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Expert
posted Hide Post
This will happen if &PREV_BUS_DT does not exist. Check the variable name in both the fex that creates it and the html form it is referenced in.

Perhaps providing the code will help us.


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
Virtuoso
posted Hide Post
In order to use !bang variables in your HTML, I believe your HTML page must be called from within a focexec via the -HTMLFORM command. If you are not using -HTMLFORM, you can populate your date input object either with a JavaScript function, or via a focexec that generates the date in XML format and is linked to the HTML date object as a dynamic, external source in HTML Composter.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
Dan, thanks for the explanation, I didn't think of mentioning it.


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
Virtuoso
posted Hide Post
Francis, good to have you back.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Platinum Member
posted Hide Post
Thanks..Was hoping the HTML composer would except it.


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Platinum Member
posted Hide Post
Francis, I have the same issue with JOE. I put !IBI.AMP.PREV_BUS_DT; in the Selected Value for the calendar control. When I run HTML Composer, I just got that text !IBI.AMP.PREV_BUS_DT; in calendar box. Did I do wrong ? Here is my sample code:
-SET &ECHO=ALL;
-SET &PREV_BUS_DT= DATECVT(( DATEMOV((DATECVT(&YYMD,'I8YYMD','YYMD')),'PBD')),'YYMD','I8YYMD');
-SET &PREV_BUS_DT = EDIT(&PREV_BUS_DT ,'9999/99/99');
TABLE FILE SALE
PRINT 
     NAME
     DATE
WHERE DATE LT '&PREV_BUS_DT';
END
  

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


WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 125 | Registered: June 17, 2013Report This Post
Virtuoso
posted Hide Post
I don't see an -HTMLFORM in your post, perhaps that's why it doesn't work for you?

I don't see the relevance of that TABLE request in there. Besides, if that's from passthru SQL, shouldn't you be putting that WHERE-clause in the SQL so that you don't fetch data that you do not need?

BTW, in your footer it says WebFOCUS 7.6 - which one? There have (unfortunately) been some major changes in 7.6 after 7.6.9, so it matters. If you're at the upper end of that version, you could also get your date in using Dan's suggestion.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Gold member
posted Hide Post
Hi

The best method to do this is to write an external procedure to load a hidden control with the date. Then take the date from the control and set the calendar control with that date. You can open a case up for this issue and we can find out were the problem is. Francis is correct that the fex must call the HTM page using HTMLFORM htmname... to pass the !IBI.AMP.AMPNAME; but the division does not like that approach.

Thanks Barry


WebFOCUS 8103, Windows, App Studio
 
Posts: 80 | Location: NYC | Registered: November 13, 2008Report This Post
Platinum Member
posted Hide Post
Sorry, this is just a sample code and I didn't check it again. I just changed it. I just get data from the normal table. My current version of WF now is 7.7.03. -HTMLFORM is confusing me. I am working on HTML Composer, I put Calendar control in this composer and just put !IBI.AMP.PREV_BUS_DT; in Selected Value textbox. If I add -HTMLFORM, where should I put this ?


WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 125 | Registered: June 17, 2013Report This Post
Virtuoso
posted Hide Post
-HTMLFORM is a dialog manager command, so you have to put it in a procedure/fex. The same one where those variables you intend to use are defined.

In HTML Composer, they'll still show up as !IBI.AMP.etc, as HTML Composer only opens the HTML and not the procedure.

I'm not sure what you changed about your sample procedure, but that TABLE request does not seem relevant to the issue you're trying to solve.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Platinum Member
posted Hide Post
Thanks BarryS and Wep5622. This helps. I wish IBI can add this feature that let users select current date or dates relative to the current date for Selected Value in HTML Composer like what they did very awesome for letting users select Start date and End date. I think this is standard, better than just let users enter the static value in that Selected Value textbox.


WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 125 | Registered: June 17, 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     [SOLVED] Dev Studio HTML Composer - Calendar - Default Date

Copyright © 1996-2020 Information Builders