private boolean setZScriptVariable(Component comp, String beanid, Object val) {
//for all loaded interperter, assign val to beanid
boolean found = false;
for(final Iterator it = comp.getPage().getLoadedInterpreters().iterator();
it.hasNext();) {
final Interpreter ip = (Interpreter) it.next();
if (ip instanceof HierachicalAware) {
final HierachicalAware ha = (HierachicalAware)ip;
if (ha.containsVariable(comp, beanid)) {
ha.setVariable(comp, beanid, val);
found = true;
}
} else if (ip.containsVariable(beanid)) {
ip.setVariable(beanid, val);
found = true;
}
}
return found;
}