You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robin Wyles <ro...@robinwyles.com> on 2005/01/20 13:30:30 UTC

[CForms] Dynamically setting 'required' attribute

Hi,

I have a form in which I need to dynamically set the required attribute 
of certain fields. The form itself is created dynamically from a bean 
using <fd:union/> and such in the form definition file and  <fb:case/> 
in the binding file. This all works great, but  after looking at the 
api docs I have been unable to find a way to dynamically set the 
required attribute of the field itself after the form model has been 
instantiated.

Currently I am having to dynamically add a custom validator to each 
field which is determined to be required, I also dynamically set a 
field attribute that is processed by my forms styling XSL, so that the 
field is rendered as required on the front-end.

Can anyone tell me how I might be able to dynamically set the required 
attribute of the field directly?

I am considering the possibility of dynamically creating the form model 
or definition in java, but I am not sure whether this route is 
advisable - if anyone can point me to examples of this I would 
appreciate it!

Thanks,

Robin



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