I have the below code, which doesnt work as expected. Everythime i execute it, "sortid" seems to be turned into an array with another elemet tacked on every iteration? What i want to do is use URL which performs a callback, and then passes the var "sortid" to the getCSBans method... sortid on first attempt is "timestamp" if i then click "wonid" i get ['timestamp', 'wonid'] What am i not understanding? <dtml-var standard_html_header> <small>För att uttföra en operation, klicka i rutan brevid knappen och klicka på respektive knapp. </small><br><br><br> '<dtml-var URL>' <br> <dtml-var REQUEST> <dtml-if sortid> <dtml-var sortid> </dtml-if> <dtml-in expr="getCsbans(sort='<dtml-var sortid>')" size=100 start=query_start> <dtml-if sequence-start> <dtml-if previous-sequence> <a href="<dtml-var URL><dtml-var sequence-query>query_start=<dtml-var previous-sequence-start-number>"> (Previous <dtml-var previous-sequence-size> results) </a> </dtml-if previous-sequence> <table border> <tr> <th><a href="<dtml-var URL><dtml-var sequence-query>sortid=wonid">Wonid</a></th> <th><a href="<dtml-var URL><dtml-var sequence-query>sortid=timestamp">Tidpunkt för ban</a></th> [snip]
Jan Johansson writes:
I have the below code, which doesnt work as expected. Everythime i execute it, "sortid" seems to be turned into an array with another elemet tacked on every iteration? What i want to do is use URL which performs a callback, and then passes the var "sortid" to the getCSBans method...
sortid on first attempt is "timestamp" if i then click "wonid" i get ['timestamp', 'wonid']
What am i not understanding? That "sequence-query" is the complete query string with just the "start" argument removed. When you append "sortit=..." and there already has been a "sortit" parameter in the query string, you get two of them and Zope presents them in a list.
Your options: * You find a patch on <http://www.dieter.handshake.de/pyprojects/zope> to ZPublisher that lets you specify with a ":last" suffix that you just want the last value. * You use "sortit:list", instead of "sortit". This has the advantage that you always get a list (or nothing at all). You are interested in the last element: "sortit[-1]". * .... Dieter
participants (2)
-
Dieter Maurer -
Jan Johansson