Actually i am bit confussed bit while reading the document

http://docs.turbogears.org/1.0/FileUploadProgressBar

in the tutorial.. i dont know actually to re-show the form while still
lines we have under it.

@expose()
def upload_handler(self, myfile1, myfile2, **kw):
    """ Do something with form values and re-show the upload form. """

   # Tell UploadFilter that this transfer is done.
    try:
        del cherrypy.file_transfers[cherrypy.request.remote_addr]
[myfile1.filename]
        del cherrypy.file_transfers[cherrypy.request.remote_addr]
[myfile2.filename]
    except KeyError:
        pass

    # Save any files that were uploaded (ignoring empty form fields)
    tmpdir = os.path.join(os.getcwd(), "tempfiles")
    if len(myfile1.filename) > 0:
        self.save_file(os.path.join(tmpdir,
os.path.basename(myfile1.filename)), myfile1.file)
    if len(myfile2.filename) > 0:
        self.save_file(os.path.join(tmpdir,
os.path.basename(myfile2.filename)), myfile2.file)

    # Re-show the upload form, with a nice little message
    return self.upload(msg="uploaded %s and %s" % (myfile1.filename,
myfile2.filename))



how can we re-show the form  in this case..

On Jul 2, 2:39 pm, Shan <[EMAIL PROTECTED]> wrote:
> thanks Diez,
>
> I have included the following lines already in app.cfg
>
> tg.include_widgets=['turbogears.mochikit']
>
> and now i double checked it... but still same error.
>
> On Jul 2, 2:10 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>
> > On Wednesday 02 July 2008 11:03:36 Shan wrote:
>
> > > I am working with File Upload Progress Bar in Turbogears(http://
> > > docs.turbogears.org/1.0/FileUploadProgressBar).
>
> > > it looks goood... but for me except the progressbar everything  is
> > > working... i am receiving an javascript error addLoadEvent is not
> > > defined in progressbar.js
>
> > > i am using Firefox latest version.
>
> > > can any one of you help me in this?
>
> > Seems like you miss mochikit. Use the tg.include_widgets (I hope it'scalled
> > that way... it should be documented in your app.cfg though, easy to spot) to
> > include it in any page.
>
> > Diez
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to