You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kiss Izolda <iz...@freemail.hu> on 2010/01/29 15:39:01 UTC

using back button with clientValidation from

Hi,

I have forms with param clientValidation="true". I need two buttons: one submit and one back. As I havn't found any better solution I have iplemented the back button as org.apache.tapestry5.corelib.components.Sumbit (Java code has to be run before returning to the previous page). The problem is when the back button is peressed fields with param validate="required" can't be empty.
I migth need some component like "ActionButton" which functions as an action link and is rendered as input type="button". (I guess I could trick simulating function of an action link by adding an onlick param to the button, but hope there does a proper solution exist.)

thanks in advance

Izolda

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: using back button with clientValidation from

Posted by Kiss Izolda <iz...@freemail.hu>.
Hi Sven,

thanks for the sample
I find editForm.clearErrors() quite useful.

>@Component(parameters = {"value=message:button.value.cancel"})>
>private Submit cancelButton;>

I have tried the following:
@Component(parameters = { "type=message:button" })
private Submit sbtBack;
(button was defined as button=button in the property file)
unfortunately the input rendered with type="submit"

it is not sufficient when a form has param clientValidation="true" and fileds with validate="required"

the result of @Component(type = "button") was exception

Izolda

ps: my Tapestry version is 5.1.0.5

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: using back button with clientValidation from

Posted by Sven Homburg <ho...@googlemail.com>.
@Component(parameters = {"value=message:button.value.cancel"})
private Submit cancelButton;

private boolean isCancelButtonPressed;

@OnEvent(component = "cancelButton", value = EventConstants.SELECTED)
void onSelectedFromCancelButton()
{
        isCancelButtonPressed = true;
        editForm.clearErrors();
}

@CommitAfter
@OnEvent(value = EventConstants.SUCCESS)
Class onSuccess()
{
        if (!isCancelButtonPressed)
            shipmentOrderDAO.doSave(entity);

        return BrowseOrder.class;
}


with regards
Sven Homburg
Founder of the Chenille Kit Project
http://chenillekit.codehaus.org




2010/1/29 Kiss Izolda <iz...@freemail.hu>

> Hi,
>
> I have forms with param clientValidation="true". I need two buttons: one
> submit and one back. As I havn't found any better solution I have iplemented
> the back button as org.apache.tapestry5.corelib.components.Sumbit (Java code
> has to be run before returning to the previous page). The problem is when
> the back button is peressed fields with param validate="required" can't be
> empty.
> I migth need some component like "ActionButton" which functions as an
> action link and is rendered as input type="button". (I guess I could trick
> simulating function of an action link by adding an onlick param to the
> button, but hope there does a proper solution exist.)
>
> thanks in advance
>
> Izolda
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>