cancel
Showing results for 
Search instead for 
Did you mean: 

CAP: Unbound Action with implicit parameter and confirmation dialog.

gwerner
Participant
0 Kudos

Hello,

I have defined a unbound action

action stop()<br>

I used the annotation to show a confimation dialog.

 annotate Sevice.stop with @(
  Common.IsActionCritical : true
);

How ist it possible to read data from the entity?
This brings me a undifined for the field id!

  this.on('stop', ({data:{id}}) => {
    console.log('stop fired: ' + id );
  })


If I defined a action with parameter

action stop(id: entity1:id))<br>

I get now a popup with a input field, which I don't want.

If I try to bound the action, I always get a popup with a dropdown or a input field

actions{
        
        @(
                cds.odata.bindingparameter.name : '_it',
            )
            action stop (

.....

The real question is:
How can I implement a action that opens only a confirmation dialog without a input field, but I can read any parameter of the entity in the implementation?

Accepted Solutions (1)

Accepted Solutions (1)

gwerner
Participant
0 Kudos

It is solved! See above

0 Kudos

Hi @gwerner,

Can you please share your solution? I also need to hide this dialog.

Thank you!

Answers (1)

Answers (1)

TiagoAlmeida
Participant
0 Kudos

Hello,

If your action relates to a specific entity it should be bound. Also, does your entity have an uuid key?

gwerner
Participant
0 Kudos

Hi Tiago,

thank you for your fast answer!
That is right if I implement a bound action like that.

 entity E1 as select from my.E1 {
...
} actions{
    action stop()
   };
But than I got no confirmation dialog. Which will get the first on click on the button.

Ok this implementation is working!

..
} actions{
    @Common.IsActionCritical
     action stop()
    };
regards
Gunter