You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Britske <gb...@gmail.com> on 2007/11/13 16:40:58 UTC

T5: datefield with custom configure howTO

I subclassed the DateField-component to MyDateField with the purpose to
overwrite the configure-method, since I need a custom method to go off when
I select a date in the calendar. 

I did the following  in MyDateField: (where onSelect1 is a function defined
in my page). 

protected void configure(JSONObject setup)
	{
		setup.put("onSelect", "onSelect1");
		super.configure(setup);
	}

The problem is that the onSelect1-function is never called, although
according to
http://www.dynarch.com/demos/jscalendar/doc/html/reference.html#node_sec_2.3
this is the correct way of defining a callback function for the
onChange-event of the calendar. 

Also, Tapestry seems to generate the client-side code correctly to setup the
calendar: 

<script type="text/javascript">
<!--
Event.observe(window, "load", function() {
Tapestry.registerForm('form');
Calendar.setup({"inputField":"mydatefield","onSelect":"onSelect1","ifFormat":"%d-%m-%y","button":"mydatefield:trigger"});
Calendar.setup({"inputField":"mydatefield_0","onSelect":"onSelect1","ifFormat":"%d-%m-%y","button":"mydatefield_0:trigger"});
});
// -->
</script>

Anyone knows whats wrong with this? 

Thanks in advance 
Geert-Jan
-- 
View this message in context: http://www.nabble.com/T5%3A-datefield-with-custom-configure-howTO-tf4798573.html#a13728242
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org