how to put form and display its result(data from database) on the same window?

Peter Hansen peter at engcorp.com
Sat Dec 10 08:35:17 EST 2005


Tim Roberts wrote:
> Peter Hansen <peter at engcorp.com> wrote:
>>lli at sos.state.tx.us wrote:
>>>... Now
>>>I want to put the form and display data on the same window. 
>>
>>The most modern approach to this...is AJAX (see http://en.wikipedia.org/wiki/AJAX 
>>and others).
>>It's a non-trivial solution to your problem, however, at least in terms 
>>of the learning curve involved.
> 
> It's also a serious case of overkill for the rather simple problem he
> presented.  All he needs is one function to create the form, and one
> function to create the results, and do:
> 
>   def PresentTable():
>     PrintTheForm()
>     if i_have_received_data:
>       PrintTheResultTable()

Well, it's a matter of interpretation, isn't it?  Given his vague 
requirements above, it's quite valid to assume that he wants to avoid 
the effects of the browser loading a new page, even if that page looks 
like the previous one a lot.  You may be quite right in your *guess* 
that he doesn't need that, but there isn't enough information present in 
his request for either of us to know.

(But you're quite correct *if he doesn't care about refreshing the 
window when the form is submitted* that Ajax is overkill.  I should 
probably have asked for more detail in the question before suggesting Ajax.)

-Peter




More information about the Python-list mailing list