title: How to conditionality disable a field in EasyAdmin 4 and Symfony 5.4
body: <p>I am using Symfony 5.4 and EasyAdmin 4.
  I have an entity Suscription with a status property.
  In the edit form of the corresponding CRUD controller, I want to enable/disable some fields depending on status value. If status is validated I want to disable some fields. If status is not validated I want those fields to be enabled.</p>
  <p>In the CRUD controller I have the following :</p>
  <pre class="lang-php prettyprint-override"><code>public function configureFields(string $pageName): iterable
  {
      return [        
          ...
          TextField::new('comments')-&gt;setDisabled(true),
          ...
      ];
  
  }
  
  </code></pre>
  <p>I tried adding an eventlistener like this, it's working but the field is moved to the end of the form:</p>
  <pre class="lang-php prettyprint-override"><code>public function createEditFormBuilder(EntityDto $entityDto, KeyValueStore $formOptions, AdminContext $context): FormBuilderInterface
  {
      $builder = $this-&gt;container-&gt;get(FormFactory::class)-&gt;createEditFormBuilder($entityDto, $formOptions, $context);
      $builder-&gt;addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
          $entity = $event-&gt;getData();
          $form = $event-&gt;getForm();
          if($entity-&gt;getStatus() != 'validated') {
              $form-&gt;add('comments', TextType::class);
          }
      });
      return $builder;
  }
  </code></pre>
  <p>How can I do to conditionally enable/disable the field without moving it to the end of the form when rendering it ?</p>
  <p>Thanks in advance !</p>