Data tag referencing a forms variable

On a NG Classic (and NG Titanium) form, I am using a label (Label - WebComponent → bootstrapcomponents-label) with a standard tag like %%selectedIndex%% which works fine.
Using on the same form a data tag like %%numberOfLessons%% which references a forms variable does not work. It works perfectly on a Smart Client form though.

Am I missing something?

Works fine for me in NG (not tested on TiNG)

Thanks Marc. I tested a bit more and found, when I move the label, for example some pixels to the left, it shows the (correct) value. But only once. The value (an integer with a i18n key) changes when another record is selected. But the new value is not displayed. Unless I move the label again. Very strange.
Don’t know if it may have to do with the ARM based Servoy Developer. I am using a MacBook Pro 2021.

Hi Robert,

I guess what you are saying is that you change the content of a form variable depending on the selected record which is not reflected on the label.
Just tested, but working fine for me.

var fvText = 'Count 0';

var fvCount = 0;


function onAction() {
   fvCount++;
   fvText = 'Count ' + utils.numberFormat(fvCount, '#');
}

Have added a bootstrap label to the form that has a value ‘%%fvText%%’ for the text property.
Added a button triggering the onAction method.

This all works as expected.

Hi Marc

Thanks a lot for your example. This situation works in my solution as well. But my case which did not work is like this:

/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"26D2D226-2FEB-4B3E-A4F1-01B8B900F684",variableType:8}
 */
var numberOfLessons = null;

	var queryNumberOfLessons = "\
		SELECT\
			COUNT(*)\
		FROM
		...

	numberOfLessons = databaseManager.getDataSetByQuery(scopes.coreConfiguration.defaultDataSourceServerName, queryNumberOfLessons, null, -1).getValue(1, 1);
	...

where numberOfLessons is the form variable used in the data tag.

Now I found that adding the code line

application.updateUI();

after the numberOflessons SOLVED the problem, i. e. displays the number of lessons in the data tag.

By the way, this is code in the fetchEvents() function of full calendar.

Thanks again for your help!