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.
I have written a js function to add to my html page to populate a calendar with the first day of the current month. I think I have the code correct I get the alert when I run it outside of WF however when I put it in the html composer it doesn't do anything. Here is the code. Any help would be appreciated.
if(typeof(bRuntime) != 'undefined') { // TODO: Add your inline runtime code here } //Begin function window_onload function window_onload() { UpdateData(); // TODO: Add your event handler code here //add onInitialUpdate() function to make changes before initial run of the reports function newdate_start() { var date = new Date();var firstDay = new Date(date.getFullYear(), date.getMonth(), 1); var startdate = (firstDay.getMonth() + 1) + '/' + (firstDay.getDate()) + '/' + firstDay.getFullYear(); alert(startdate);} }This message has been edited. Last edited by: <Emily McAllister>,
How are you calling your function? If you do not call it then it will not execute.
If you need this to run after the document is fully loaded then look at the line above your function - there's a big clue there!
Alternatively you could use a $(document).ready() call.
If none of this means anything to you then you may benefit by visiting w3schools.com and running through some tutorials on HTML, JavaScript and jQuery.
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
If we take your code and clean it up so we can see possible issues, we get this:
if(typeof(bRuntime) != 'undefined') {
// TODO: Add your inline runtime code here
}
//Begin function window_onload
function window_onload() {
UpdateData();
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
function newdate_start() {
var date = new Date();var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
var startdate = (firstDay.getMonth() + 1) + '/' + (firstDay.getDate()) + '/' + firstDay.getFullYear();
alert(startdate);
}
}
Did you mean to put newdate_start() method inside of the window_onload() method?
Maybe you meant to do this:
if(typeof(bRuntime) != 'undefined') {
// TODO: Add your inline runtime code here
}
//Begin function window_onload
function window_onload() {
UpdateData();
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
newdate_start();
}
function newdate_start() {
var date = new Date();var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
var startdate = (firstDay.getMonth() + 1) + '/' + (firstDay.getDate()) + '/' + firstDay.getFullYear();
alert(startdate);
}
- FOCUS Man, just FOCUS! ----------------------------- Product: WebFOCUS Version: 8.1.04 Server: Windows 2008 Server
Gavin, Thank you and sorry if the code pasted in poorly. My explanation of my issue sucked, What I need to do is get the first day of the current month, load it into the calendar1 box in my html form so that all reports in my portal run with that as the default start date. I already have the end date set the way I need it, I just don't know anything about where to add JS inside the composer to make it work, and the solutions I found in the knowledge base don't do what I need. Thanks again for the information I think if I understand your answer and do it this way it should do what I want to do.
function newdate_start() {
var date = new Date(); // Current day, this month
date.setDate(1); // Start of current month
// I concatenate strings like this; the result is the same as your concat.
var startdate = ([date.getMonth() +1, date.getDate(), date.getFullYear()]).join('/');
// alert(startdate);
// Use it in an IBI date control using JQuery (don't forget the leading #)
$('#uniqueIdentifierOfYourDateControl').val(startdate);
}
Now it is possible that the value you set this way on load gets overwritten by the IBI chaining code, which runs code to fill controls on load as well. If that happens, move the call to this function into a (new) function onInitialUpdate().
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 :
Hi Barry, Long time no talk to....... It is great to hear from you. Thanks for the suggestion, it didn't fix the issue I was having however your input is always welcome.
Thanks for all the information and suggestions, I now have my calendar control displaying the first day of the current month in the control,,,, YEA, only one issue left to resolve. All of the reports in the portal are running on the default date in the fexes rather than with the new default in the cal control...... can't just remove the default, that doesn't work either.... I am sure this is something real simple that I am just missing..... oh Monday... how I lov you...NOT
I see you asked another question. If the parameters are not being passed to the report add in the following at the top of the focexec:
-SET &ECHO=ALL; -? &
Once the report appears - right mouse click and select view source, scroll until you see the list of variables appear ( usually green text). Check to see if your variables are listed. Check within the code to see if the values are being picked up.
WebFOCUS Version 8 Technical Library Above is the link to the document library. Click the "+" to open the links. Assuming you are using Dev Studio along with BI Portal - refer to the Developer Studio, Reporting Language, Reporting Tools and Business Inteligence Poral links for further documentation.
Post another topic for this specific question - this might generate more assistance for you too.
Thank you for participating in the Focal Point Forum.
Kind Regards, Tamra Colangelo IBI Focal Point Moderator
WebFOCUS 8x - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
Posts: 487 | Location: Toronto | Registered: June 23, 2009