cancel
Showing results for 
Search instead for 
Did you mean: 

How to know which button you clicked

Former Member
0 Kudos

Hi everyone,

i am sending the results of an RFC into an output table. i created a couple of toolbar buttons. after either one of these buttons is clicked i want to call a form. How can i know which of the two buttons i clicked?

thanks,

Alejandro.

Accepted Solutions (1)

Accepted Solutions (1)

mh97
Contributor
0 Kudos

Alejandro,

I would try the following:

Create a data store with a field that will hold a value for which button was clicked. For this example let's call it whichButton.

Assign (for example) action Aclicked to ButtonA, Bclicked to Button B.

On the event Aclicked set the data store field whichButton to "A", on event Bclicked set the data store field whichButton to "B".

Now for the form field you want to hide when A was clicked, in Properties enter a condition formula for the Hidden setting, STORE@whichButton=='A', and similarly for any field you want to hide when Button B is clicked, you will set the Hidden condition to STORE@whichButton=='B'.

I hope that works for you. Please let us know.

Margaret

Edited by: Margaret Hilsbos on Apr 30, 2008 9:24 AM

Answers (6)

Answers (6)

Former Member
0 Kudos

Thank you Margaret & Nutan.

Former Member
0 Kudos

Hi Alejandro,

It's not possible to hide and seek the Uielements based upon the push button. Better you create two forms with different layouts. And link them with the different actions of the buttons.

Such as:

Button1--action name-form1

Button2-action name-form2

This can be achieved by configuring the property of the buttons as you have previously done.

This will be helpful rather than trying for hiding and seeking the UIelements. Here you are unable to write the codes based on the actions or event raised like in webdynpro java or other.

Regards,

Nutan

Former Member
0 Kudos

OK so now that either of the buttons have called one form, and i want a certain field of this called form to be visible or not depending on which button was clicked. how can i know this?

thanks,

Alejandro.

Former Member
0 Kudos

Hi,

It is not possibe to hide a field depending upon the push button action.

Regards,

Govindu

Former Member
0 Kudos

Govindu,

both buttons will call the same form, but this form will behaive differently depending on which button was pushed.

thanks,

Alejandro.

Former Member
0 Kudos

Hi

then you can differentiate the actions of the buttons easily by Form right.

otherwise use different labels for the buttons.

Regards,

Govindu

Former Member
0 Kudos

thank you Ahmed,

if i create custom actions with different names for each one of the buttons, and both buttons should call the same form, and i want diferent UI elements on this form to behaive depending on what button was clicked, how can i know which button was clicked? i have tried using "formula" and i find conditional statments and input fields from different objects in the model...but no event names. can you please clarify on how to do this that you tell me?

thanks,

Alejandro.

Former Member
0 Kudos

Hi,

you need to call the Form with either of the Toolbar Buttons means These button sgould have same actions Right?.

So clicking on the Button is manuall means you know where you are clicking,

If you want different actions on clicking the buttons then assaign the corresponding action to the Toolbar Button having different labels.

if still u are facing problem just come bcak to me.

Regards,

Govindu

Former Member
0 Kudos

Alejandro,

You will have different event names placed on each button and then you control the flow based on the action name triggered.

Regards,

Ahmed Salah