You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Vikas Mayur <vi...@gmail.com> on 2007/06/11 15:38:56 UTC

Form widgets concepts

1)   In the ftl (FindFacilityGroup.ftl ) the code is
>> <#list facilityGroups as facilityGroup>
>>         <#if facilityGroup.facilityGroupId?exists &&
facilityGroup.facilityGroupId != "_NA_">
>>             <#assign facilityGroupType = facilityGroup.getRelatedOne
("FacilityGroupType")?if_exists>

Using the above code i have done in screen widgets like this
The list "facilityGroups" is fetched using <entity-and>
            <widgets>
                <iterate-section list-name="facilityGroups"
entry-name="facilityGroup">
                    <section>
                        <condition>
                            <and>
                                <not> <if-empty field-name="
facilityGroup.facilityGroupId"/> </not>
                                <if-compare field-name="
facilityGroup.facilityGroupId" operator="equals" value="_NA_"/>
                            </and>
                         </condition>
                         <actions>
                             <get-related-one value-name="facilityGroup"
relation-name="FacilityGroupType" to-value-name="facilityGroupType"/>
                             <set field="
parameters.facilityGroupType.description" value="
facilityGroupType.description"/>
                         </actions>
                         <widgets>
                             <decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
                                 <decorator-section name="body">
                                     <container><label style="head2">${
uiLabelMap.ProductFacilityGroupList}</label></container>
                                     <link target="EditFacilityGroup"
text="${uiLabelMap.ProductNewGroup}" style="buttontext"></link>
                                     <include-form name="FindFacilityGroup"
location="component://product/webapp/facility/group/FacilityGroupForms.xml"/>
                                 </decorator-section>
                             </decorator-screen>
                         </widgets>
                    </section>
                </iterate-section>

Is i'm right with the use of <iterate -section>

2) I need to display two fields in the form and the name of both of the
fields as "description" . Default map in the form is
<default-map-name="facilityGroup">, which is taken from the
    above screen.
  >>      <field name="description" title="${
uiLabelMap.ProductFacilityGroupType}" entity-name="FacilityGroupType">
<display-entity entity-name="facilityGroupType"/></field>
  >>      <field name="description" title="${uiLabelMap.ProductDescription
}"></field>

Any pointers will be of great help.

Thanx,
-- 
Vikas Mayur