From wiki.ginstr.com
Jump to: navigation, search

gn:act_listValidators

Description
Action when executed will list validators on screen based on action configuration.
If no valid targets are found on screen action will return empty. If status is not defined action will return all, enabled and disabled validators.
Action returns
void

Action signatures

[gn:act_listValidators]|[status;targets{n}]
Parameter Description
status(optional) Action to perform. If omitted action will list both enabled and disabled validators.
  • Can be:
    • enabled - lists only enabled validators
    • disabled - lists only disabled validators
targets{n} (optional) target target or targets to which action will be applied. If target is not defined it will target all screen widgets that have validators. If widget has no validation definitions defined it will be ignored.
  • Valid target:
    • any widget that has validator in xml defined

Example

initial state

validators on widgets "@+id/bebraObjekte_ObjektNummer" and "@+id/bebraObjekte_ObjektVerwalter" will be loaded on screen load.

screen.xml
<FrameLayout
    android:id="@+id/exampleFrame"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:visibility="gone"
    gn:act_set="[gn:act_validators]|[disable;;@+id/bebraObjekte_ObjektNummer,@+id/bebraObjekte_ObjektVerwalter],[gn:act_listValidators]|[disabled]," />

<com.ginstr.widgets.GnEditText
    android:id="@+id/bebraObjekte_ObjektNummer"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    gn:act_validate="[name:RequiredValidator],[message=@string/addObject_numberRequiredValidatorMessage]"/>

<com.ginstr.widgets.GnEditText
    android:id="@+id/bebraObjekte_ObjektVerwalter"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    gn:act_validate="[name:RequiredValidator],[message=@string/addObject_managerRequiredValidatorMessage]"/>		
after action execution

Once FrameLayout "@+id/exampleFrame" "gn:act_set" is exectued action gn:act_listValidators will list "@+id/bebraObjekte_ObjektNummer" and "@+id/bebraObjekte_ObjektVerwalter" RequiredValidators which are disabled