PDA

View Full Version : Multiple Values for <hideonvalue>?



malvok
March 19th, 2013, 15:47
I'd like to hide the value of my numbercontrol if it is 10-15.

<hideonvalue>10</hideonvalue>
...
<hideonvalue>15</hideonvalue>

Doesn't work.

Anyone know how to do this?

Zeus
March 19th, 2013, 20:02
Is this control's value entered by the user? If so, then one idea would be to:

Set the <hideonvalue> to 0 for the control.

Create an onLoseFocus() event handler for the control. In it check the value of the control, if its between 10-15, store the value in a local variable and then reset the value to 0. e.g.


local myvariable = nil;

function onLoseFocus
if getValue() >= 10 and getValue <= 15 then
myvariable = getValue();
setValue(0);
end
end

You can then use myvariable to access the original value (if required), regardless when the control's focus is lost, if its value is set between 10-15, it should trigger the update to 0 thus effectively hiding the value.