librocket SetValue[SOLVED]


I am trying to put a value from my main program, to a hidden input of my window (rml).

From document, I find the control, and I wish to use SetValue, but I got an error of undefined method.

My rml :

	<body template="pywindow" onload="LoadOptions(document)">
		<form name="formtest" onsubmit="SaveOptions(event, document);">
		<input type="hidden" id="objid" name="objid" value="0"/>
		<p>Name : <input id="name" type="text" name="name" value="" /></p>
		<p><input type="submit" name="button" value="close">close</input></p>

my main program:

doc = context.LoadDocument('data/options.rml')

My error :

AttributeError: 'ElementFormControlInput' object has no attribute 'SetValue'

The documentation says that there is a SetValue method:

But in a script into the rml, I can access to the hidden input.

	document.GetElementById('name').value="val" + document.GetElementById('objid').value

I don’t know what’s wrong…

This is really a libRocket-specific issue, and has nothing to do with Panda3D.

Keep in mind that the Python bindings of libRocket sometimes use a slightly different API than their C++ reference indicates; I advise looking in their Python documentation.

I log the problem on their own forum.
Sorry, and thanks for the advice!

the good way to do was :


and not


Slightly difference :frowning: