Mit dem Widget 'DojoCalendar' wird ein Kalender erstellt.


Der Benutzer kann das Jahr ändern, indem er auf das linke oder rechte Jahr am unteren Rand des Kalenders klickt.
Sie können das Datum abrufen oder festlegen. Der Standardwert ist das aktuelle Datum.
function isSelectorOpen() returns (boolean);
Weitere unterstützte Eigenschaften und Funktionen sind in 'Widgeteigenschaften und -funktionen' sowie in 'Widgetstile' beschrieben.
package myPkg;
import com.ibm.egl.rui.widgets.GridLayout;
import com.ibm.egl.rui.widgets.GridLayoutData;
import dojo.widgets.DojoCalendar;
import dojo.widgets.DojoButton;
import egl.javascript.Job;
handler MyHandler type RUIhandler {
initialUI = [ ui ], onConstructionFunction = start,
cssFile="css/MyRichUIProject.css", title="MyHandler"}
ui GridLayout{ columns = 3, rows = 4, cellPadding = 4,
children = [ myButton, myCalendar ] };
myCalendar DojoCalendar{ layoutData = new GridLayoutData{ row = 2, column = 2 },
value = DateTimeLib.currentDate() };
myButton DojoButton{ layoutData = new GridLayoutData{ row = 4, column = 2 },
text = "Is the month selector open?",
onClick ::= myEventHandler};
doThis Job{runFunction = myRunFunction};
function start()
strLib.defaultDateFormat = "yyyy/MM/dd";
end
function myEventHandler( e event in)
doThis.repeat(1000);
myCalendar.value = "2012/04/08";
end
function myRunFunction()
isListBoxOpen Boolean = myCalendar.isSelectorOpen();
writestdout ("The selector is open: " + isListBoxOpen);
if (isListBoxOpen)
doThis.cancel();
end
writestdout ("The date is " + myCalendar.value);
end
end