src/main/java/org/efaps/ui/wicket/components/footer/AjaxSubmitCloseButton.java
private boolean executeEvents(final AjaxRequestTarget _target,
                                  final Map<String, String[]> _other,
                                  final List<Classification> _classifications)
        throws EFapsException
    {
        AjaxSubmitCloseButton.LOG.trace("entering executeEvents");
        boolean ret = true;
        final ICmdUIObject cmdUIObject = (ICmdUIObject) getPage().getDefaultModelObject();
        final TargetMode mode;
        if (cmdUIObject instanceof IModeObject) {
            mode = ((IModeObject) cmdUIObject).getMode();
        } else {
            mode = TargetMode.UNKNOWN;
        }
        final List<Object> tuplets = new ArrayList<>();
        tuplets.add(ParameterValues.OTHERS);
        tuplets.add(_other);
        tuplets.add(ParameterValues.ACCESSMODE);
        tuplets.add(mode);

        if (cmdUIObject instanceof AbstractUIPageObject) {
            tuplets.add(ParameterValues.OIDMAP4UI);
            tuplets.add(((AbstractUIPageObject) getForm().getPage().getDefaultModelObject()).getUiID2Oid());
        }
        if (_classifications.size() > 0) {
            tuplets.add(ParameterValues.CLASSIFICATIONS);
            tuplets.add(_classifications);
        }

        final List<Return> returns = cmdUIObject.executeEvents(EventType.UI_COMMAND_EXECUTE, tuplets.toArray());

        for (final Return oneReturn : returns) {
            if (oneReturn.get(ReturnValues.TRUE) == null && !oneReturn.isEmpty()
                            && oneReturn.get(ReturnValues.VALUES) instanceof String) {
                boolean sniplett = false;
                String key = (String) oneReturn.get(ReturnValues.VALUES);
                if (key == null) {
                    key = (String) oneReturn.get(ReturnValues.SNIPLETT);
                    sniplett = true;
                }
                showDialog(_target, key, sniplett, false);

                ret = false;
                break;
            } else if (oneReturn.get(ReturnValues.TRUE) != null && !oneReturn.isEmpty()
                            && cmdUIObject.getCommand().isTargetShowFile()) {
                if (oneReturn.get(ReturnValues.VALUES) instanceof File) {
                    final File file = (File) oneReturn.get(ReturnValues.VALUES);
                    ((EFapsSession) getSession()).setFile(file);
                }
            }
            if (oneReturn.get(ReturnValues.INSTANCE) != null && cmdUIObject instanceof AbstractInstanceObject) {
                ((AbstractInstanceObject) cmdUIObject).setInstanceKey(((Instance) oneReturn.get(ReturnValues.INSTANCE))
                                .getKey());
            }
        }

        if (cmdUIObject instanceof AbstractUIPageObject && ((AbstractUIPageObject) cmdUIObject).isOpenedByPicker()) {
            final PageReference pageRef = ((AbstractContentPage) getForm().getPage()).getCalledByPageReference();
            ((AbstractUIPageObject) cmdUIObject).getPicker().executeEvents(EventType.UI_COMMAND_EXECUTE,
                            ParameterValues.OTHERS, _other);
            ((AbstractUIObject) pageRef.getPage().getDefaultModelObject()).setPicker(
                            ((AbstractUIPageObject) cmdUIObject).getPicker());
        }
        return ret;
    }
private boolean executeEvents(final AjaxRequestTarget _target,
                                  final Map<String, String[]> _other,
                                  final List<Classification> _classifications)
        throws EFapsException
    {
        AjaxSubmitCloseButton.LOG.trace("entering executeEvents");
        boolean ret = true;
        final ICmdUIObject cmdUIObject = (ICmdUIObject) getPage().getDefaultModelObject();
        final TargetMode mode;
        if (cmdUIObject instanceof IModeObject) {
            mode = ((IModeObject) cmdUIObject).getMode();
        } else {
            mode = TargetMode.UNKNOWN;
        }
        final List<Object> tuplets = new ArrayList<>();
        tuplets.add(ParameterValues.OTHERS);
        tuplets.add(_other);
        tuplets.add(ParameterValues.ACCESSMODE);
        tuplets.add(mode);

        if (cmdUIObject instanceof AbstractUIPageObject) {
            tuplets.add(ParameterValues.OIDMAP4UI);
            tuplets.add(((AbstractUIPageObject) getForm().getPage().getDefaultModelObject()).getUiID2Oid());
        }
        if (_classifications.size() > 0) {
            tuplets.add(ParameterValues.CLASSIFICATIONS);
            tuplets.add(_classifications);
        }

        final List<Return> returns = cmdUIObject.executeEvents(EventType.UI_COMMAND_EXECUTE, tuplets.toArray());

        for (final Return oneReturn : returns) {
            if (oneReturn.get(ReturnValues.TRUE) == null && !oneReturn.isEmpty()
                            && oneReturn.get(ReturnValues.VALUES) instanceof String) {
                boolean sniplett = false;
                String key = (String) oneReturn.get(ReturnValues.VALUES);
                if (key == null) {
                    key = (String) oneReturn.get(ReturnValues.SNIPLETT);
                    sniplett = true;
                }
                showDialog(_target, key, sniplett, false);

                ret = false;
                break;
            } else if (oneReturn.get(ReturnValues.TRUE) != null && !oneReturn.isEmpty()
                            && cmdUIObject.getCommand().isTargetShowFile()) {
                if (oneReturn.get(ReturnValues.VALUES) instanceof File) {
                    final File file = (File) oneReturn.get(ReturnValues.VALUES);
                    ((EFapsSession) getSession()).setFile(file);
                }
            }
            if (oneReturn.get(ReturnValues.INSTANCE) != null && cmdUIObject instanceof AbstractInstanceObject) {
                ((AbstractInstanceObject) cmdUIObject).setInstanceKey(((Instance) oneReturn.get(ReturnValues.INSTANCE))
                                .getKey());
            }
        }

        if (cmdUIObject instanceof AbstractUIPageObject && ((AbstractUIPageObject) cmdUIObject).isOpenedByPicker()) {
            final PageReference pageRef = ((AbstractContentPage) getForm().getPage()).getCalledByPageReference();
            ((AbstractUIPageObject) cmdUIObject).getPicker().executeEvents(EventType.UI_COMMAND_EXECUTE,
                            ParameterValues.OTHERS, _other);
            ((AbstractUIObject) pageRef.getPage().getDefaultModelObject()).setPicker(
                            ((AbstractUIPageObject) cmdUIObject).getPicker());
        }
        return ret;
    }
Execute the events which are related to CommandAbstract calling the Form.

@param _target   AjaxRequestTarget to be used in the case a ModalPage
should be called
@param _other    Parameters to be passed on to the Event, defined as
{@link org.efaps.admin.event.Parameter.ParameterValues.OTHERS}
@param _classifications  List of uuid of classifcationsto be passed on
to the Event, defined as
{@link org.efaps.admin.event.Parameter.ParameterValues.OTHERS}
@return true if the events where executed successfully, otherwise false
@throws EFapsException on error