Package org.apache.cocoon.forms

Examples of org.apache.cocoon.forms.FormsRuntimeException


        // Handle row move. It's important for this to happen *after* row.readFromRequest,
        // as reordering rows changes their IDs and therefore their child widget's ID too.
        if (action.equals("move")) {
            if (!this.orderable) {
                throw new FormsRuntimeException(this + " is not orderable", getLocation());
            }
            int from = Integer.parseInt(req.getParameter(paramName + ".from"));
            int before = Integer.parseInt(req.getParameter(paramName + ".before"));
           
            Object row = this.rows.get(from);
            // Add to the new location
            this.rows.add(before, row);
            // Remove from the previous one, taking into account potential location change
            // because of the previous add()
            if (before < from) from++;
            this.rows.remove(from);
           
            // Needs refresh
            getForm().addWidgetUpdate(this);
           
        } else {
            throw new FormsRuntimeException("Unknown action " + action + " for " + this, getLocation());
        }
    }
View Full Code Here


     *
     * @since 2.1.9
     */
    public void setSuggestionLabel(String label) {
        if (this.fieldDefinition.getSuggestionList() == null) {
            throw new FormsRuntimeException(this + " has no suggestion list", this.getLocation());
        }
        this.setAttribute(SUGGESTED_LABEL_ATTR, label);
    }
View Full Code Here

            returnForm = (Form) this.request.getAttribute(attributeName);
        }
        if(returnForm != null) {
            return returnForm;
        }
        throw new FormsRuntimeException("The template cannot find a form object");
    }
View Full Code Here

    }
   
    protected boolean pushWidget(String path, boolean unused) throws SAXException {
        Widget parent = peekWidget();
        if (path == null || path.length() == 0) {
            throw new FormsRuntimeException("Missing 'id' attribute on template instruction");
        }
        Widget widget = parent.lookupWidget(path);
        if (widget == null) {
            throw new FormsRuntimeException(parent + " has no child named '" + path + "'", parent.getLocation());
        }

        String id = widget.getFullName();
        // Is there an updated widget at a higher level in the template?
        boolean inUpdatedTemplate = ((Boolean)widgetStack.peek(1)).booleanValue();
View Full Code Here

        Widget result = currentWidget.lookupWidget(path);

        if (result != null) {
            return result;
        }
        throw new FormsRuntimeException(currentWidget + " has no child named '" + path + "'", currentWidget.getLocation());
    }
View Full Code Here

    private Repeater getRepeater(Widget currentWidget, String id) {
        Widget child = getWidget(currentWidget, id);
        if (child instanceof Repeater) {
            return (Repeater)child;
        }
        throw new FormsRuntimeException(child + " is not a repeater", child.getLocation());
    }
View Full Code Here

    public Object getClassBody(String id) {
        Object result = this.classes == null ? null : this.classes.get(id);

        if (result == null) {
            throw new FormsRuntimeException("No class '" + id + "' has been defined.");
        }
        return result;
    }
View Full Code Here

    }

    public void createWidget(Widget parent, String id) {
        WidgetDefinition widgetDefinition = (WidgetDefinition) widgetDefinitionsById.get(id);
        if (widgetDefinition == null) {
            throw new FormsRuntimeException(containerDefinition.getId() + ": WidgetDefinition '" + id + "' does not exist.",
                                            containerDefinition.getLocation());
        }

        Widget widget = widgetDefinition.createInstance();
        if (widget != null) {
View Full Code Here

    protected void addSplitMapping(int group, String fieldId) {
        checkMutable();

        if (mappedFields.contains(fieldId)) {
            throw new FormsRuntimeException("Field '" + fieldId + "' is already mapped to another group.",
                                            getLocation());
        }

        mappedFields.add(fieldId);
View Full Code Here

     *
     * @since 2.1.9
     */
    public void setSuggestionLabel(String label) {
        if (this.definition.getSuggestionList() == null) {
            throw new FormsRuntimeException("Field '" + getRequestParameterName() + "' has no suggestion list.",
                                            getLocation());
        }
        setAttribute(SUGGESTED_LABEL_ATTR, label);
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.forms.FormsRuntimeException

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.