--- On Sun, 11/22/09, Harmeet Bedi <
[hidden email]> wrote:
> There was one other thing that i was not sure about..
> From Model POV. ModelFormField has one FieldInfo. Each of
> the field types e.g. Text, Image, Hidden etc. are subclasses
> of FieldInfo. Wondering why it is that way. Would it have
> been better to have Text, Image, Hidden etc. as subclass of
> ModelFormField in Java and
>
> Similarily something like this from EmployeeForms.xml
> <form name="AddEmployeeSkills"
> type="single" target="createEmployeeSkill"
> default-map-name="partySkill">
> <field
> name="partyId"><hidden/></field>
> <field name="skillTypeId"
> tooltip="${uiLabelMap.CommonRequired}"
> widget-style="required">
>
> <drop-down>
>
> <entity-options description="${description}"
> entity-name="SkillType">
>
> <entity-order-by
> field-name="description"/>
>
> </entity-options>
>
> </drop-down>
> </field>
> <field
> name="yearsExperience"><text/></field>
> <field
> name="rating"><text/></field>
> <field
> name="skillLevel"><text/></field>
> <field name="submitButton"
> title="${uiLabelMap.CommonCreate}"
> widget-style="smallSubmit"><submit
> button-type="button"/></field>
> </form>
>
> May be expressed as
> <form name="AddEmployeeSkills"
> type="single" target="createEmployeeSkill"
> default-map-name="partySkill">
> <hidden-field
> name="partyId"></field>
> <drop-down-field
> name="skillTypeId" tooltip="${uiLabelMap.CommonRequired}"
> widget-style="required">
>
> <entity-options description="${description}"
> entity-name="SkillType">
>
> <entity-order-by
> field-name="description"/>
>
> </entity-options>
> </drop-down-field>
> <text-field
> name="yearsExperience"/>
> <text-field
> name="rating"/>
> <text-field
> name="skillLevel"/>
> <submit-field
> name="submitButton" title="${uiLabelMap.CommonCreate}"
> widget-style="smallSubmit" submit button-type="button"/>
> </form>
>
> It appears that given the one to one nature of
> ModelFormField and FieldInfo, it really is one object and
> FormFields are really specific types of fields. Inheritance
> in XSD can model this efficiently with Standard set of
> attributes in base class e.g. name, widget-style etc.
Or you could have something like:
<form name="AddEmployeeSkills" type="single" target="createEmployeeSkill" default-map-name="partySkill">
<fields>
<hidden-field name="partyId"></field>
...
<text-field name="yearsExperience"/>
<submit-field name="submitButton" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit" submit button-type="button"/>
</fields>
</form>