Error when updating X3D Inline url via Javascript

146 Views Asked by At

I'm using x3dom to do some dynamic x3d work.

I'm loading scenes and manipulating them just fine, i.e. manipulating the size and texture of an ElevationGrid and I'm having no issues at all.

I have a 'reset' button that basically puts the scene back to the default blank scene (that I have defined). The implement this reset, I'm changing the url attribute of the Inline node in a Javascript handler for the button.

Here is the Inline node as it is loaded with the page, initially. Remember, this works perfectly.

<Inline id="Base" DEF="Base" nameSpaceName="Base" mapDEFToID="true" url="/GameRoom/LoadScene/00000000-0000-0000-0000-000000000000" contentType="model/x3d+xml"></Inline>

Here is the line of code in the click handler that actually changes the url

document.getElementById("Base").setAttribute("url", '"/GameRoom/LoadScene/00000000-0000-0000-0000-000000000000"');

While the scene does reload, I get an immediate error in the x3dom debug window

ERROR: updateField: setValueByStr() NYI for boolean

And while the scene does reload, my script routines to manipulate the elements in the scene no longer work. What I mean by no longer work is that I can still select DOM elements just fine (stepping through client-side code and seeing everything normally. But no changes made to DOM elements take effect and there is no further error in script or the x3dom debug window.

The error indicates some sort of problem with an expected bool, do I have to set anything else on the Inline node?

Any thoughts would be appreciated!

1

There are 1 best solutions below

0
On

For anyone who comes across this looking at a similar issue, I've changed my approach.

I am not building a completely new Inline node in memory and then replacing the one already in the DOM. This seems to work perfectly.