limit text field size and limit child table entries based on the drop down values

I have couple of requirements in my Project…

Content type A has
a drop down single field called as style and values associated with it are “optionA” and “optionB”.
a text field with max limit
a child table with few fields in it.

Now my requirement is…
If i select “optionA” in the style field there shouldn’t be any limit for the entries in the child table. But, If i select “optionB” only 3 entries should be allowed to enter for the user.
My next requirement is…
If i select “optionA” in the style field the limit of the text field should be set to some value(like 140).

Can we acheive this functionality in any way?

Please advice.

What you describe is something that Percussion is not really designed to do, per se. The entry screen for the CMS, for most intents and purposes, just “works how it works” if you will. Those screens are generated using XSLT, based on the content type definition. So, if you want to affect front-end changes, you must edit the XSLT, which is not recommended by Percussion since it may get overwritten during system upgrades or patches.

You can write validation rules, which can use JEXL or even custom extensions (in Java) to do all sorts of things, maybe even some of what you want, but changing the text limit of a field on-the-fly I believe is going to be especially problematic, I think.

Thanks for your response. So, you are saying that the child table entries can be restricted based the validation rules. Any idea how can i acheive it?


I have never tried doing this exact thing myself, but you might be able to restrict it in a roundabout way. I’m not sure how familiar you are with the Percussion validation engine. If you’re not very familiar, the first thing to do is to read up on it and understand how it works overall.

Validation works on the field level. So, for every field in a content type (include child table fields), there is a “Validation” button in Workbench that takes you to an interface where you build the validation rules. It is easy to do simple validations that work on the data in the field being validated. However, there is a Validation Type you will called “Conditional” that let’s you write fairly complex rules where you can use existing content item data, user session information and all sorts of other things - this may be the way to do what you want to do, but you have to take to understand and experiment with the different options at your disposal.

Finally, there is a option Validation Type called Extension. Where you bring in your own custom validation which you have written (in Java) and installed on the server. This is an advanced topic and of course requires that one be a Java programmer.