AnsweredAssumed Answered

Problem with control-param for field size (columns)

Question asked by devodl on Dec 2, 2011
Latest reply on Oct 5, 2012 by ltardioli
Using Alfresco 4.0.c,  Share,  3-column-edit-form.ftl to Edit properties

We need the field size (i.e. number of columns) to be smaller (14 columns) for some of the fields.
We modified the share-config-custom.xml as follows:


   <config evaluator="node-type" condition="ds:dsDSP">
      <forms>
         <form>
           <edit-form template="/3-column-edit-form.ftl" />
            <field-visibility>
               <show id="ds:CustomerName" force="true"/>
               <show id="ds:CustomerPhone" force="false"/>
               <show id="ds:CustomerEmail" force="false"/>
               <show id="ds:ProjectManagerName" force="true"/>
               <show id="ds:ProjectManagerPhone" force="false"/>
               <show id="ds:ProjectManagerEmail" force="false"/>
               <show id="ds:DeveloperName" force="true"/>
               <show id="ds:DeveloperPhone" force="false"/>
               <show id="ds:DeveloperEmail" force="false"/>
            </field-visibility>
            <appearance>
                <set id="" appearance="bordered-panel" label="Properties: DSP" />
                <set id="ds-dscontacts" appearance="fieldset" label="Contacts"/>
               <field id="ds:CustomerName" label="Customer Name" set="ds-dscontacts" />
               <field id="ds:CustomerPhone" label="Customer Phone" set="ds-dscontacts">
                 <control template="/org/alfresco/components/form/controls/textfield.ftl">
                   <control-param name="size">14</control-param>
                 </control>
               </field>
               <field id="ds:CustomerEmail" label="Customer Email" set="ds-dscontacts" >
                 <control template="/org/alfresco/components/form/controls/textfield.ftl">
                   <control-param name="size">14</control-param>
                 </control>
               </field>
               <field id="ds:ProjectManagerName" label="Project Manager Name" set="ds-dscontacts" />
               <field id="ds:ProjectManagerPhone" label="Project Manager Phone" set="ds-dscontacts" >
                 <control template="/org/alfresco/components/form/controls/textfield.ftl">
                   <control-param name="size">14</control-param>
                 </control>
               </field>
               <field id="ds:ProjectManagerEmail" label="Project Manager Email" set="ds-dscontacts">
                 <control template="/org/alfresco/components/form/controls/textfield.ftl">
                   <control-param name="size">14</control-param>
                 </control>
               </field>
               <field id="ds:DeveloperName" label="Developer Name" set="ds-dscontacts" />
               <field id="ds:DeveloperPhone" label="Developer Phone" set="ds-dscontacts" >
                 <control template="/org/alfresco/components/form/controls/textfield.ftl">
                   <control-param name="size">14</control-param>
                 </control>
               </field>
               <field id="ds:DeveloperEmail" label="Developer Email" set="ds-dscontacts" >
                 <control template="/org/alfresco/components/form/controls/textfield.ftl">
                   <control-param name="size">14</control-param>
                 </control>
               </field>
            </appearance>
         </form>
      </forms>
   </config>

but when Edit Properties is used it does not appear to affect the output. The fields remain full width.
The control-param is based on the docs: http://wiki.alfresco.com/wiki/Forms#textfield.ftl 
which contains the statements:
textfield.ftl

The textfield control renders a standard HTML text field.

The parameters this controls supports are listed and explained below. None of these are used in 'view' mode.

    styleClass (optional, string): Allows a custom CSS class to be applied to the text field
    style (optional, string): Allows CSS rules to applied directly to the text field
    maxLength (optional, int): Defines the maximum number of characters the user can enter, maps directly to the standard HTML 'maxlength' attribute
   size (optional, int): Defines the number of characters the text field can display, maps directly to the standard HTML 'size' attribute
    activateLinks (optional, boolean): When set to "true" and the form is in "view" mode the control will attempt to display links as active hyperlinks
    forceEditable (optional, boolean): Forces the control to be editable, default is false
but Edit Properties is not 'view' mode is it?

Is this configuration correct?
How can I change the display size of a field?

Thanks,
Steve

Outcomes