AnsweredAssumed Answered

How to access form fields value in a control component ?

Question asked by stondini on Apr 4, 2014
Latest reply on Apr 14, 2014 by aaditvmajmudar

I have a form with many fields and a custom javascript object-finder for an association (this object is a subclass of Alfresco.ObjectFinder).

Here the share-config-custom.xml :.
   <field id=“xyz:textField" mandatory=“true" />
   <field id=“xyz:assocField" mandatory="true">
      <control template=“/xyz/components/form/controls/searchPicker.ftl">
         <control-param name="showTargetLink">true</control-param>
         <control-param name="name="linkedField""> xyz:textField </control-param>

The user fills the first field in and when it clicks on the button “select” of the association field,
a custom selection box appears and I’d like to use the value of the first field in it.

In fact, I’d like to have access to the entier form fields in my custom control.
I tried to use something like this :
var form = new Alfresco.forms.Form(this.objectFinder.formHtmlId);
var fields = form.getDataFields();
But the current association value is not present (other fields are present).

Everything is on the client side, no server access because the form fields are not save when user fills them in.

Do you have some advices or examples ?

Thank you.