Page 1 of 1

refresh() property on a textBox

Posted: Thu Nov 30, 2017 6:57 am
by k2R400
Hello,

I have to change dynamicly the "choice option field" of a textBox with javascript.
How to refresh the database-driven auto-complete ?

Best regards

Re: refresh() property on a textBox

Posted: Thu Nov 30, 2017 9:54 am
by Emily
Hi Patrick,

If you need to re-render your autocomplete textbox after changing the 'choice option field' property, you can do so by using the applyProperty() API to reapply the 'field type' property of the textbox. So, after changing the 'choice option field' in your JavaScript, you could do something like this:

Code: Select all

applyProperty("TextBoxID", "field type", "textbox");
You will, of course, need to use the appropriate ID of your textbox in the example above but this should re-render your textbox to include the appropriate autocomplete options. If you need more information about the applyProperty() API, you can look at the following documentation page: http://www.profoundlogic.com/docs/pages ... Id=3276854.

I hope that this helps!

--Emily

Re: refresh() property on a textBox

Posted: Fri Dec 01, 2017 2:27 am
by k2R400
Thank you Emily,
But it does not work when there are several fields displayed.
I use the latest version available.

Re: refresh() property on a textBox

Posted: Fri Dec 01, 2017 9:37 am
by lyarbrough
Hi Patrick,

Could you explain in detail what you're trying to accomplish with your textbox? What are you referring to when you mention that there are several fields displayed? The more information we have about this, the better we can support you. It may help us to better understand this if we had a dump of your screen. Could you send us a screen dump (Ctrl-F9) of the affected screen where you're experiencing this problem? To do this, visit the problem screen and press Ctrl-F9. When you are prompted to save or open the file, save the file and email it to us.

--Lillie

Re: refresh() property on a textBox

Posted: Fri Dec 01, 2017 4:17 pm
by Scott Klement
You should never be able to change the "choice option field", unless you're using the old (not very secure) database engine. The ability to change the code in an SQL statement is very dangerous, because it means anyone could change that SQL statement, possibly into a completely different statement.

For that reason, you should only be able to change the "parameter value" properties at run-time. The rest of the database-driven properties should only be changed in the visual designer. (Non-database related properties can also be changed.)

If you want to be able to change the actual SQL statement (different columns, table, etc) then you'll have to load the textbox in a different way. It can be done with the "choices / choice values" properties, or with the "choices url" property.