Page 1 of 1

AskDelete

PostPosted: Fri Nov 30, 2018 12:22 pm
by lucdep
Hello,

I want to use the AskDelete action, but the action does nothing: no dialog and no delete.

Is there a work around?

Luc

Re: AskDelete

PostPosted: Fri Nov 30, 2018 12:56 pm
by rzenz
Are you talking about the "Ask before delete" action available in the action editor? If yes, you need to set this on the databook once at the load of the workscreen. This is not a "ask user if they want to delete this row" action, it is a mechanism which enables a dialog on this databook whenever the user tries to delete a row.

Re: AskDelete

PostPosted: Fri Nov 30, 2018 1:17 pm
by Support@SIB
The action documentation is available here.

Re: AskDelete

PostPosted: Fri Nov 30, 2018 1:28 pm
by lucdep
Hello,

Code: Select all
public void doMenuitemcopyversionversion(UIActionEvent pEvent) throws Throwable
   {
      ProjXUtil.addAskDeleteDialog(rdbPd);
   }

Which setting on the DataBook must be set to use this?

I had figured out this work around
Code: Select all
public void doMenuitemdeleteversion(UIActionEvent pEvent) throws Throwable
   {
      showQuestion(this, Text.val(new Var(rdbPdvers, "PDVECODE")) + " verwijderen?", "deleteRowPDVers");
   }

   public void deleteRowPDVers(UIActionEvent pEvent) throws Throwable
   {
      rdbPdvers.delete();
   }

Re: AskDelete

PostPosted: Fri Nov 30, 2018 1:35 pm
by rzenz
As said, "addAskDeleteDialog" does what it says on the tin, it adds a dialog which is then displayed when the user wants to delete a row. It does not delete a row on its own.

What you want to do is put the "Ask delete" action in the onLoad-Event of the WorkScreen and just delete the row in the menu item action.

Re: AskDelete

PostPosted: Fri Nov 30, 2018 2:38 pm
by lucdep
OK, got it right now.

It was not clear to my from the doc this action could only be called from the screen's OnLoad event.

Thanks.