On Monday 18 January 2010 14:28:08 hoboro wrote:
> Christoph
>
> I just want  a response on the same page while the action is being
> processed.
>
> Just display a message at the top "Processing Request Be Patient"
> thats it. when the action is done then move to the
> next page with the result.
>
> I am not sure which is the best way to handle this the server or
> client side that is why I put this as a topic
> I am a novice in turbogears. Whatever is the most efficient,or easiest
> way to do it


I'm still not entirely sure what you are after. Assuming that you have a form 
that you 

 - want to display
 - validate
 - perform some background task through threading or subprocesses
 - while the form is displayed again

then the actions and form should (roughly) laid out as this:


class MyForm(TableForm): # or list or whatever

   .... # fields etc.


my_form = MyForm("my_form",
   action = "/perform_action" # use actual path to MyController.perform_action

)

class MyController(...):

    @expose("template")
    def display_form(self):
          tmpl_context.my_form = my_form
          return {}


    @expose()
    @validate(my_form, error_handler=display_form)
    def perform_action(self, param_1, param_2, ..):
          do_something_in_background(param_1, param_2, ...)
          flash("I'm busy fulfilling your request, master!")
          redirect("/display_form")



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