Package org.openfaces.component.timetable

Examples of org.openfaces.component.timetable.DeleteEventAction


    }

    private List<EventAction> getEventActionComponents(FacesContext context, EventActionBar actionBar) {
        List<EventAction> result = new ArrayList<EventAction>();
        List<UIComponent> children = actionBar.getChildren();
        DeleteEventAction deleteEventAction = null;
        for (UIComponent component : children) {
            if (!(component instanceof EventAction))
                continue;
            if (component.isRendered())
                result.add((EventAction) component);
            if (component instanceof DeleteEventAction)
                deleteEventAction = (DeleteEventAction) component;
        }
        TimetableView timeTable = (TimetableView) actionBar.getParent();
        boolean tableEditable = timeTable.isEditable();
        if (tableEditable) {
            if (deleteEventAction == null) {
                deleteEventAction = Components.createComponent(context,
                        DeleteEventAction.COMPONENT_TYPE, DeleteEventAction.class, actionBar, "deleteEventAction");
                result.add(deleteEventAction);
                actionBar.getChildren().add(deleteEventAction);
            }
            deleteEventAction.setOnclick("O$.Timetable._deleteCurrentTimetableEvent(event)");
            Confirmation confirmation = timeTable.getDeletionConfirmation();

            if (confirmation != null) {
                if (deleteEventAction.isRendered() && deleteEventAction.getShowConfirmation()) {
                    confirmation.setRendered(true);
                    if (deleteEventAction.getId() == null)
                        deleteEventAction.setId(context.getViewRoot().createUniqueId());
                    confirmation.setFor(deleteEventAction.getId());
                    confirmation.setEvent("click");
                } else
                    confirmation.setRendered(false);
            }
        }
View Full Code Here

TOP

Related Classes of org.openfaces.component.timetable.DeleteEventAction

Copyright © 2018 www.massapicom. 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.