[Zope] How do you replace content with an action?

robert rottermann robert at redcor.ch
Sat Sep 4 01:05:24 EDT 2004


Laura,

as somebody else told you in an other thread, you must be careful to 
distinguish between what happens on the server and and what on the client.
Zope and it's tools work solely on the the server, java script only on 
the server.
Tal templates work on the server to prepare a html page that zoope will 
send to your client. Once it is there your java script can deal with it.

This two phases are run in total isolation and neither of the two is 
avare of the other. Furthermore, there is no easy way for the two, to 
communicate.
Knowing this, we have two strategies to solve your problem of "local" 
refinement of a querry.:
- send everything to the client. Unwanted parts hidden from view. Let 
your java script "unhide" and "rehide" the details as needed.
This is fast, if ther is only a small and predictable amount of data to 
move between server and client.
- create a new request and resend the result of the query with one 
detail record "filled out" each time a detail is requested. This 
approach does not involve any java script. I did send you a link to a 
sample how to do that. Maybe you have a look at it, and ask me if you 
need more explanations.

Robert

Laura McCord wrote:
> Hi Tom,
> 
>  Yes I have been struggling with this issue this week. The whole big
> picture is that I need to sort my table which contains the data from a
> zsql method. But, I have several elements that I need to deal with.
> 
> First of all, my page template contains a requested expand/collapse
> feature using javascript that once a row of data is clicked a new table
> will expand that contains more related data of that row.
> 
> I have to paths:
> 
> 1)I have javascript already that will sort the visible data in my table
> but it will not sort the corresponding hidden table that is visible when
> clicked. So, when I click a row of data the wrong hidden table displays.
> 
> 2)This is why I was looking at finding a way to redefine the results by
> clicking on the appropriate header. So, I wanted each heading on my
> table to trigger the right zsql method that already contains the desired
> sort and reassigning it to the batch results and then display
> accordingly. 
> 
> So, I don't know which path to continue with and beat with a stick till
> I get it working.
> 
> Thanks,
>  Laura 
> 
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 
> 


More information about the Zope mailing list