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]Calendar - custom dates via fex

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Calendar - custom dates via fex
 Login/Join
 
Guru
posted
I've searched the forum and tech site to look for any case where someone had a need to populate calendar control with a specific list of dates using a focexec but almost all of them were about a dynamic range. Is it possible to control the dates in the calendar widget to show only ones from the fex and make the other dates disabled? We could use a dropdown list for dates but my customer insists to use the calendar widget with their own preset dates. Any thoughts or ideas please share.

Thanks in advance.

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


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
 
Posts: 289 | Location: Houston,TX | Registered: June 11, 2004Report This Post
Master
posted Hide Post
Your request is an interesting one. After poking around in the Firefox browser's Console mode, I've found what happens when a calender appears on screen...

HTML code is injected into the browser to build and populate the calendar control. The code looks something like this:

<div id="ui-datepicker-div" ...>
  <tr>
    <td data-year="2016" data-month="0" ...>
      <a class="ui-state-default" ...>
        26
      </a>

The calendar is an HTML DIV element, tr's are the rows of days in the calendar, td's are the individual days with year and month attributes, and a's are hyperlinks that activate when the user clicks the day. The day number itself is within the "a" tag.

So, to do what you want, you would need to retrieve the dates you want to enable from a WebFOCUS FEX file (In XML format to the web browser as destination for FEX file output), then use JQuery to inspect the td elements for year and month, then inspect "a" for the actual day. Using that information you can then know what day you are looking at in the calendar and compare it to your list of dates.

If the day/date does not match, you need to disable that day/date. This is how I thought I could disable all days using JQuery:

$("#ui-datepicker-div tr td a.ui-state-default").each(function(index) { $(this).switchClass("ui-state-default","ui-state-disabled") });

The JQuery code changes the "a" elements so their class is "ui-state-disabled", which grays out the calendar days. But I was still able to select a day even though it was grayed out. Attempts to make "a" not clickable did not work for me.

That's the best I've got for you so far... I hope it helps.

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


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Master
posted Hide Post
There is a much simpler way if you use the JQuery date picker.

Look at this example from stack overflow

Block out dates using JQuery


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Guru
posted Hide Post
Thanks guys,
I like Eric's link but is it possible to use in AppStudio by choosing it as WF calendar control?

Please help!


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
 
Posts: 289 | Location: Houston,TX | Registered: June 11, 2004Report This Post
Master
posted Hide Post
Yes, if you want to use an alternative approach you can do that. I was investigating it from the default WebFOCUS point of view.

You should have JQuery/JQuery UI enabled in your version of WebFOCUS already, you just need to call on it.

As a test, create a new HTML document, and then create a Panel component called "panel1". Then make sure this is in your "Embedded JavaScript/CSS tab:

//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
  $( "#panel1" ).datepicker();
}
//End function window_onload


You should see a JQuery calendar control.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Master
posted Hide Post
vaayu,

I've never seen that in the WebFOCUS Calendar control. But since JQuery is bundled as part of 8105, you don't need to add any calls to bring it in, just the JQuery code. Just as simple and a lot more customizable.

You will have to create a fex, that will return the dates to load in the date picker though. You can do that using JQuery also.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 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     [CLOSED]Calendar - custom dates via fex

Copyright © 1996-2020 Information Builders