use of com.servoy.base.scripting.annotations.ServoyClientSupport in project servoy-client by Servoy.
the class JSBaseContainer method getWebComponents.
/**
* Returns all JSWebComponents of this form/container.
* If this method is called on a form, then it will return all web components on that form.
* If the form is responsive, it will return the web components from all the containers.
*
* @sample
* var webComponents = myForm.getWebComponents(false);
* for (var i in webComponents)
* {
* if (webComponents[i].name != null)
* application.output(webComponents[i].name);
* }
*
* @param returnInheritedElements boolean true to also return the elements from parent form
* @return the list of all JSWebComponents on this forms
*/
@ServoyClientSupport(mc = false, ng = true, wc = false, sc = false)
@JSFunction
public JSWebComponent[] getWebComponents(boolean returnInheritedElements) {
List<JSWebComponent> webComponents = new ArrayList<JSWebComponent>();
AbstractContainer form2use = returnInheritedElements ? getFlattenedContainer() : getContainer();
Iterator<WebComponent> iterator = form2use.getWebComponents();
while (iterator.hasNext()) {
WebComponent webComponent = iterator.next();
webComponents.add(createWebComponent(getCorrectIJSParent(this, webComponent), webComponent, application, false));
}
return webComponents.toArray(new JSWebComponent[webComponents.size()]);
}
use of com.servoy.base.scripting.annotations.ServoyClientSupport in project servoy-client by Servoy.
the class JSBaseContainer method getLayoutContainers.
/**
* Returns all JSLayoutContainers objects of this container
*
* @sample
* var frm = solutionModel.getForm("myForm");
* var containers = frm.getLayoutContainers();
* for (var c in containers)
* {
* var fname = containers[c].name;
* application.output(fname);
* }
*
* @param returnInheritedElements boolean true to also return the elements from parent form
* @return all JSLayoutContainers objects of this container
*/
@ServoyClientSupport(mc = false, ng = true, wc = false, sc = false)
@JSFunction
public JSLayoutContainer[] getLayoutContainers(boolean returnInheritedElements) {
List<JSLayoutContainer> containers = new ArrayList<JSLayoutContainer>();
AbstractContainer container = returnInheritedElements ? getFlattenedContainer() : getContainer();
Iterator<LayoutContainer> iterator = container.getLayoutContainers();
while (iterator.hasNext()) {
containers.add(application.getScriptEngine().getSolutionModifier().createLayoutContainer(this, iterator.next()));
}
return containers.toArray(new JSLayoutContainer[containers.size()]);
}
Aggregations