This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

AskDelete

Frequently asked questions about VisionX.

AskDelete

Postby lucdep » Fri Nov 30, 2018 12:22 pm

Hello,

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

Is there a work around?

Luc
lucdep
 
Posts: 53
Joined: Wed Oct 10, 2018 12:01 pm

Re: AskDelete

Postby rzenz » Fri Nov 30, 2018 12:56 pm

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.
User avatar
rzenz
 
Posts: 36
Joined: Mon Dec 12, 2016 1:40 pm
Location: Vienna, Austria

Re: AskDelete

Postby Support@SIB » Fri Nov 30, 2018 1:17 pm

The action documentation is available here.
User avatar
Support@SIB
 
Posts: 353
Joined: Mon Sep 28, 2009 1:56 pm

Re: AskDelete

Postby lucdep » Fri Nov 30, 2018 1:28 pm

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();
   }
lucdep
 
Posts: 53
Joined: Wed Oct 10, 2018 12:01 pm

Re: AskDelete

Postby rzenz » Fri Nov 30, 2018 1:35 pm

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.
User avatar
rzenz
 
Posts: 36
Joined: Mon Dec 12, 2016 1:40 pm
Location: Vienna, Austria

Re: AskDelete

Postby lucdep » Fri Nov 30, 2018 2:38 pm

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.
lucdep
 
Posts: 53
Joined: Wed Oct 10, 2018 12:01 pm


Return to VisionX