I am new to java and was trying to write a model for a schema. I want to understand how a schema is linked with the model.
For e.g. I have schema with below details:
- heading (Text Field) - Single value
- menuLink (Embedded schema) - Multi value
[The embeded schema used here is 'link' which contains fields for creating a external or Tridion link]
When I write a model based on schema field names , it is something like
private String headline; private List<Link> menuLink;
I also generate the getters and setters. I am able to display headline in my view, but not able to display any value from embedded fields i.e. menuLink
If I change this to:
private String headline; //Changed to menuLinks instead of menuLink private List<Link> menuLinks;
and generate getters and setters. This works fine with views.
The question here is why we need to use 'menuLinks' instead of 'menuLink' in the model even when the field name is menuLink? Is it because it is a multivalue field? How is this mapping done?
Also which datatype should be used for check-box while writing a model?
p.s. I do not have any guidelines for java MVC, so maybe I have missed something.