Hide actions depending on data content

2013-09-19
2013-09-23
  • Dirk Coetsee
    Dirk Coetsee
    2013-09-19

    Hi,
    I need to set actions depending on the value of a data column.
    For instance if the status of the row is approved, the delete action should not be shown for that row. (In detail and list view)
    If the status is something else the delete action should be visible and active.

    your help will be welcomed.

    thanks
    Dirk

     
  • Javier Paniza
    Javier Paniza
    2013-09-23

    Hi Dirk,

    one way is to define an @OnChange action for that property and to use add/removeActions from that actions. You'll need to define your module in this way:

    <module name="YourModule">
        <env-var name="XAVA_SEARCH_ACTION"              value="CRUD.searchExecutingOnChange"/>
        <model name="YourEntity"/>
        <controller name="Typical"/>
    </module>
    

    Help others in this forum as I help you.
    Need more help? Get OpenXava professional support.

     
    Last edit: Javier Paniza 2013-09-23