[Seaside] dateInput Question

Michel Bany michel.bany at gmail.com
Fri Nov 3 15:05:24 UTC 2006


Hi Ron,

Now, I see what you are trying to do, you are trying to implement
a SeasideAsync missing piece.

Actually, I have had a for a long time, the project of finishing  
SeasideAsync,
adding live callbacks to radio buttons, date and time input and maybe
a few other smaller things. If found it not trivial and I gave up.
I will look if I can restart this project and let you know.

Cheers,
Michel.




On 03 Nov 2006, at 15:44 , Ron Teitelbaum wrote:

> 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
> 		addLoadScript:
> 			'liveSearch('
> 				, (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!
>
> Ron
>



More information about the Seaside mailing list