hello i´m testing ajax auto completion example as said in the book
it works fine

Now i want to return not the months for the user to select but an image
because i´m testing graphviz dot language!

the user writes for example

a->b
an image is created . It see it in the image in the static folder
then a->b->C
the first images is updated.  I see the updated image it in the static
folder

 However in the view in the browser i only see the first image. I have to
mousover the image and select update image . Why????


*My view*
{{extend 'layout.html'}}
<style>
#suggestions { position: relative; }
.suggestions { background: white; border: solid 1px #55A6C8; }
.suggestions DIV { padding: 2px 4px 2px 4px; }
</style>

<form>
<input type="text" id="strCmd" name="strCmd" style="width: 250px" /><br />
<div style="position: absolute;" id="suggestions"
class="suggestions"></div>
</form>
<script>
jQuery("#strCmd").keyup(function(){
ajax('Graphit', ['strCmd'], 'suggestions')});
</script>


*Controller:*
def Graphit():
temp=request.vars.strCmd
print temp
if not temp: return ''
dott = win32com.client.Dispatch(r'Wingraphviz.dot')
img=win32com.client.Dispatch(r'Wingraphviz.BinaryImage')

strCMD2 = "digraph G {"+temp+";}"
print strCMD2
img=dott.ToGIF(strCMD2)

img.Save((os.path.join(request.folder,'static','wf.gif')))
return IMG(_src=URL('static','wf.gif'))


Strangers in the night....  :)

Reply via email to