Yes.

For now, I used an EnhacementWorker, like this:

 <contribution configuration-id="tapestry.enhance.EnhancementWorkers">
   <command id="inject-formdelegate-worker"
            object="service:ValidationDelegateEnhancementWorker"
            before="tapestry.enhance.page-detach-listener" />
 </contribution>

 <service-point id="ValidationDelegateEnhancementWorker"
                interface="org.apache.tapestry.enhance.EnhancementWorker">
     <invoke-factory>
<construct class="com.dtqsoftware.utils.web.enhance.FormDelegateEnhancementWorker">
         </construct>
     </invoke-factory>
 </service-point>

And in FormDelegateEnhancementWorker:

       if (AjaxForm.class.isAssignableFrom(op.getBaseClass())) {
           if(spec.getBeanSpecification("dtqValidationDelegate") == null) {
               IBeanSpecification beanSpec = new BeanSpecification();
               beanSpec.setLifecycle(BeanLifecycle.RENDER);
beanSpec.setClassName(DtqValidationDelegate.class.getName());
               beanSpec.setLocation(spec.getLocation());
               beanSpec.setDescription("Dtq Validation Delegate");
spec.addBeanSpecification("dtqValidationDelegate", beanSpec);
           }

IParameterSpecification paramSpec = spec.getParameter("delegate");
           paramSpec.setDefaultValue("bean:dtqValidationDelegate");
       }

Probably an overkill, though ;). But very transparent for the forms themselves.

--
Ing. Leonardo Quijano Vincenzi
DTQ Software


Jesse Kuhnert wrote:
Ok ....This is an incredibly simple problem to solve. Can you outline
exactly what type of requirements you have?

Ie do you just want to be able to globally set a default ValidationDelegate?
Is that all?




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to