[Seaside] OSCON "contest"

James Foster Smalltalk at JGFoster.net
Thu Jul 24 23:49:06 UTC 2008


On Jul 24, 2008, at 3:41 PM, Igor Stasenko wrote:

> 2008/7/24 James Foster <Smalltalk at jgfoster.net>:
>>
>> On Jul 24, 2008, at 8:51 AM, Igor Stasenko wrote:
>>
>>> 2008/7/22 James Foster <Smalltalk at jgfoster.net>:
>>>
>>>>
>>>> I think I need these extensions to get the "Are you sure?"  
>>>> JavaScript. I
>>>> couldn't find a way to get a MACommandCollumn to add the  
>>>> #'onClick:' to
>>>> the
>>>> anchor. (In a similar way, I think I need the PRDocumentComponent  
>>>> to
>>>> render
>>>> the Wiki markup. It seems like this capability should have been  
>>>> available
>>>> already but I couldn't find it.)
>>>>
>>>
>>> Here the simple class which draws a dialog using lightbox.
>>>
>>> Just add a method , like this:
>>>
>>> confirmDialog: aTitle with: aContentsBlock
>>>       ^ self lightbox: (TheDialogWindow confirmDialog: aTitle with:
>>> aContentsBlock)
>>>
>>> and then you can use it like this:
>>>
>>> html submitButton value: 'Delete this worthless stuff'; callback: [
>>>  (self confirmDialog: 'Deleting worthless stuff' with: [:htm | htm
>>> text: 'Do you really think this stuff is worthless?'] )
>>>  ifTrue: [ self deleteStuff ]
>>> ].
>>>
>>> Note, that you can put any html inside a dialog window.
>>>
>>> Try it out :)
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko AKA sig.
>>> <TheDialogWindow.st>
>>
>> That does look nice, though I believe it does require execution of  
>> server
>> code to handle the dialog. What drove me to do the extension was the
>> "requirement" to use JavaScript so that the server code only ran if  
>> the user
>> confirmed based on code running only on the client.
>>
>
> Well, i really don't think that validating forms using javascript is
> good way. Because it is not secure, and often you need more additional
> data to validate an input, which accessible only at server side and
> hidden from client's eyes.
>
> Oh, and btw: good user interface should not show any 'yes-no'  
> dialogs :)
> UI should be built on a principle which allows user do things first,
> without asking 'yes-no' all the way around, and then allow to revert
> things back (undo) at any the moment when he finds he made wrong
> action(s).
> -- 
> Best regards,
> Igor Stasenko AKA sig.

And if you were invited to a Ruby event and asked whether Seaside/ 
Magritte could support JavaScript, would you tell them that they were  
wrong for asking?

James


More information about the seaside mailing list