Hi!

Please don't post the same message to two different mailing lists. This one should have been posted only in the users one, not in dev.

On Tue, 11 Dec 2012 08:36:33 -0200, SAMPY <[email protected]> wrote:

I have got few simple IformComponent elements in a page. But the page
contains some of dynamic components, those again have some IformComponent
fields.

How can I delegate validation messages in that case.

Let me show with an example.


where this PaymentSelection is component, that renders the html dynamically.

Validation Java Code :

        FormBean bean = this.getHotelsFormBean();
        IValidationDelegate delegate = this.getValidationDelegate();

        boolean isValid = super.validateForm(bean, delegate);

        try {
            if(Utils.isNullOrEmpty(bean.getHotelName())) {
String message = this.getMessages().getMessage("bb_ERR5");
                this.error(delegate, (IFormComponent)
this.getComponent("hotelName"), message,
                           ValidationConstraint.REQUIRED);
                isValid = false;
            }


 message =  this.getMessage("valid", new String[] { "cardnum" });
 this.error(delegate, (IFormComponent)
this.getComponent("paymentSelectionComponent").getComponent("code"),
message,
                             ValidationConstraint.REQUIRED);
    isValid = false;
    break;

In general, it delegates the error message for hotel fields(that hotel name
not given sort of message), but it doesn't  delegate the dynamic
component(PaymentSelection) error message with above message.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Validation-Message-with-Tapestry-4-tp5718594.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



--
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to