Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    OperationBinding.requires and return message

    Using smartGWT 5.0 power.

    Can I change the return message when a Datasource.OperationBinding.requires fail?

    For example:

    <DataSource ID="somedatasource" serverType="sql" dataSourceVersion="1">
    <operationBinding operationType="remove" requires="false">
    </operationBinding>
    </DataSource>

    The return message is:

    {
    affectedRows:0,
    data:"DataSource 'somedatasource', operationType 'remove', operationId 'somedatasource_remove'. Failed the "requires" check.",
    invalidateCache:false,
    isDSResponse:true,
    queueStatus:-1,
    status:-1
    }


    #2
    Generally, your UI should be constructed so that the user never has an opportunity to try executing an operation they aren't allowed access to. For example, if the current user is not actually allowed to edit records in a given grid, then the edit functionality should be disabled rather than being enabled but always failing.

    If for some unusual case this is really hard to do, take a look at the Error Handling overview for how you can modify what error messages are shown to the user.

    Comment

    Working...
    X