PhenixID

PSD1150 – Mandatory filter

Summary

This PhenixID Solution Document (PSD) is written for PhenixID Identity Manager (IM) 5.4.1 or later.

Use case: You have a create or an edit form and like some controls to be mandatory. This is already a feature in IM but that feature does not let you customise the dialog box for the user. Also if the default dialog box will state the attribute which some times does not correspond with the description text.
With this filter you can create your own message text and map it to a control. You can have different message text for different controls in a form.

Download filter

Click the following link PSD1150 to download the filter.

Add filter to IM Configurator

Add MandatoryControlFilter.class to the following file path:
\..\PhenixID\IMConfigurator\ext\class\psd
You must restart IM Configurator for the filter to be active

Add filter to IM WEB

Add MandatoryControlFilter.class to the following file path:
\..\PhenixID\IM\customer\extension\class\psd
You must restart IM WEB for the filter to be active

Configure filter for a CREATE form

There are some difference when configure the mandatory filter for a create form or an edit form. This section describes when configure the filter for a CREATE form.

  1. Open IM Configurator
  2. Open the Create form you like to add the filter to.
  3. Open Control Properties in the form for the control that you like to associate the filter with.
    Note. Make sure you do NOT have the original Mandatory checkbox checked!
  4. Click External Filter
  5. Click no filter assigned under PreSave
  6. In Java class type: psd.MandatoryControlFilter
  7. In Method type: checkAttribute
  8. Under parameters, click String
  9. In the String dialog box, add your message.
  10. Note! For some controls you also have to add the touched filter to get the MandatoryControlFilter to work properly.
    How to add the touched filterClick no filter assigned under Init
    1. In Java class type: filter.Nordicedge
      In Method type: touch
  11. If your have more controls just repeat 1-10.
  12. Save the form and test you your form

Configure filter for an EDIT form

There are some difference when configure the mandatory filter for a create form or an edit form. This section describes when configure the filter for an EDIT form.

For an Edit form you need to add two filters. On any control where you add the MandatoryControlFilter you also need to add the INIT filter, touch. IM will on an EDIT form only operate on controls that are touched.

  1. Open IM Configurator
  2. Open the Edit form you like to add the filter to.
  3. Open Control Properties in the form for the control that you like to associate the filter with.
    Note. Make sure you do NOT have the original Mandatory checkbox checked!
  4. Click External Filter
  5. How to add the psd.MandatoryControlFilter filter
    1. Click no filter assigned under PreSave
    2. In Java class type: psd.MandatoryControlFilter
    3. In Method type: checkAttribute
    4. Under parameters, click String
    5. In the String dialog box, add your message.
  6. Note! For some controls you also have to add the touched filter to get the MandatoryControlFilter to work properly.
    How to add the touched filter
    1. Click no filter assigned under Init
      In Java class type: filter.Nordicedge
      In Method type: touch
  7. If your have more controls just repeat 1-6.
  8. Save the form and test you your form

Test filter in IM Web

Login and test the form. Leave out to add a value in your control and click Apply or Create depending or form type.

MISC

Create forms and default text

In create form, IM will add a default text before your custom text stating Could not create object!
If you like that text to be something else or removed you can solve this with the lang-file.
Open en.lang and add Could not create object!=Something else or just a space to remove the text.

Format of custom text

You can add HTML styling to your text. For example:
< b >Manager< /b > is mandatory and has no value.


DISCLAIMER
Information provided in this document is for your information only. PhenixID makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.

The origin of this information may be internal or external to PhenixID. PhenixID makes all reasonable efforts to verify this information.

PhenixID - support.phenixid.se