private void processSetProperty(String appId, String windowId, String eventSessionId, SetPropertyGVO setProperty, BuiltInComponentGVO builtInComponentGVO, List<UIObject> uiObjects) { for (int i=0; i< uiObjects.size(); i++) { UIObject uiObject = uiObjects.get(i); if (uiObject != null) { processProperty(uiObject, appId, windowId, eventSessionId, builtInComponentGVO, setProperty); if ((uiObject instanceof HasWidgets) && (appliesToChild(uiObject, setProperty))) { HasWidgets hasWidgets = (HasWidgets) uiObject; processWidgets(hasWidgets, appId, windowId, eventSessionId, builtInComponentGVO, setProperty); } // Choice items are also stored with the same id or name of the parent choice in repository to make it accessble for getting values. // So When setting a property of a choice we need to skip the items comes just after the Choice. // For eg: When we set the visibility of Choice we have to do it for only Choice to for the items. if ((uiObject instanceof HasChoice) && (uiObject instanceof IndexedPanel)) { int choiceItemCount = ((IndexedPanel)uiObject).getWidgetCount(); i += choiceItemCount; } } } }
public void execute(BuiltInFunctionGVO builtInFunction) { if (builtInFunction instanceof SetPropertyGVO) { SetPropertyGVO setProperty = (SetPropertyGVO) builtInFunction; if (builtInFunction.getComponents() != null) { for (BuiltInComponentGVO builtInComponentGVO : builtInFunction.getComponents()) { String component = builtInComponentGVO.getComponentIdUUID(); List<UIObject> uiObjects = null; if (component == null) { uiObjects = RendererHelper.getNamedComponent(builtInComponentGVO.getComponentName()); } else if (component.contains(MENU) || component.contains(TOOLBAR)) { uiObjects = getUIObjectsForMenuOrToolbar(component); } else { uiObjects = getUIObjects(component, setProperty); } if (uiObjects != null){ for (int i=0; i< uiObjects.size(); i++) { UIObject uiObject = uiObjects.get(i); if (uiObject != null) { processProperty(uiObject, builtInComponentGVO, setProperty); if ((uiObject instanceof HasWidgets) && (appliesToChild(uiObject, setProperty))) { HasWidgets hasWidgets = (HasWidgets) uiObject; processWidgets(hasWidgets, builtInComponentGVO, setProperty); } // Choice items are also stored with the same id or name of the parent choice in repository to make it accessble for getting values. // So When setting a property of a choice we need to skip the items comes just after the Choice. // For eg: When we set the visibility of Choice we have to do it for only Choice to for the items. if ((uiObject instanceof HasChoice) && (uiObject instanceof IndexedPanel)) { int choiceItemCount = ((IndexedPanel)uiObject).getWidgetCount(); i += choiceItemCount; } } } } } } } FunctionsExecutor.setProcessedBuiltIn(true); }