You can use a method to set the text property of the label (it doesn’t even have to have a dataprovider).
Of course you want to do this the moment any of the display data changes like on a onRecordSelection.
Indeed, what Robert explains, is exactly what I mean,
but why wouldn’t you use a calculation?
Servoy never allowed any calculation inside a display tag.
But let’s assume Servoy implements this, than they have to use the same technique as the calculations does.
And I believe this is the perfect example of doing this inside a calculation.
I assume %%numberOfPersonsRoles% is already a calculation or aggregate, so this will be cashed!
Yes the calculation will fire a lot, but this example does not give any roundtrips to the server, or new queries!
When using related data, than you have to be careful using calculation, or you have to know the impact, what you are doing!
Thanks all of you, yeahhh, lot of cash, ohhh, quite a pleasure
The reason I am careful with calcs is that we have already a lot of needed calcs in the application and they don’t make it faster
@Robert: Thanks for the hint, yes, that’s also a possibility. Although I still think my proposal would be the most elegant (with the least overhead)
@Harjo: Yes, numberOfPersonsRoles is an aggregate. I don’t think Servoy would need an additional calc, as my example with the short form of if then else also only needs the aggregate numberOfPersonsRoles (which exists already). And, as an advantage, the code would be well readable at the “right” place