Cannot set TRUST_DATA_AS_HTML true for newHtmlArea()?

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

Cannot set TRUST_DATA_AS_HTML true for newHtmlArea()?

Postby pbdavis » Mon Apr 20, 2020 10:02 pm

I tried the "Programming with Servoy" topic, but no one responded after 2 weeks. So, maybe this is an issue with Servoy or new feature needed?

I need to know how I get putClientProperty(APP_UI_PROPERTY.TRUST_DATA_AS_HTML, true) to work for newHtmlArea(dataprovider, x, y, width, height): JSField?

I'm trying to get MindFire Solution's Auto Logout extension to work in Servoy 2020.03.

The pop-up and javascript works with application.putClientProperty(APP_UI_PROPERTY.TRUST_DATA_AS_HTML, true), but I don't want this for the whole application. Just for this "newHtmlArea".

In the scope autologout.js I'm trying this, but it doesn't work (TypeError: Cannot find function putClientProperty in object):
Code: Select all
frm.newVariable('var_progressbar', JSVariable.TEXT);
var htmlarea = frm.newHtmlArea('var_progressbar', 10, 70, AUTO_LOGOUT_CUSTOM_PROPERTIES.WIDTH - 20, 130);
htmlarea.editable = false;
htmlarea.scrollbars = SM_SCROLLBAR.HORIZONTAL_SCROLLBAR_NEVER|SM_SCROLLBAR.VERTICAL_SCROLLBAR_NEVER;
htmlarea.transparent = true;
htmlarea.styleClass = 'html';
htmlarea.name = 'logoutHtmlArea';
htmlarea.putClientProperty(APP_UI_PROPERTY.TRUST_DATA_AS_HTML, true);

Thanks,
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA

Re: Cannot set TRUST_DATA_AS_HTML true for newHtmlArea()?

Postby patrick » Tue Apr 21, 2020 7:48 pm

Not sure I understand what you are trying to do. What is "MindFire's Auto Logout solution"? What are you trying to accomplish?

Your code snippet shows some manipulation of a form's "blueprint" via the solutionModel. putClientProperty is a runtime method, not design time. So to put a client property on that element at runtime, you finish creating/modifying your form and the you could do something like

Code: Select all
var runtimeForm = forms[frm.name] //get the runtime instance of that frm
var runtimeHtmlArea = runtimeForm.elements[htmlarea.name] //get the runtime html area element
runtimeHtmlArea.putClientProperty(APP_UI_PROPERTY.TRUST_DATA_AS_HTML, true);


But maybe you can elaborate why you want to create/modify your form via code in the first place?
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3692
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Cannot set TRUST_DATA_AS_HTML true for newHtmlArea()?

Postby pbdavis » Wed Apr 22, 2020 2:43 pm

Thanks Patrick, your code snippet worked! :D
But to answer your questions:
Not sure I understand what you are trying to do. What is "MindFire's Auto Logout solution"? What are you trying to accomplish?

MindFire has an example that produces a pop-up that is created on the fly in javascript after a timer goes off (idle time = timer value). However, this was done before Servoy changed and added a new APP property (APP_UI_PROPERTY.TRUST_DATA_AS_HTML, default=false) introduced in 8.1.1. This stopped javascript from running by default. So, I'm trying to get this auto logout solution to work in latest version of Servoy, without having to set APP_UI_PROPERTY.TRUST_DATA_AS_HTML=true for the whole application.
Thanks again.
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 8 guests