You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by mt...@apache.org on 2007/04/11 20:06:51 UTC
svn commit: r527644 -
/incubator/xap/trunk/codebase/src/xap/bridges/dojo/DojoDatePickerBridge.js
Author: mturyn
Date: Wed Apr 11 13:06:51 2007
New Revision: 527644
URL: http://svn.apache.org/viewvc?view=rev&rev=527644
Log:
1.) Updated onCommand event trigger from peer.onSetDate (dojo0.3) to peer.onValueChanged (dojo0.4).
2.) Wrote bridge-specific method to bring format information along with date value to the clientEvent
Modified:
incubator/xap/trunk/codebase/src/xap/bridges/dojo/DojoDatePickerBridge.js
Modified: incubator/xap/trunk/codebase/src/xap/bridges/dojo/DojoDatePickerBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/bridges/dojo/DojoDatePickerBridge.js?view=diff&rev=527644&r1=527643&r2=527644
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/bridges/dojo/DojoDatePickerBridge.js (original)
+++ incubator/xap/trunk/codebase/src/xap/bridges/dojo/DojoDatePickerBridge.js Wed Apr 11 13:06:51 2007
@@ -47,15 +47,30 @@
);
+
xap.bridges.dojo.DojoDatePickerBridge.prototype.init = function() {
xap.bridges.dojo.DojoDatePickerBridge.superclass.init.call(this);
-
// attach peer methods:
this.autoAttachBridgeEventsToPeerEvents() ;
}
+xap.bridges.dojo.DojoDatePickerBridge.prototype.onValueChanged = function(newDate,fireAs){
+ var clientEvent = new xap.session.ClientEvent(this.getElement(),this.getSession());
+ clientEvent.eventObject = newDate ;
+ clientEvent.date = newDate ;
+ clientEvent.format = this.getFormatStringAttribute() ;
+ var evtName = fireAs ;
+ if (!fireAs ){
+ evtName = "onValueChanged" ;
+ }
+ return this.fireEvent(evtName,null,null,clientEvent) ;
+}
+xap.bridges.dojo.DojoDatePickerBridge.prototype._onCommandEvent = function(newDate){
+ this.onValueChanged(newDate, "onCommand") ;
+}
+
xap.bridges.dojo.DojoDatePickerBridge.prototype._peer = null ;
@@ -72,11 +87,12 @@
* which is just a wrapper for <code>this.fireEvent("onCommand")</code>.
**/
xap.bridges.dojo.DojoDatePickerBridge.prototype.getPeerOnCommandEvent = function(){
- return "onSetDate" ;
+ return "onValueChanged" ;
}
+
/**
* Sets the widget as our peer, upgrades it with new methods to adapt it to our use:
**/
@@ -97,14 +113,6 @@
-/**
- * Just testing that the superclass' event-mapper doesn't destroy any explicitly-defined
- * events---if this weren't defined here, a default <code>onIncrementYear</code>
- * would be created for the peer wrappering <code>this.fireEvent("onIncrementYear")</code>.
-**/
-xap.bridges.dojo.DojoDatePickerBridge.prototype.onIncrementYear = function(){
- alert("Year value changed.") ;
-}
xap.bridges.dojo.DojoDatePickerBridge.prototype.setFormatStringAttribute = function(aString){