WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-14-2011, 02:53 AM
TarkaDahl TarkaDahl is offline
Member
 
Join Date: Mar 2010
Posts: 59
Problems with vizhtml displayURL

Hi
the following code works fine

Code:
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.

Code:
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
Reply With Quote
  #2  
Old 02-14-2011, 05:16 AM
TarkaDahl TarkaDahl is offline
Member
 
Join Date: Mar 2010
Posts: 59
The website shows up but the onFormSubmit does not get called.
Reply With Quote
  #3  
Old 02-14-2011, 09:34 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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:
Code:
<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.
Reply With Quote
  #4  
Old 02-15-2011, 01:45 AM
TarkaDahl TarkaDahl is offline
Member
 
Join Date: Mar 2010
Posts: 59
Hi farshizzo,

That worked.

Thanks

TarkaDahl
Reply With Quote
  #5  
Old 02-17-2011, 08:00 AM
TarkaDahl TarkaDahl is offline
Member
 
Join Date: Mar 2010
Posts: 59
Hi

Here is just a slight problem.
Code:
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
Reply With Quote
  #6  
Old 02-22-2011, 11:03 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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():
Code:
viz.setOption('viz.display.swap_copy',1)
viz.go()
Reply With Quote
  #7  
Old 02-22-2011, 01:11 PM
TarkaDahl TarkaDahl is offline
Member
 
Join Date: Mar 2010
Posts: 59
Hi farshizzo

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

Thanks
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problems with makepy applications Darkmax Vizard 0 10-12-2010 09:47 AM
problems nagivating around ruby21 Vizard 2 05-18-2010 03:22 PM
Problems loading WRL file DrunkenBrit Vizard 2 01-29-2009 12:58 AM
Problems with spawn point. just alex Vizard 1 11-24-2008 09:51 AM
Problems with lighting in 2.0 murm Vizard 6 04-21-2004 09:59 AM


All times are GMT -7. The time now is 03:40 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC