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 am trying to incorporate the Monthpicker widget into my html. So far, i was able to populate the widget. But when i clicked on a month, the value does not get populated in the edit box.
Are you certain that you don't have multiple elements with id 'demo1'? Are there any errors on the javascript console? Does it work in a simple (hand-crafted) HTML, without all the stuff IBI generated?
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 :
Originally posted by Wep5622: Are you certain that you don't have multiple elements with id 'demo1'? Are there any errors on the javascript console? Does it work in a simple (hand-crafted) HTML, without all the stuff IBI generated?
There is only one id with 'demo1' and no errors showed in the console. I tried the concept on a simple html outside of webfocus and it worked without any issues. Here is the code
Instead of calling this from within the "window_onload" function, add the "onInitialUpdate" function and call it from within that.
The "onInitialUpdate" function is designed for things such as this whereas the "window_onload" may not have completed the DOM build before your function is called.
Use the developer tools for the browser to check that your JS library is loaded and to step through, checking for errors etc.
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
You didn't include jquery in your IBI-generated html, did you? That may cause a nasty timing issue where the MonthPicker gets initialised using the IBI-provided jquery, while afterwards that gets replaced with the version you provide. That would probably loose state, including that of the MonthPicker.
Checking whether it does work from the onInitialUpdate() function is worth trying. However, the widget does display, which seems to suggest that:
a JQuery library finished loading
the element referenced with $('#demo1') exists in the DOM at that point,
the MonthPicker.js finished loading.
That seems to indicate that the call to LoadCusMthWidget() is not too early (unless above scenario is happening).
Nevertheless, verifying this with calls to console.log() or alert() should help diagnosing this.
One word of warning with console.log(); when you log an object value (as opposed to a scalar value) and click on it for details, you get the contents of the object in the state it is in when you click it, not the state when it got logged to the console. If you want to check its state when it was logged, log the actual properties of the object that you want to verify.
Another possibility; perhaps the JQuery libraries provided with IBI are not compatible with the monthpicker. Does your simple html still work if you reference IBI's provided jquery libraries?
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 :
I placed this within an app folder with the necessary changes to the JS and CSS etc. and it does load OK as WEP suggests. I still tend to place all calls within the "onInitialUpdate" function though.
I also stepped through the process when clicking on a month "button" and it appears that a null value is returned to the function. I can't tell whether this gets populated into the control but there are no other errors that I can see.
I would highlight what WEP suggests are regards the version of jQuery included within the HTML page. Check it using the browser developer tools as I suspect that you will find the version loaded is not recent.
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
I also pushed this through using the jQuery libraries from the same location as the WF built page and it does function with the jQuery.min.js (version v2.1.4) OK and returns the correct value.
Retesting the WF created one (even recreating a copy of you sample from scratch) and the returned value within the MonthPicker.js is null.
You need to dig further I'm afraid.
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
Hi CoolGuy, Hmmm it might. I'm curious for future needs, how would I know that jQueryUI date picker is "officially supported"? In this case, I need something that guides the user to choose only a month/year combo. Showing them a _day_ picker but then only using the month/year would be confusing.
I was able to get the MonthPicker to work with a little fussing. I had to extract the year and month and then update the value of the edit box instead of letting MonthPicker do it automatically.
jQuery('.MonthPickerClass').MonthPicker({ ShowIcon: false, MinMonth: '-2y -6m', MaxMonth: 0, OnAfterChooseMonth: function( selectedDate ){ var myMonth = selectedDate.getMonth()+1; var myYear = selectedDate.getYear()+1900; var myMonthYear = myMonth +'/'+myYear; document.getElementById("Edit1").value=myMonthYear; } });
jQueryUI along with jQuery are used everywhere by many. Huge community behind it. I wouldn't be too worried about future support.
As for your scenario, and looking at your use case--in that you only are concerned for the month as a whole--it wouldn't make much sense for the user to be able to pick a day from a month, huh? haha Maybe you're better off w/a custom library then.
Sorry for the confusion.
8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
Posts: 1113 | Location: USA | Registered: January 27, 2015
Who wants simple these days? Get with the times man! ;-) Kidding! Yeah, that would be a good solution. Just write up some requests that you could tie to the drop downs (external procedures). Good idea!
8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
Posts: 1113 | Location: USA | Registered: January 27, 2015