Jump to content

Action and Property controls in text areas do not show in web player


Antoine Doeraene

Recommended Posts

Hello,

I have a Page containing a single TextArea. This text area contains several action controls (buttons) and property controls (like drop-down, input boxes...). The action controls are linked to some IronPython script that, for some, include modifying the HtmlContent of the text area itself.

When we load the document in the web player, with only viewer access, sometimes these controls do not show in the text area, whereas in the Spotfire client, with author credentials, it works perfectly.

How can I fix this

 

Thank you!

Antoine.

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...

 Hi , I have the same problem i tried using Jquery and not using Jquery like the script below but i have the problem still persist i'm on Spotfire 7.13.0 i will be soon using Spotfire 10.3.2 but for the moment i need this to work, i have Remember personalized view for each user web client user actived.

 

document.querySelector('#pmcvalider>input').onclick = loading;
var oldValue = document.querySelector('#pmcreset > span').innerHTML;
var interval;

function updateValue() {

   //get value from a Label Property Control or from a Calculated Value
   newValue = document.querySelector('#pmcreset > span').innerHTML;

   //update widget (only when the value changes)
   if (oldValue == newValue) {
       console.log('if');
       if (document.getElementById('pmcloading').innerHTML == "LOADING...") {
           document.getElementById('pmcloading').innerHTML = "LOADING.";
       } else if (document.getElementById('pmcloading').innerHTML == "LOADING.") {
           document.getElementById('pmcloading').innerHTML = "LOADING..";
       } else {
           document.getElementById('pmcloading').innerHTML = "LOADING...";
       }
   } else {
       console.log('else');
       clearInterval(interval);
	
       document.getElementById('pmctable').style.boxShadow = 'inset 0 0 white';
	
       
	var elements = document.querySelectorAll('td#pmcause_name  span > div > div > div > div.sf-element-list-box.sfc-scrollable');
	for(let i = 0;i<elements.length;i++){
		elements[i].style.background = 'white';
	} 
	
       //document.querySelector('label > span > div.sf-element-dropdown').style.background = 'white';
       var elements = document.querySelectorAll('textarea');
	for(let i = 0;i<elements.length;i++){
		elements[i].removeAttribute('disabled');
	} 
       document.getElementById('pmcloading').style.visibility = 'hidden';
	document.querySelector('#pmcvalider > input').removeAttribute('disabled')
	document.querySelector('#pmcvalider>input').onclick = loading;
   }

   oldValue = newValue

}

//run once
updateValue()

function loading() {
   var c1 = document.querySelector('td#pmcause_name > div#grid > div:nth-child(1) .sf-element-list-box-item.sfpc-selected');
if (c1 != null){
	c1 = c1.innerHTML;
}
else{
	c1 = 'a'
}
var c2 = document.querySelector('td#pmcause_name > div#grid > div:nth-child(3) .sf-element-list-box-item.sfpc-selected');
if (c2 != null){
	c2 = c2.innerHTML;
}else{
	c2 = 'b'
}
var c3 = document.querySelector('td#pmcause_name > div#grid > div:nth-child(5) .sf-element-list-box-item.sfpc-selected');
if (c3 != null){
	c3 = c3.innerHTML;
}else{
	c3 = 'c'
}
var percentages = document.querySelectorAll('td#pmcause_name > div#grid > div > span > div > span.ValueLabel')
   if (document.getElementById('pm_name').innerText.length == 1) { //No pm selected
       Spotfire.InfoPopup.show('No pm selected', 'Ok', 'Une pm doit tre slectionne')
   } else if (document.querySelector('#events-table-wrapper .sfpc-selected') == null) { //No cause selected
	Spotfire.InfoPopup.show('No cause selected', 'Ok', 'Une cause doit tre slectionne')
   } else if (c1 == c2 || c1 == c3 || c2 == c3){ 
	Spotfire.InfoPopup.show('Cause already selected', 'Ok', 'Veuillez slectionner deux causes diffrentes')
}else if ( (parseFloat(percentages[0].innerHTML) + parseFloat(percentages[1].innerHTML) + parseFloat(percentages[2].innerHTML)) > parseFloat(100) ){ 
	Spotfire.InfoPopup.show('More than 100 percent cumulated', 'Ok', 'Veuillez ne pas dpasser 100% cumul')
}else {
       document.getElementById('pmctable').style.boxShadow = 'inset 47em 0em #d0d0d0';
	
       var elements = document.querySelectorAll('textarea');
	for(let i = 0;i<elements.length;i++){
		elements[i].setAttribute('disabled',true);
	}
	
	var elements = document.querySelectorAll('td#pmcause_name  span > div > div > div > div.sf-element-list-box.sfc-scrollable');
	for(let i = 0;i<elements.length;i++){
		elements[i].style.background = '#d0d0d0';
	} 
	
       document.getElementById('pmcloading').style.visibility = 'visible';
	document.querySelector('#pmcvalider > input').setAttribute('disabled',true)
	document.querySelector('#pmcvalider>input').onclick = null;
       interval = setInterval(updateValue, 1000);
   }
}

 

 

 

Best regards,

 

Loan

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...