How to switch Input text field to people-finder control

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

How to switch Input text field to people-finder control

There are component   that allow send repository document by email. 

It contains configuration with UI form desciption

<config evaluator="string-compare" condition="emailDocumentsAction"> 
    <forms>
        <form>
            <field-visibility>
                <show id="to"/>
                <show id="bcc"/>
                <show id="from"/>
                <show id="subject"/>
                <show id="body"/>
                <show id="convert"/>
            </field-visibility>
            <appearance>
                <field id="to" label-id="jb_to"/>
                <field id="bcc" label-id="jb_bcc" mandatory="false"/>
                <field id="from" label-id="jb_from"/>
                <field id="subject" label-id="jb_subject"/>
                <field id="body" label-id="jb_body">
                    <control
                            template="/org/alfresco/components/form/controls/textarea.ftl"/>
                </field>
                <field id="convert" label-id="jb_convert">
                    <control
                            template="/org/alfresco/components/form/controls/checkbox.ftl"/>
                </field>
            </appearance>
        </form>
    </forms>
</config>

So on  "To" and "Bcc" is just text input field. But I need for "people-finder" component due to use only existing user email  (like new rule for folder with "Send message" template).

I have found  /org/alfresco/components/people-finder/people-finder.get.html.ftl

That allow find user by input text but have no idea how to change  <field id="to" label-id="jb_to"/>  to people-finder.get.html.ftl  with filling "To" and "Bcc" from User email.

Have any idea how to implement it?

thnks

4 Replies
afaust
Master

Re: How to switch Input text field to people-finder control

The people-finder.get.html.ftl is not a component that you can use inside a form. You should set the control template for those fields to the /org/alfresco/components/form/controls/authority.ftl to get an authority picker that is very close to a people finder. Unfortunately that control is not really compatible with a simple text field - it is intended to be used for an association field.

alstresh
Member II

Re: How to switch Input text field to people-finder control

Thanks for response it is usefull. But authority.ftl allow select only one user for some reason. Is it possible config authority.ftl to select several user?

afaust
Master

Re: How to switch Input text field to people-finder control

authority.ftl allows to select multiple users as well - the action field must be defined as allowing multiple values to enable this.

alstresh
Member II

Re: How to switch Input text field to people-finder control

Could you please point where I can finde "action field"  ?

My config:

field-visibility>
    <show id="to"/>
</field-visibility>
<appearance>
    <field id="to" label-id="jb_to" action="">
        <control template="/org/alfresco/components/form/controls/authority.ftl" >
            <control-param name="startLocation"></control-param>
            <control-param name="authorityType">ALL</control-param>
            <control-param name="deepSearch">true</control-param>
        </control>
    </field>
</appearance>

Thannks