determine sender (widget) on click

determine sender (widget) on click

  
LS

I want to create 4 buttons that in the onclick destination all point to the same action. In that action I want to use a Switch element followed by some other elements. The switch conditions must catch which button is clicked. Can this be done and if so, how (or is there another way)?

Regards, Harry 
Hi Harry,

Yes, you just right click on the screen action and Add Input Parameter and then in each button you send a different value.
Let me know if this answers your question.

Cheers,
Tiago Simões
Hi Tiago,

Thanks! Worked fine. As a newbie (been experimenting one week now with AgilePlatform) I'm amazed about the possibilities already 'on board') What I am using this for is that I want to create a dual listbox with the four buttons to move records from one listbox to the other (move all to right listbox, move selected to right listbox -and vice versa). I am encountering two diffuculties now:

1) I thought that when I choose a (boolean type) record for the listbox selection attribute, I could us an if element in the action with a condition like: ListLeft.Current.Structure1.Attribute2=True - It does not work however. When I select a record in the left list and iterate(for each)the selected records doesn't move to the rightbox
2)After moving (for all records from left to right-this is working now) I want to remove the records from the leftbox. It gives an error (runtime) that a remove action cannot be executed in a for each loop.

Based on two recordlists with the same structure with two attributes(text -char, selected -boolean)

Any thoughts how to tackle this?

Regards, Harry
Hi Harry,

Do you care to attach a file with a sample of what you are trying to do?

Cheers,
Tiago Simões
Tiago,

No, not at all. I zipped the oml for you and attached it. The link Dual List in the mainform goes to the the dual list screen.

Regards, Harry
Hi Harry,

Check the attached solution (making right-to-left also work should not be very hard).
The trick is to iterate the lists attached to the widgets.
Also bear in mind that I've changed Preparation to only fill in the lists if the page is being loaded for the first time (to prevent the code from running again after a submit).

Was this what you were looking for?

Cheers,
Tiago Simões
Hi Tiago,

Yes that was what I was looking for! Works fine. Thank you very much for your help.

Kind regards, Harry