Transform component: bug apply twice

Hi,

I just had a little bug with system.gui.transform:

I have a table in the left of my screen which is visible or not, bind on a custom property in the root container, itself bind to a tag. So when this property change, I have 2 components to resize to avoid an empty place. I used the scripting on propertyChange for my custom property with system.gui.transform, once per component.

Now the problem is when my tag run from false to true, the script run twice, so my component are too small. It doesn’t occure in the other way. Another point is if I comment the second system.gui.transform, there is no problem. My custom property in the designer is here set to true. If I set it to false, I’ll have the problem in the other way only (component too big).

The tag is related to the connected user permission, to change it I have to switch. On log, I see the event.newValue is changing twice as well. And btw, i’m running on Ignition 7.9.5. The script is below.

Is there a solution, like using only one system.gui.transform for both components ?

Thanks.

if event.propertyName == “bIsAdmin”:

chart = event.source.getComponent(‘chart’)

chartNewX = chart.x
chartNewWidth = chart.width

if event.newValue:
#show tab
chartNewX = chartNewX + 5 + event.source.getComponent(‘tableList’).width
chartNewWidth = chartNewWidth - 5 - event.source.getComponent(‘tableList’).width
else:
#unshow tab
chartNewX = chartNewX - 5 - event.source.getComponent(‘tableList’).width
chartNewWidth = chartNewWidth + 5 + event.source.getComponent(‘tableList’).width

system.gui.transform(chart, newX=chartNewX, newWidth=chartNewWidth)

table = event.source.getComponent(‘ptableData’)

tableNewX = table.x
tableNewWidth = table.width

if event.newValue:
#show tab
tableNewX = tableNewX + 5 + event.source.getComponent(‘tableList’).width
tableNewWidth = tableNewWidth - 5 - event.source.getComponent(‘tableList’).width
else:
#unshow tab
tableNewX = tableNewX - 5 - event.source.getComponent(‘tableList’).width
tableNewWidth = tableNewWidth + 5 + event.source.getComponent(‘tableList’).width

system.gui.transform(table, newX=tableNewX, newWidth=tableNewWidth)

UPDATE:
Just tried using a group for the components (as container), this way I only have to use the transform script. Didn’t change a thing. But I noticed it occures only if a switch user while this window is open.
I get something: when reloading the window with login, the X and Width values are the ones in my designer. Transform doesn’t seem to change the component.x and component.width values, so when I try to change again, I don’t have the current values.
I change a bit my if state to apply the difference on NewX and NewWidth values only when newValue is false. It works, but that’s steel weird.