Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Identify the Button Pressed in Exec Store of Handler
icon3.gif  Identify the Button Pressed in Exec Store of Handler [message #1231808] Wed, 15 January 2014 13:03 Go to next message
marco giudici is currently offline marco giudiciFriend
Messages: 204
Registered: February 2013
Location: Italy
Senior Member
Hi all,
I have the necessity to identify which button is pressed when is executed the method "Exec Store" in Handler of my form, because in the "Exec Click Action" of each button I set a global property that I need to retrieve.

I see that the "Exec Store" method is executed before the "Exec Click Action" method.

How I can solve this problem?

Thanks in advance for any help
Re: Identify the Button Pressed in Exec Store of Handler [message #1231833 is a reply to message #1231808] Wed, 15 January 2014 14:15 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
I assume this is because all your buttons extend AbstractSaveButton.

You can use the property getConfiguredSystemType to identify your button, but the possible values are limited (see IButton.SYSTEM_TYPE_*) .


You can also define buttons that extends AbstractButton and implement the execClickAction like this:

  protected void execClickAction() throws ProcessingException {
    //Do something specific:
    //...
      
    //Save the form:
    doOk();
  }


If you have a look at the AbstractForm#handleSystemButtonEventInternal(ButtonEvent), you will see that the result will be the same.

.
Re: Identify the Button Pressed in Exec Store of Handler [message #1231845 is a reply to message #1231833] Wed, 15 January 2014 14:44 Go to previous messageGo to next message
marco giudici is currently offline marco giudiciFriend
Messages: 204
Registered: February 2013
Location: Italy
Senior Member
Hi Jeremie,
I have 5 buttons (3 AbstractButton, 1 AbstractCancel and 1 AbstractOkButton) on my form, for each one I have implemented execClickAction which imposed the value of the global variable.
I set for 2 of these buttons the property SystemType equals None and for the other equals to SystemType.Ok, SystemType.Cancel and SystemType.Cancel

I have a common logic that is execute for these three type of buttons (SystemType.Ok, SystemType.Cancel and SystemType.Cancel) and it's executed in the Handler with the method "ExecStore":

    @Override
    public void execStore() throws ProcessingException {
      IOrderDetailsProcessService service = SERVICES.getService(IOrderDetailsProcessService.class);
      OrderDetailsFormData formData = new OrderDetailsFormData();
      exportFormData(formData);
      formData = service.create(formData);

      //My Logic
      ......
    }


In this point, I have the necessity to identify which of these buttons are pressed.
Is this possible or not? If yes, how? Otherwise I need to identify another way to do this.

I hope to give you all information to evaluate my request.

Thanks in advance for your help and suggestion
Re: Identify the Button Pressed in Exec Store of Handler [message #1231857 is a reply to message #1231845] Wed, 15 January 2014 15:15 Go to previous message
marco giudici is currently offline marco giudiciFriend
Messages: 204
Registered: February 2013
Location: Italy
Senior Member
Ok, I have found the solution that was before my eyes
Previous Topic:Almost every time "No Application ID"
Next Topic:Looking for book for Scout
Goto Forum:
  


Current Time: Fri Apr 26 21:57:15 GMT 2024

Powered by FUDForum. Page generated in 0.03408 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top