New features Please use http://kentico.uservoice.com as the primary place to submit your suggestions and allow others to vote for your ideas!
Version 6.x > New features > Document Type Field Dependency View modes: 
User avatar
Member
Member
Brant - 10/21/2011 5:00:13 PM
   
Document Type Field Dependency
In version 6, I see two new options when adding fields to a document type:

- Has depending fields
- Depends on another field

I assumed that this was a way to make the appearance of a field in the editing form conditional to whether another field is filled out, but I can't find any documentation on it, and can't figure out how to use it.

Any ideas?

User avatar
Member
Member
kentico_edwardh - 10/22/2011 12:30:26 PM
   
RE:Document Type Field Dependency
Hello Brant,

The Has depending fields:
Indicates that other parameters may be updated dynamically depending on the value of the given parameter.

The Depends on another field:
Indicates that the behavior (e.g. the available selection options) of the given parameter can be affected depending on the value of some other parameter.

These settings are prepared in the system for custom form controls:

http://devnet.kentico.com/docs/devguide/developing_form_controls.htm

In code of your custom form control you can access these settings and take appropriate action, for example access all fields on current form which are marked as dependent and change their values or so. Let me give you an example here. Let’s say that I have developed custom form control (similar to dropdownlist) and want to use this one for two field:

Field1
Field2

The requirement is simple: whenever value of the first one is changed, the second one should be reloaded according to selection of the first one. So, I will mark the Field1 with “Has depending fields” option and the second one Field2 with “Depends on another field” option. Keep in mind that both of the fields are using the same form control in my example. In code of the form control I can write custom code in such a way, that if the field is marked with “Has depending fields” option, I can loop through all of the other fields on the form, look for all fields where “Depends on another field” option is selected and reload them according my needs.

Best Regards,
Edward Hillard

User avatar
Member
Member
yasser - 3/19/2012 4:16:27 PM
   
RE:Document Type Field Dependency
This response isn't that helpful. The example shows nothing of what the op actually asked and the response "write custom code" is also of little use.
How exactly can you find out if a field is marked with "had depending fields", because it doesn't show this in the form control, I take it you'll need to also look at the doc type to get this information?
This feature looks like a good idea but the documentation is poor at best.
It reads like it would work like a cascading drop down out of the box but I'm sure this isn't the case

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 3/20/2012 7:15:10 AM
   
RE:Document Type Field Dependency
Hello,

My colleague correctly explains, that the check boxes aren't connecting the fields automatically, but are used only for marking purposes. You need to ensure the inner workings by yourself with your custom code. That describes the linked documentation, how to create a custom control. I would suggest you to go through the tutorial mentioned in the documentation. It basically describes how to create two dependent controls, which is what I think you want to accomplish.

Please also go through this video for more information about the form engine (code examples can be found from the 17th minute). For getting the mentioned properties you need to get the FieldInfo of the given editing control.

Best regards,
Boris Pocatko

User avatar
Member
Member
Phil. E. - 6/27/2012 9:07:55 AM
   
RE:Document Type Field Dependency
I have to agree with the previous guys. On the surface these boxes appear to be a godsend, an easy way to do something like determine which list to show in a dropdown from a previous selection. Nope, you need to program in .Net. Something you can't do if you are only an editor without access to MSVWD (or other) and the source. Reading about the wonderful things you could do with Kentico forms was one of the attractions.

Point:
Please make it clear in the documentation. (Saves false hopes in an editor)

I will probably just embed the complex forms I created with HTML and javascript as I don't need to database the replies, just email them. Moving from DNN to Kentico seemed a real step up but I keep bunping into " just change the code to do this" areas and it just dampens the enthusiasm.

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 6/29/2012 6:31:57 AM
   
RE:Document Type Field Dependency
Hello,

Thank you for the valuable feedback. I've submitted a defect and the documentation should be changed regarding this as soon as possible.

I understand, that some requirements aren't available out of the box and ready to use, however it's impossible to create a solution, which would fit everyone's needs. The strongest feat of Kentico is the flexibility. I don't think you will ever get an answer, that something isn't possible in Kentico. It might require a bit customization, but everything falls after that into place and the site with all the customizations, if performed per our guides in the documentation, is still upgradable without any issues. Additionally a lot of features are ready to use out of the box without any customization at all. It really depends about what features we are talking. Also, you can suggest improvements and feature on our user voice page.

Best regards,
Boris Pocatko

User avatar
Certified Developer 10
Certified Developer 10
josha-bpstudios - 10/28/2013 11:19:17 AM
   
RE:Document Type Field Dependency
If I understand correctly, macros can be used here to set these conditions. You may even be able to access the value of the form from this and compare the values, which could set the visible condition or whatever you wanted.