File Upload Widget sample code

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

File Upload Widget sample code

Jon Hancock-2
This blog post http://smalltalk.gnu.org/blog/nico/automatic-ajax-file-upload-iliad
shows a nice file upload widget. Is there sample code for this?  Or is
ILFileInputField the only thing around?

thanks, Jon
Reply | Threaded
Open this post in threaded view
|

Re: File Upload Widget sample code

Nicolas Petton
Le mercredi 17 novembre 2010 à 17:19 -0800, Jon Hancock a écrit :
> This blog post http://smalltalk.gnu.org/blog/nico/automatic-ajax-file-upload-iliad
> shows a nice file upload widget. Is there sample code for this?  Or is
> ILFileInputField the only thing around?

Hi Jon,

Something like this

e form input
    beFile;
    action: [:fileProxy | ....]

Would do the same thing :)

HTH,
Nico

Reply | Threaded
Open this post in threaded view
|

Re: File Upload Widget sample code

Jon Hancock-2
Nico,
I'm making a little progress.  Can you help me understand why building
an upload widget means I have to have a "save" and "cancel" buttons to
go with the form?  What I'm looking for is just the file name field
and "browse" button.  Is this possible?

fyi, I'm new to iliad and pharo.  But I used to work with smalltalk
for 10 years (15 years ago).  So the language isn't a problem, but I
am stumbling around with the tools a bit ;).
thanks, Jon

On 18 nov, 11:20, Nicolas Petton <[hidden email]> wrote:

> Le mercredi 17 novembre 2010 à 17:19 -0800, Jon Hancock a écrit :
>
> > This blog posthttp://smalltalk.gnu.org/blog/nico/automatic-ajax-file-upload-iliad
> > shows a nice file upload widget. Is there sample code for this?  Or is
> > ILFileInputField the only thing around?
>
> Hi Jon,
>
> Something like this
>
> e form input
>     beFile;
>     action: [:fileProxy | ....]
>
> Would do the same thing :)
>
> HTH,
> Nico
Reply | Threaded
Open this post in threaded view
|

Re: File Upload Widget sample code

Nicolas Petton
Le jeudi 18 novembre 2010 à 09:07 -0800, Jon Hancock a écrit :
> Nico,
> I'm making a little progress.  Can you help me understand why building
> an upload widget means I have to have a "save" and "cancel" buttons to
> go with the form?

This is because in my blog post I showed an example with Formula.
Formula is a tool to help you build validated forms:
http://smalltalk.gnu.org/blog/nico/formula-building-nice-validated-forms-iliad-ease


>  What I'm looking for is just the file name field
> and "browse" button.  Is this possible?
>

Sure, but you'll have to submit the form at some point:

| form |
form := e form.
form input beFile; action: [:fileProxy | ....].
form button text: 'Submit'

If you really don't want a button to submit the form, you can use a
JavaScript event to submit the form:

| form |
form := e form.
form input
    beFile;
    action: [:fileProxy | ....];
    beSubmitOnChange

> fyi, I'm new to iliad and pharo.  But I used to work with smalltalk
> for 10 years (15 years ago).  So the language isn't a problem, but I
> am stumbling around with the tools a bit ;).
> thanks, Jon

As a start, you can read the draft of the documentation. It far from
being complete, but it can be a good start:
http://doc.iliadproject.org
You can also download it as a pdf on the iliad website at
http://www.iliadproject.org/pages/Documentation

Cheers,
Nico