This message has been edited. Last edited by: Kerry,
WebFOCUS 8.0.08 Solaris HTML, PDF, XLS, CSV
November 08, 2010, 02:23 PM
Prarie
What happens when they click on the dates? Do they get an error? If so...what is it.
November 08, 2010, 02:26 PM
Suzy
Nothing happens, the onChange event doesn't get called.
WebFOCUS 8.0.08 Solaris HTML, PDF, XLS, CSV
November 09, 2010, 03:48 AM
Wep5622
Yeah, the date control doesn't seem to be quite complete and apparently contains a bug where it doesn't always apply the "right" date-formatting before posting it. Which brings me to the issue that there doesn't seem to be a way to specify what date-format it should be using at all, that's bound to cause problems sooner or later. I don't know who implemented that control, but it almost seems like they stopped working on it half-way through...
I usually include below javascript for HTML forms that make use of the calendar control. It overrides one of IBI's functions to change its behaviour. You may not need all of it, it's not entirely clean; I rolled my own event-attach function - there's probably one in the IBI code-base, but I didn't bother searching for it.
Still, it would be better if we'd get a complete implementation that handles
the onchange event when people type a date in the text field, and
for which you can specify what date-formats it should be using for displaying data and for posting data to the focus procedure handling the results (these are often different in my experience).
Right now we have to "parse" the posted date, as it can be in either of two formats!
// Event handler to add rawvalue after calendar field was changed by hand
function calendarChanged(obj, event) {
obj.setAttribute("rawvalue", obj.value);
}
/*
* Override WebFOCUS version with one adding an onchange event handler
*/
function setupDocCalendars()
{
var coll = document.getElementsByTagName("INPUT");
for( var i = 0; i < coll.length ; ++i )
{
oCtrl = coll[i];
if(oCtrl.getAttribute("elementtype") != 14) continue;
var ibiFormat = _getCalendarProperty(oCtrl, "ibiformat");
if( isATextControl(oCtrl) &&
0 == oCtrl.readOnly &&
'none' != oCtrl.style.display &&
'hidden' != oCtrl.style.visibility &&
ibiFormat != null &&
isYMDCombo(ibiFormat)
) {
setupCtrlCalendar( oCtrl, ibiFormat);
addEventHandler(oCtrl, "change", calendarChanged);
}
}
return;
}
function addEventHandler(obj, eventType, callback) {
if (obj.addEventListener) {
obj.addEventListener(
eventType,
function() { callback(obj, eventType); },
false
);
} else if (obj.attachEvent) {
obj.attachEvent(
'on' + eventType,
function() { callback(obj, eventType); }
);
}
}
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 :
November 09, 2010, 09:50 AM
dhagen
Your onchange function is attached to the onFocus event .... you might want to mess with that a bit.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
November 23, 2010, 11:35 AM
Suzy
Adding an onmousemove event to the BODY fixed this.
WebFOCUS 8.0.08 Solaris HTML, PDF, XLS, CSV
April 04, 2013, 01:01 PM
Francis Mariani
Hmmm, added the onmousemove event to the body tag, via point-and-click. The function called in this event function has an alert. As soon as I added the onmousemove event, I got an endless loop of alert - had to use Windows Task Manager to kill Dev Studio.
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
April 05, 2013, 02:10 PM
Francis Mariani
It looks like the following works in versions prior to v8:
Put the Calendar Control in a container and add an onmouseover event handler to the container.
I added the onmouseover event handler to the gold (Salmon?) panel.
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