| Summary: | Cannot initialize a Dojo calendar with the value property or on-construction function | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Ben Margolis <margolis> | ||||||
| Component: | EDT | Assignee: | lu lu <lulu> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | hjiyong, jinfahua, svihovec | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Had taken new comer training on Tue and Wed, and will take vacation from 1.20 to 1.28, so need to defer this defect to 0.8.0 I2. Thanks. This does not appear to be a regression from .7, so I agree with deferring it until I2. Hi Ben,
Can you provide me with the build version? I am using the latest build - 0.8.0.v201201290903, and find some methods/properties should have been removed.
Eg. The property of 'strLib.defaultDateFormat' has been removed.
And for all Dojo widgets, they have an event named 'onWidgetLoad', in this method, you can use Calendar.value or Calendar.setValue("2004/04/08") to set the default DojoCalendar date value.
********************************************************************
function Calendar_onWidgetLoad(event Event in)
Calendar.value = DateTimeLib.dateFromGregorian(20040408);
//Calendar.setValue("2004/04/08");
end
********************************************************************
yes, defaultDateFormat is gone. in the nightly build (1/29), the code shown later works as you say.
is it impossible to cause an initialization to occur in the same two ways that initilization occurs in any non-Dojo widget? the two ways:
o in the widget declaration
o in the on-construction function
if we can initialize the value in those locations, we should because then the EGL technology is consistent.
does Dojo widget initialization typically require that the EGL developer invoke the onWidgetLoad function?
************
package client;
import org.eclipse.edt.rui.widgets.GridLayout;
import org.eclipse.edt.rui.widgets.GridLayoutData;
import dojo.widgets.DojoCalendar;
import eglx.ui.rui.RUIHandler;
handler MyHandler type RUIhandler{initialUI =[ui],
onConstructionFunction = start,
cssFile = "css/MyRichUIProject.css",
title = "MyHandler"}
ui GridLayout{columns = 3, rows = 4, cellPadding = 4, children =[myCalendar]};
myCalendar DojoCalendar{layoutData = new GridLayoutData{row = 2, column = 2},
onWidgetLoad ::= onWidgetLoad };
function start()
myCalendar.value = "01/01/2015"; // does NOT work
end
function onWidgetLoad(event Event in)
// myCalendar.value = DateTimeLib.dateFromGregorian(20040408);
myCalendar.value = "01/01/2016";
end
end
Created attachment 210548 [details]
Initial dojoCalendar with set value
Initial dojoCalendar widget using the set value instead of current date(new date{}).
DojoCalendar widget can be used by those two ways:
1. newcalendar DojoCalendar{ layoutData = new GridLayoutData{ row = 2, column = 2 }, value = "02/02/2018"}; <In DojoCalendar declaration>
2. function start()
Calendar.value = "01/01/2018";
end
<In start() function>
Hi JiYong, please help to review my changes. If you don't have other comments, please help to deliver it. Thanks. :-)
Created attachment 210549 [details]
set value while initializing dojoCalendar widget
Using base methods '_setProperty/_getProperty' to replace 'this.dojoWidget.attr' method.
Thanks.
Comment on attachment 210549 [details]
set value while initializing dojoCalendar widget
Committed
Resolve this bug. JiYong, Thanks. confirmed in the Feb 20 build. thank you. |
1. The initial value property has no effect: 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 = [ myCalendar ] }; myCalendar DojoCalendar{ layoutData = new GridLayoutData{ row = 2, column = 2 }, value = "01/01/2014" }; function start() // strLib.defaultDateFormat = "yyyy/MM/dd"; // myCalendar.value = "2015/01/01"; end end 2. You also get no effect if you remove (or keep) the value and uncomment the statements in the start function.