Changing input field values programmatically

  • 3 replies.
  • This is not yet resolved.
  • This question was started by fredrik.westmark.
  • Last post by Sjoerd Visscher.
fredrik.westmark
user
March 11th 2010
We are using the jQuery mousewheel plugin(http://plugins.jquery.com/project/mousewheel) to alter the values in the properties sidebar input fields when the user hovers over an input and scrolls the mousewheel. This works well and nice, but Xopus does not seem to notice that the input's value has changed. It seems to trigger only on keyup or keypressed. Is there a way to force Xopus to re-evalute these input fields?

BR // Fredrik
Sjoerd Visscher
Xopus Team
March 15th 2010
I don't see a way to get this to work. But it might not be too hard for us to add this as a feature to Xopus.
fredrik.westmark
user
March 18th 2010
We solved this by tricking Xopus into believing someone pressed a key on the keyboard(only tested in FF):

var evt = document.createEvent('KeyEvents');
evt.initEvent('keyup', true, true);
inputFieldElement.dispatchEvent(evt);
Sjoerd Visscher
Xopus Team
March 24th 2010
Dude... Nice solution!

React

HTML will be shown as HTML code.
Linebreaks and Links starting with http:// are automatically resolved