Amal Shaji Posted February 18, 2019 Share Posted February 18, 2019 In my spotfire dashboard, I have a javscript which assigns the value of acalculated field to a document property. The html part is as follows: The javascript is: var fun1 = function(){ var c1 = $('#NumberValue').text().trim() $('#Number input').val(c1).blur() } setInterval(fun1,100) This stopped working after the upgrade to Spotfire 10. Post the upgrade, the values are getting copied from the div NumberValue to the div Number, But the document property associated with the second div is not getting updated. I tried the following work around also: var fun1 = function(){ var c1 = $('#NumberValue').text().trim() $('#Number input').show() $('#Number input').focus() $('#Number input').val(c1).blur() $('#Number input').hide() } setInterval(fun1,100) This script was assiging the value to document property, But the focus function was activating the element each time the javascript runs. Hence we were unable to type values in other input fields in the same tab. We cannot use the Iron python method for assigning document properties as it needs to be triggered by R datafunction and our server has limitations to handle the load. So any javascript solutions/work arounds will be appreciated. Link to comment Share on other sites More sharing options...
Anita Csizmadia Posted February 20, 2019 Share Posted February 20, 2019 Amal, have you tried this solution:https://www.youtube.com/watchv=81vXShmDyOM I was having issues with passing my calculate value to a document property in 10 as well, and this is what ended up working for me. Link to comment Share on other sites More sharing options...
Chris Larsen 3 Posted April 22, 2019 Share Posted April 22, 2019 Hello, same problem here. Addictionally I'm not able to use R functions so I need to use only JS/JQuery to assign values to property. Could please someone explain why value is passed to an input field but not assigned to relative property using JQuery/JS on Spotfire 10.0 Link to comment Share on other sites More sharing options...
Aaron Cediel Posted October 22, 2019 Share Posted October 22, 2019 Hi, I believe I have found a possible solution/work-around for the issue, entirely based on pure JavaScript (since TIBCO removed jQuery starting from Spotfire X). The solution is to force a simulated Enter Keystroke while focusing the input box to trigger updating the Document Property. (No data function and R needed) HTML (SpotfireControl Element is an single line input-box for a Doc. Prop.): JS (focus and blur might no longer be needed for this solution, but I'm still keeping them just in case): const inputConfirmationEvent = new KeyboardEvent("keypress", { keyCode: 13, bubbles: true, cancelable: false }); var elem = document.querySelector("#container input"); elem.value = "stringValue"; elem.blur(); elem.focus(); document.querySelector("#container input").dispatchEvent(inputConfirmationEvent);Hope it helps someone. Best, Aaron Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now