Package org.apache.tapestry

Examples of org.apache.tapestry.IForm


     *
     **/

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        IForm form = getForm(cycle);

        boolean rewinding = form.isRewinding();

        String name = form.getElementId(this);

        List selectedList = (List) getSelectedListBinding().getObject("selectedList", List.class);

        if (selectedList == null)
            throw Tapestry.createRequiredParameterException(this, "selectedList");
View Full Code Here


public abstract class FormConditional extends AbstractFormComponent
{

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        IForm form = getForm(cycle);

        boolean cycleRewinding = cycle.isRewinding();

        // If the cycle is rewinding, but not this particular form,
        // then do nothing (don't even render the body).

        if (cycleRewinding && !form.isRewinding())
            return;

        String name = form.getElementId(this);

        boolean condition = getCondition(cycle, form, name);

        // call listener
        IActionListener listener = getListener();
View Full Code Here

        {
            IFormComponent component = (IFormComponent) _component;

            if (!component.isDisabled())
            {
                IForm form = Form.get(cycle);

                if (form != null && form.isRewinding())
                {
                    Object value = readCurrentPropertyValue();

                    _binding.setObject(value);
                }
View Full Code Here

public abstract class Submit extends AbstractFormComponent{

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {

        IForm form = getForm(cycle);
   
        boolean rewinding = form.isRewinding();

        String name = form.getElementId(this);

        if (rewinding)
        {
            // Don't bother doing anything if disabled.
View Full Code Here

        "org.apache.tapestry.form.LinkSubmit_function";

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {

        IForm form = getForm(cycle);
        String formName = form.getName();

        boolean rewinding = form.isRewinding();

        String name = form.getElementId(this);

        IMarkupWriter wrappedWriter;

        if (cycle.getAttribute(ATTRIBUTE_NAME) != null)
            throw new ApplicationRuntimeException(
View Full Code Here

     *
     **/

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        IForm form = getForm(cycle);

        boolean rewinding = form.isRewinding();

        String name = form.getElementId(this);

        if (rewinding)
        {
            // If disabled, ignore anything that comes up from the client.

View Full Code Here

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        String value;

        IForm form = getForm(cycle);

        // It isn't enough to know whether the cycle in general is rewinding, need to know
        // specifically if the form which contains this component is rewinding.

        boolean rewinding = form.isRewinding();

        // If the cycle is rewinding, but the form containing this field is not,
        // then there's no point in doing more work.

        if (!rewinding && cycle.isRewinding())
            return;

        // Used whether rewinding or not.

        String name = form.getElementId(this);
   
        if (rewinding)
        {
            if (!isDisabled())
            {
View Full Code Here

public abstract class Upload extends AbstractFormComponent
{
    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        IForm form = getForm(cycle);
   
        String name = form.getElementId(this);

        if (form.isRewinding())
        {
          if (!isDisabled())
              setFile(cycle.getRequestContext().getUploadFile(name));

            return;
        }

    // Force the form to use the correct encoding type for
    // file uploads.
   
    form.setEncodingType("multipart/form-data");

        writer.beginEmpty("input");
        writer.attribute("type", "file");
        writer.attribute("name", name);
View Full Code Here

     *  is submitted (by checking {@link IForm#isRewinding()}.
     **/

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        IForm form = getForm(cycle);

        if (cycle.getAttribute(ATTRIBUTE_NAME) != null)
            throw new ApplicationRuntimeException(
                Tapestry.getMessage("Select.may-not-nest"),
                this,
                null,
                null);

        // It isn't enough to know whether the cycle in general is rewinding, need to know
        // specifically if the form which contains this component is rewinding.

        _rewinding = form.isRewinding();

        // Used whether rewinding or not.

        String name = form.getElementId(this);

        cycle.setAttribute(ATTRIBUTE_NAME, this);

        if (_rewinding)
        {
View Full Code Here

                throw new BindingException(msg, this, null, getBinding("field"), null);
            }
        }

        IForm form = Form.get(cycle);

        if (form == null)
        {
            String msg = Tapestry.getMessage("FieldLabel.must-be-contained-by-form");

            throw new ApplicationRuntimeException(msg, this, null, null);
        }

        IValidationDelegate delegate = form.getDelegate();

        if (delegate == null)
        {
            String msg =
                Tapestry.format("FieldLabel.no-delegate", getExtendedId(), form.getExtendedId());

            throw new ApplicationRuntimeException(msg, this, null, null);
        }

        delegate.writeLabelPrefix(field, writer, cycle);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IForm

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.