PDA

View Full Version : Problems with vizhtml displayURL


TarkaDahl
02-14-2011, 02:53 AM
Hi
the following code works fine


import viz
import viztask
import vizhtml

viz.go()

html = """
<html>
<body onload="document.the_form.first_name.focus();">

<form name="the_form" method="post">
<table>
<tr>
<td>First Name</td>
<td><input type="text" name="first_name"></td>
</tr>
<tr>
<td>Last Name</td>
<td><input type="text" name="last_name"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Submit"></td>
</tr>
</table>
</form>

</body>
</html>"""

vizhtml.displayCode(html)

def HandleForm(e):

print "wooho form submited"

vizhtml.onFormSubmit(HandleForm)



However when i change to loading the html file from an external file it doesnt work.


import viz
import viztask
import vizhtml

viz.go()

vizhtml.displayURL("simple.html")

def HandleForm(e):

print "wooho form submited"

vizhtml.onFormSubmit(HandleForm)



The html is exactly the same just put in the file "simple.html". am i doing something wrong. or is it not mearnt to work like that.

Thanks

TarkaDahl

TarkaDahl
02-14-2011, 05:16 AM
The website shows up but the onFormSubmit does not get called.

farshizzo
02-14-2011, 09:34 AM
When loading html files from a URL, instead of code embedded within the script, you must specify the action field of your form. Modifying your form definition to the following should work:
<form name="the_form" method="post" action="http://localhost:8080/vizhtml_form/">
This tells the browser to submit the form data to the vizhtml webserver.

We will update the documentation to mention this.

TarkaDahl
02-15-2011, 01:45 AM
Hi farshizzo,

That worked.

Thanks

TarkaDahl

TarkaDahl
02-17-2011, 08:00 AM
Hi

Here is just a slight problem.

import viz

viz.go(viz.FULLSCREEN)

viz.window.displayHTML( 'www.worldviz.com' )


When i run this code in version 3 everything works as i would expect.

However in version4 i can not click on the html page without it disapearing and the only way i can get it back is by pressing the start menu button.

This only happens in fullscreen mode.

Thanks

TarkaDahl

farshizzo
02-22-2011, 11:03 AM
Are you running under Windows Vista or 7? There is an issue with some OpenGL drivers under Vista and above where fullscreen mode causes issues like the one you are describing.

Try adding the following line before you call viz.go():viz.setOption('viz.display.swap_copy',1)
viz.go()

TarkaDahl
02-22-2011, 01:11 PM
Hi farshizzo

I have just checked that i appears to work. I will check properly on next time im in work.

Thanks