[Seaside] dateInput Question

Ron Teitelbaum Ron at USMedRec.com
Fri Nov 3 14:44:39 UTC 2006

Hi Michel, 

From: Michel Bany [mailto:michel.bany at gmail.com] 
Sent: Friday, November 03, 2006 3:16 AM

> Hi Ron,
> I was wondering if you could help me understand something.
> You do not provide enough background information.
> Are you using Squeak or VW ?
> Are you using SeasideAsynx of Scriptaculous ?

I'm using Squeak and SeasideAsync and Scriptaculous

> Also, the code you are wondering about is using the canvas api.
> However, live callbacks are not implemented (yet) for the canvas api.
> Are you implementing it ?

I'm adding liveCallbackYear to dateInput.

> Did you copy/paste some code into your component ?

Yes I added the following: 

liveCallbackYear: liveBlock
	| uri id |
	liveBlock fixTemps.
	id _ self ensureId.
	uri _ canvas urlForLiveAction: 
		[:event :h | liveBlock
			value: event value
			value: h].
	self session 
				, (id asString, '-year') printString
				, ','
				, (canvas encode: uri asString) printString
				, ')'.

>> I’m trying to understand the following code:
>> canvas hiddenInput
>>                        callback:
>>                                    [value := Date
>>                                                newDay: (day min: (Date 
>> daysInMonth: month forYear: year))
>>                                                monthNumber: month
>>                                                year: year.
>>                                    callbackBlock value: value];
>>                        close.
>>            canvas forgetCurrentBrush.

> The dateInput composite is made up of four html elements
> a select for the month, an input for the day, an input for the year and
> the hidden input, each with a callback. The first three callbacks
> are for collecting the input values. The fourth callback assembles
> the input values into an instance of Date and passes it to
> the component callback.

I can see that it creates the date but what triggers the hiddenInput
callback?  It appears to work without submitting the form.

Thanks for your help!


More information about the Seaside mailing list