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]
Parameter Description
status(optional) Action which will be taken on targeted validators.
  • Can be:
    • enabled - lists only enabled validators
    • disabled - lists only disabled validators

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