Category Archive for "AEM 6.2"

AEM TouchUI dropdown mandatory validation

02.06.2017
Christoph Thommen

In AEM 6.2, there is no mandatory validation for dropdowns in dialogs, when having a “Please select” option in place. This is due to a validation check in the out of the box AEM validator which does a check for “value != null”, which is not the case when having a “Please select” option (value would just be a blank String).

There is currently no other option then implementing a custom validation. This requires the following steps:

  1. Create a new clientlib with the following configuration
  2. Add the following JavaScript to this clientlib. This JS validates all select fields with a specific property set (see step 3)
  3. To mark select fields as required (and enable this validation), put the property validation=”select.required” on it:
     

AEM 6.2 Image Upload Dialogs

15.01.2017
Ben Zahler

When migrating to AEM 6.2 (we’re using SP1), the dialog for uploading images (or any other file) may not work with your existing configuration.

Affected are dialog items with sling:resourceType=”granite/ui/components/foundation/form/fileupload”.

The fix is very easy: Simply add this property to the configuration node:

In the documentation Adobe describes field uploadUrl as “The URL where to upload the file, you can use ${suffix.path} to use the current suffix”. It seems that value ${suffix.path} is what you need to put to get the default behavior.

However, there is another catch: in our tests, setting the image/file upload to mandatory breaks the functionality.
To make it work, remove the following property if present:

Hopefully, Adobe will fix this soon…

here is a full configuration of the upload item that works for us: