Examples of ActionLink


Examples of org.apache.click.control.ActionLink

     *
     * @return true if further processing should continue or false otherwise
     */
    @Override
    public boolean onProcess() {
        ActionLink controlLink = getControlLink();

        boolean continueProcessing = super.onProcess();

        if (!controlLink.isClicked() && getForm().isFormSubmission()) {
            Field pageField = getForm().getField(PAGE);
            pageField.onProcess();
            if (StringUtils.isNotBlank(pageField.getValue())) {
                setPageNumber(Integer.parseInt(pageField.getValue()));
            }

            Field columnField = getForm().getField(COLUMN);
            columnField.onProcess();
            setSortedColumn(columnField.getValue());

            Field ascendingField = getForm().getField(ASCENDING);
            ascendingField.onProcess();
            setSortedAscending("true".equals(ascendingField.getValue()));

            // Ensure data is retrieved before getRowCount can be called
            getRowList();

            // Range sanity check
            int pageNumber = Math.min(getPageNumber(), getRowCount() - 1);
            pageNumber = Math.max(pageNumber, 0);
            setPageNumber(pageNumber);

            //Have to sort list here before we process each field. Otherwise if
            //sortRowList() is only called in Table.toString(), the fields values set here
            //will not correspond to their rows in the rowList.
            sortRowList();

            int firstRow = 0;
            int lastRow = 0;

            if (getDataProvider() instanceof PagingDataProvider) {
                lastRow = getRowList().size();
            } else {
                firstRow = getFirstRow();
                lastRow = getLastRow();
            }

            List rowList = getRowList();
            List columnList = getColumnList();

            for (int i = firstRow; i < lastRow; i++) {
                Object row = rowList.get(i);

                for (int j = 0; j < columnList.size(); j++) {

                    Column column = (Column) columnList.get(j);

                    if (column instanceof FieldColumn) {
                        FieldColumn fieldColumn = (FieldColumn) column;
                        Field field = fieldColumn.getField();

                        if (field != null) {
                            field.setName(column.getName() + "_" + i);

                            field.onProcess();

                            if (field.isValid()) {
                                fieldColumn.setProperty(row, column.getName(),
                                    field.getValueObject());
                            } else {
                                getForm().setError(getMessage("formtable-error"));
                            }
                        }
                    }
                }
            }
        } else {
            String page = controlLink.getParameter(PAGE);
            getForm().getField(PAGE).setValue(page);

            String column = controlLink.getParameter(COLUMN);
            getForm().getField(COLUMN).setValue(column);

            String ascending =  controlLink.getParameter(ASCENDING);
            getForm().getField(ASCENDING).setValue(ascending);

            // Table.onProcess() flips the sort order, so to ensure the ASCENDING
            // Field value is in sync with the Table, we flip the field value as
            // well.
            String sort = controlLink.getParameter(SORT);
            if ("true".equals(sort) || ascending == null) {
                getForm().getField(ASCENDING).setValue("true".equals(ascending) ? "false" : "true");
            }
        }

View Full Code Here

Examples of org.apache.click.control.ActionLink

            // Handle ActionLink (perhaps other link controls too?) differently
            // as it doesn't render the "name" attribute. The "name" attribute
            // is used by links for bookmarking purposes. Instead set the class
            // attribute to the link's name and use that as the selector.
            if (control instanceof ActionLink) {
                ActionLink link = (ActionLink) control;
                if (!link.hasAttribute("class")) {
                    link.setAttribute("class", '-' + name);
                }
                buffer.append(tag).append("[class*=");
                buffer.append(link.getAttribute("class")).append("]");

            } else {
                buffer.append(tag).append("[name=");
                buffer.append(name).append("]");
            }
View Full Code Here

Examples of org.apache.click.control.ActionLink

     * @throws IllegalArgumentException if the name is null
     */
    @Override
    public void setName(String name) {
        super.setName(name);
        ActionLink localTabLink = getTabLink();
        localTabLink.setName("tabLink-" + getName());
        add(localTabLink);
    }
View Full Code Here

Examples of org.apache.click.control.ActionLink

     *
     * @return the tab switching action link
     */
    public ActionLink getTabLink() {
        if (tabLink == null) {
            tabLink = new ActionLink();
        }
        return tabLink;
    }
View Full Code Here

Examples of org.apache.click.control.ActionLink

                }
            }
        } else {
            // Explicitly bind the link to the request and check if the
            // link was clicked
            ActionLink link = getTabLink();
            link.bindRequestValue();
            if (link.isClicked()) {

                // Check which panel user selected and set that Panel as active
                for (int i = 0; i < getPanels().size(); i++) {
                    Panel panel = getPanels().get(i);

                    // Deactivate panel
                    panel.setActive(false);

                    if (link.getValue().equals(panel.getName())
                        && !panel.isDisabled()) {

                        setActivePanel(panel);
                    }
                }
View Full Code Here

Examples of org.apache.isis.viewer.scimpi.dispatcher.view.action.ActionLink

public class ProcessorLookup {
    private final Map<String, ElementProcessor> swfElementProcessors = new HashMap<String, ElementProcessor>();

    public void init() {
        addElementProcessor(new ActionLink());
        addElementProcessor(new ActionButton());
        addElementProcessor(new ActionForm());
        addElementProcessor(new ActionName());
        addElementProcessor(new AddMessage());
        addElementProcessor(new AddWarning());
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLink

                final ConfigurationTO configurationTO = model.getObject();

                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model);

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {

                        editConfigWin.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                return new ConfigurationModalPage(Configuration.this.getPageReference(), editConfigWin,
                                        configurationTO, false);
                            }
                        });

                        editConfigWin.show(target);
                    }
                }, ActionLink.ActionType.EDIT, "Configuration", "read");

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLink

                final NotificationTO notificationTO = model.getObject();

                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model);

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {

                        editNotificationWin.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                return new NotificationModalPage(Configuration.this.getPageReference(),
                                        editNotificationWin, notificationTO, false);
                            }
                        });

                        editNotificationWin.show(target);
                    }
                }, ActionLink.ActionType.EDIT, "Notification", "read");

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLink

                final ReportExecTO taskExecutionTO = model.getObject();

                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model);

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        reportExecMessageWin.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                return new ExecMessageModalPage(model.getObject().getMessage());
                            }
                        });
                        reportExecMessageWin.show(target);
                    }
                }, ActionLink.ActionType.EDIT, "Reports", "read", StringUtils.hasText(model.getObject().getMessage()));

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        reportExecExportWin.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                ReportModalPage.this.exportExecId = model.getObject().getId();
                                return new ReportExecResultDownloadModalPage(reportExecExportWin, ReportModalPage.this.
                                        getPageReference());
                            }
                        });
                        reportExecExportWin.show(target);
                    }
                }, ActionLink.ActionType.EXPORT, "Reports", "read", ReportExecStatus.SUCCESS.name().equals(
                        model.getObject().getStatus()));

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLink

                final AbstractSchemaTO schemaTO = model.getObject();

                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());

                panel.addWithRoles(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        modalWindow.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                AbstractSchemaModalPage page = SchemaModalPageFactory.getSchemaModalPage(
                                        attributableType, schemaType);

                                page.setSchemaModalPage(Schema.this.getPageReference(), modalWindow, schemaTO, false);

                                return page;
                            }
                        });

                        modalWindow.show(target);
                    }
                }, ActionType.EDIT, allowedReadRoles);

                panel.addWithRoles(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
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.