phantomwhale
December 18th, 2010, 05:00
Hi,
Is there a simple method to loop over all the controls within a window instance ? For instance, if I wanted to set a label, number and string field invisible, I can currently say :
function show(bool)
label.setVisible(bool)
numberField.setVisible(bool)
stringField.setVisible(bool)
end
But is it possible to write something like :
function show(bool)
for windowControl in sheetdata do
windowControl.setVisible(bool)
end
end
My reason for trying this is I am trying to set a cluster of controls to be visible or invisible all based on a database node value, and currently the method I was trying was to put them all within a subwindow, and then the window can switch itself on and off as it decides. However, I just discovered that the windowinstance object has no "setVisible" method, hence I was at least hoping to access the window's "sheetdata" elements dynamically, otherwise there really is no reason to have them all in a subwindow in the first place...
Hopefully that's semi-clear !
Ben
Is there a simple method to loop over all the controls within a window instance ? For instance, if I wanted to set a label, number and string field invisible, I can currently say :
function show(bool)
label.setVisible(bool)
numberField.setVisible(bool)
stringField.setVisible(bool)
end
But is it possible to write something like :
function show(bool)
for windowControl in sheetdata do
windowControl.setVisible(bool)
end
end
My reason for trying this is I am trying to set a cluster of controls to be visible or invisible all based on a database node value, and currently the method I was trying was to put them all within a subwindow, and then the window can switch itself on and off as it decides. However, I just discovered that the windowinstance object has no "setVisible" method, hence I was at least hoping to access the window's "sheetdata" elements dynamically, otherwise there really is no reason to have them all in a subwindow in the first place...
Hopefully that's semi-clear !
Ben