|
Hemdall Wanderer
Joined: 30 Nov 2006 Posts: 50
|
Posted: Tue Jan 25, 2011 5:10 am
Button caption doesn't update when indirect variable changes. |
As in the subject, caption and gauge value doesn't update when variable changes.
Code: |
<button type="Gauge" autosize="false" width="218" height="20" autopos="false" left="1698" top="100" toolbar="2" iconleft="false" inset="true" toolstyle="true" stack="true" color="#00FF80" gaugelowcol="red" gaugebackcol="white" priority="10974" id="81">
<caption>@team_member_1 @{@team_member_1}</caption>
<value>kurwa</value>
<expr>@{@{@team_member_1}}</expr>
<gaugemax>7</gaugemax>
<gaugelow>4</gaugelow>
</button>
|
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Jan 25, 2011 1:27 pm |
That is expected. It only checks the direct variable. You simply can't do it with indirect variables.
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Tue Jan 25, 2011 2:29 pm |
One option is to manually update the button yourself when that indirect variable changes using the #UPDATE command.
|
|
_________________ Asati di tempari! |
|
|
|
Hemdall Wanderer
Joined: 30 Nov 2006 Posts: 50
|
Posted: Tue Jan 25, 2011 2:45 pm |
That might be helpful, I'll definitely check it out. Could you tell me please what will be more effective - using #update or using database variable: %dbkey(@team_member,1) @team_member.1 - all my buttons got caption like this in example and works fine, but I was suggested that efficiency of the code I'm using now is very poor so I'm trying to rewrite and improve it a bit.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Jan 25, 2011 4:17 pm |
The problem with using a database variable is that the button will try to update whenever _any_ element in the variable changes. If all your buttons are using the same variable, it means that all the buttons will try to update whenever any element in the variable changes, which is an awful lot of overhead. #update will be much, much more efficient.
|
|
|
|
Hemdall Wanderer
Joined: 30 Nov 2006 Posts: 50
|
Posted: Tue Jan 25, 2011 6:42 pm |
Yes, I'm aware of that but the thing is I'm going to create separate database variable for every team member of my team so every button will be using different variable than others. This way I believe only buttons assigned to variables which have changed will update what might be more effective than #update class of buttons within it.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Jan 25, 2011 9:22 pm |
I was just answering the question "Could you tell me please what will be more effective - using #update or using database variable".
|
|
|
|
Hemdall Wanderer
Joined: 30 Nov 2006 Posts: 50
|
Posted: Tue Jan 25, 2011 9:45 pm |
My question wasn't precise enough then - what will be more effective, using #update to update buttons' class or single record database variable for every button.
|
|
|
|
|
|