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-issue-with-Tapestry-4-tp5718593.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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

Reply via email to