Use association.ftl in customization (not selectable)

cancel
Showing results for 
Search instead for 
Did you mean: 
alstresh
Member II

Use association.ftl in customization (not selectable)

I just wont point repository file (like browse file in windows). For this porpues I have used association.ftl 

in Share my_module.xml

<form>
    <field-visibility>
        <show id="selectedFile"/>
    </field-visibility>
    <appearance>
        <field id="selectedFile" label-id="Select Template">
            <control template="/org/alfresco/components/form/controls/association.ftl">
                <control-param name="startLocation">{parent}</control-param>
                <control-param name="compactMode">true</control-param>
                <control-param name="showTargetLink">true</control-param>
                <control-param name="forceEditable">true</control-param>
            </control>
        </field>
    </appearance>
</form>

In Alfresco 

.... extends ActionExecuterAbstractBase {
@Override
protected void addParameterDefinitions(List<ParameterDefinition> list) {
    list.add(new ParameterDefinitionImpl("selectedFile", DataTypeDefinition.ANY, false, getParamDisplayLabel(selectedFile)));
}


But for some reason I can browse File and Folders but cannt select one.
I wont get nodeRef of jast String with ID for selected object in my alfesco costomization backend.
Who knowe what is wrong? Why selection in association.tfl do not work? 

Thanks!

1 Reply
afaust
Master

Re: Use association.ftl in customization (not selectable)

Your parameter definition appears to be incorrect - you want a NodeRef, not just ANY so use the corresponding DataTypeDefinition. The form fields are very sensitive to the data types and may not work correctly if used in combination with the wrong ones.