Examples of OUIObjectIterator


Examples of org.openfaces.component.OUIObjectIterator

                    int savedRowIndex = uiData.getRowIndex();
                    uiData.setRowIndex(-1);
                    idsArray.put(component.getClientId(context));
                    uiData.setRowIndex(savedRowIndex);
                } else if (component instanceof OUIObjectIterator) {
                    OUIObjectIterator ouiObjectIterator = (OUIObjectIterator) component;
                    String savedObjectId = ouiObjectIterator.getObjectId();
                    ouiObjectIterator.setObjectId(null);
                    idsArray.put(component.getClientId(context));
                    ouiObjectIterator.setObjectId(savedObjectId);
                } else {
                    idsArray.put(component.getClientId(context));
                }
            }
        return idsArray;
View Full Code Here

Examples of org.openfaces.component.OUIObjectIterator

                    }
                });
            return uiData;
        } else if (id.charAt(0) == ':' && parent instanceof OUIObjectIterator) {
            id = id.substring(1);
            final OUIObjectIterator iterator = (OUIObjectIterator) parent;
            final String prevObjectId = iterator.getObjectId();
            iterator.setObjectId(id);
            if (restoreDataPointerRunnables != null)
                restoreDataPointerRunnables.add(new Runnable() {
                    public void run() {
                        iterator.setObjectId(prevObjectId);
                    }
                });
            return (UIComponent) iterator;
        } else if (isNumberBasedId(id)) {
            Class clazz;
            try {
                clazz = Class.forName("com.sun.facelets.component.UIRepeat");
            } catch (ClassNotFoundException e) {
                clazz = null;
            }
            if (clazz != null && clazz.isInstance(parent)) {
                final Object uiRepeat = parent;
                ReflectionUtil.invokeMethod("com.sun.faces.facelets.component.UIRepeat", "setIndex",
                        new Class[]{Integer.TYPE}, new Object[]{Integer.parseInt(id)}, parent);
                if (restoreDataPointerRunnables != null)
                    restoreDataPointerRunnables.add(new Runnable() {
                        public void run() {
                            // there's no getIndex method in com.sun.faces.component.UIRepeat, so we can't restore
                            // the index in this way here
                        }
                    });
                return parent;
            } else if (parent instanceof Columns) {
                List<DynamicColumn> dynamicColumns = ((Columns) parent).toColumnList(context);
                int columnIndex = Integer.parseInt(id);
                final DynamicColumn dynamicColumn = dynamicColumns.get(columnIndex);
                final Runnable restoreVariables = dynamicColumn.enterComponentContext();
                if (restoreDataPointerRunnables != null)
                    restoreDataPointerRunnables.add(new Runnable() {
                        public void run() {
                            if (restoreVariables != null) restoreVariables.run();
                        }
                    });
                return parent;
            }
        }
        if (id.equals(parent.getId()))
            return parent;

        Iterator<UIComponent> iterator = parent.getFacetsAndChildren();
        while (iterator.hasNext()) {
            UIComponent child = iterator.next();
            Object prependId = child.getAttributes().get("prependId");
            if (child instanceof NamingContainer && !Boolean.FALSE.equals(prependId)) {
                if (id.equals(child.getId()))
                    return child;
            } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.