Google-Gmail 'Attach a file' Component

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Google-Gmail 'Attach a file' Component

dirk newbold
All,

Newbie Question:

I'm trying to mimic the Google-Gmail 'Attach a file' Component (the
one used in their 'Compose Mail' facility, situated under the
'Subject' with the paperclip icon) instead of using the more
cumbersome looking html fileUpload & html submitButton.

Could this be developed into a standard Seaside Component?

Also I'm looking for some more detailed explanation of how the
Scriptaculous's onChange/onClick callback method works i.e. in the
code below I understand how the first callback works but I am a bit
lost as to the ins and outs of the second callback.

html select
   list: (1 to: 9);
   selected: selectList;
   callback: [ :value | selectList := value ];
   onChange: (html updater
      id: mid;
      triggerForm: fid;
      callback: [ :r | r render: selectList ])

Any help/explanation would be great.

Cheers,

Dirk
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Google-Gmail 'Attach a file' Component

Patrick Collison
On 07/08/07, dirk newbold <[hidden email]> wrote:

> All,
>
> Newbie Question:
>
> I'm trying to mimic the Google-Gmail 'Attach a file' Component (the
> one used in their 'Compose Mail' facility, situated under the
> 'Subject' with the paperclip icon) instead of using the more
> cumbersome looking html fileUpload & html submitButton.
>
> Could this be developed into a standard Seaside Component?
>
> Also I'm looking for some more detailed explanation of how the
> Scriptaculous's onChange/onClick callback method works i.e. in the
> code below I understand how the first callback works but I am a bit
> lost as to the ins and outs of the second callback.
>
> html select
>    list: (1 to: 9);
>    selected: selectList;
>    callback: [ :value | selectList := value ];
>    onChange: (html updater
>       id: mid;
>       triggerForm: fid;
>       callback: [ :r | r render: selectList ])
>
> Any help/explanation would be great.

The argument to the second callback is an HTML canvas (like the one
supplied to any #renderContentOn: method), and the callback is
executed asynchronously whenever the item selected changes. Whatever
html is generated will be used to update the contents of whatever
element in the page has an id matching that referred to by the mid
variable.

As a simple example, try:

html div
    id: 'foo';
    with: [
        html anchor
            onClick: (html updater id: 'foo'; callback: [:h | h text:
'Clicked']);
            with: 'Click me']
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside