I’m designing dynamic forms for grails and I was wondering if it was at possible to set the widget constraint dynamically?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Setting the widget constraint is not the way to attack this. I suppose the simplest method would be to choose the tag you’d like to display based upon some condition using an “if” tag in your view or template. For instance:
Say you have a Book
If you use Grails generate-view for this class, Grails will produce a template called _form that looks like the following:
You can test your condition in this form and change the view:
Now the view will display a textField or textArea field based upon $yourCondition.