Package org.apache.cocoon.forms

Examples of org.apache.cocoon.forms.FormsRuntimeException


     *
     * @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


        return this.validationError == null ? this.value : null;
    }

    public void setValue(Object newValue) {
        if (newValue != null && !getDatatype().getTypeClass().isAssignableFrom(newValue.getClass())) {
            throw new FormsRuntimeException("Incorrect value type for '" + getRequestParameterName() +
                                            "'. Expected " + getDatatype().getTypeClass() + ", got " + newValue.getClass() + ").",
                                            getLocation());
        }
        // Is it a new value?
        boolean changed;
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 initialize() {
        String caseWidgetId = definition.getCaseWidgetId();
        this.caseWidget = getParent().lookupWidget(caseWidgetId);
        if (this.caseWidget == null) {
            throw new FormsRuntimeException("Could not find case widget '" + caseWidgetId + "' for union '" + getId() + "'.",
                                            getLocation());
        }

        ((ValueChangedListenerEnabled) caseWidget).addValueChangedListener(
            new ValueChangedListener() {
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

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.