Package org.apache.tapestry.html

Examples of org.apache.tapestry.html.Body


        IEngineService service = engine.getService(Tapestry.DIRECT_SERVICE);
        ILink link = service.getLink(cycle, new DirectServiceParameter(this));

        symbols.put("URL", link.getURL());

        Body body = Body.get(cycle);

        if (body == null)
            throw new ApplicationRuntimeException(Tapestry
                    .getMessage("InspectorButton.must-be-contained-by-body"), this, null, null);
View Full Code Here


        String name = null;

        if (_eventHandlers == null)
            return;

        Body body = Body.get(cycle);

        if (body == null)
            throw new ApplicationRuntimeException(Tapestry
                    .getMessage("AbstractLinkComponent.events-need-body"), this, null, null);
View Full Code Here

        boolean disabled = isDisabled();

        if (!cycle.isRewinding())
        {
            Body body = Body.get(cycle);

            if (body == null)
                throw new ApplicationRuntimeException(
                    Tapestry.format("must-be-contained-by-body", "DatePicker"),
                    this,
View Full Code Here

        boolean disabled = isDisabled();
        if (!disabled)
        {
            if (!rewinding)
            {
                Body body = Body.get(cycle);

                if (body == null)
                    throw new ApplicationRuntimeException(Tapestry.format(
                            "must-be-contained-by-body",
                            "LinkSubmit"), this, null, null);

                // make sure the submit function is on the page (once)
                if (cycle.getAttribute(ATTRIBUTE_FUNCTION_NAME) == null)
                {
                    body
                            .addBodyScript("function submitLink(form, elementId) { form._linkSubmit.value = elementId; if (form.onsubmit == null || form.onsubmit()) form.submit(); }");
                    cycle.setAttribute(ATTRIBUTE_FUNCTION_NAME, this);
                }

                // one hidden field per form:
View Full Code Here

        // If some other field has taken the honors, then let it.

        if (cycle.getAttribute(SELECTED_ATTRIBUTE_NAME) != null)
            return;

        Body body = Body.get(cycle);

        // If not wrapped by a Body, then do nothing.

        if (body == null)
            return;

        IForm form = Form.get(cycle);

        String formName = form.getName();
        String textFieldName = getName();

        String fullName = "document." + formName + "." + textFieldName;

        body.addInitializationScript(fullName + ".focus();");
        body.addInitializationScript(fullName + ".select();");

        // Put a marker in, indicating that the selected field is known.

        cycle.setAttribute(SELECTED_ATTRIBUTE_NAME, Boolean.TRUE);
    }
View Full Code Here

        Resource location = new ClasspathResource(engine.getClassResolver(), scriptPath);

        IScript script = source.getScript(location);

        Body body = Body.get(cycle);

        if (body == null)
            throw new ApplicationRuntimeException(Tapestry
                    .getMessage("ValidField.must-be-contained-by-body"), field, null, null);
View Full Code Here

       
        IDirectEvent component = newMock(IDirectEvent.class);
        IWidget widget = newMock(IWidget.class);
       
        MockControl bodyControl = MockClassControl.createControl(Body.class);
        Body body = (Body) bodyControl.getMock();
       
        assertNotNull(worker.getScript(component));
        assertEquals(compScript, worker.getScript(component).getPath());
       
        assertNotNull(worker.getScript(widget));
View Full Code Here

        IResourceLocation location =
            new ClasspathResourceLocation(engine.getResourceResolver(), scriptPath);

        IScript script = source.getScript(location);

        Body body = Body.get(cycle);

        if (body == null)
            throw new ApplicationRuntimeException(
                Tapestry.getMessage("ValidField.must-be-contained-by-body"),
                field,
View Full Code Here

        // If some other field has taken the honors, then let it.

        if (cycle.getAttribute(SELECTED_ATTRIBUTE_NAME) != null)
            return;

        Body body = Body.get(cycle);

        // If not wrapped by a Body, then do nothing.

        if (body == null)
            return;

        IForm form = Form.get(cycle);

        String formName = form.getName();
        String textFieldName = getName();

        String fullName = "document." + formName + "." + textFieldName;

        body.addInitializationScript(fullName + ".focus();");
        body.addInitializationScript(fullName + ".select();");

        // Put a marker in, indicating that the selected field is known.

        cycle.setAttribute(SELECTED_ATTRIBUTE_NAME, Boolean.TRUE);
    }
View Full Code Here

                getSpecification().getSpecificationLocation().getRelativeLocation("Palette.script");

            _script = source.getScript(scriptLocation);
        }

        Body body = Body.get(cycle);
        if (body == null)
            throw new ApplicationRuntimeException(
                "Palette component must be wrapped by a Body.",
                this,
                null,
View Full Code Here

TOP

Related Classes of org.apache.tapestry.html.Body

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.