use of com.servoy.j2db.server.ngclient.WebFormComponent in project servoy-client by Servoy.
the class WebFormController method setTabSequence.
@Override
public void setTabSequence(Object[] arrayOfElements) {
if (arrayOfElements == null) {
return;
}
Object[] elements = arrayOfElements;
if (elements.length == 1) {
if (elements[0] instanceof Object[]) {
elements = (Object[]) elements[0];
} else if (elements[0] == null) {
elements = null;
return;
}
}
tabSequence = new String[elements.length];
for (int i = 0; i < elements.length; i++) {
if (elements[i] instanceof RuntimeWebComponent) {
WebFormComponent component = ((RuntimeWebComponent) elements[i]).getComponent();
WebObjectSpecification spec = component.getSpecification();
Collection<PropertyDescription> properties = spec.getProperties(NGTabSeqPropertyType.NG_INSTANCE);
if (properties.size() == 1) {
PropertyDescription pd = properties.iterator().next();
Integer val = Integer.valueOf(i + 1);
if (!val.equals(component.getProperty(pd.getName())))
component.setProperty(pd.getName(), val);
}
tabSequence[i] = component.getName();
} else {
Debug.error("Could not set the tab sequence property for element " + elements[i]);
}
}
}
Aggregations