How can I pass additional event parameters in CUI elements?

Hi community,

does anybody know, if it´s possible to pass additional event parameters in CUI elements?

Example:
I have three CUI menu buttons that do a more or less comparable job. The corresponding Methods just differ in a few lines of code. So I would prefer to use just one unified Method for the three CUI elements. But right now I cannot determine, which of the three buttons acutally triggers the Method.

Is it somehow possible to add event parameters to the button item itself? Can I perhaps use the additional data field somehow for this purpose? Or is there a Method that shows me the orignator of the Method call?

As alternative, it would also be ok to use standard Actions for this job. But as far as I know, I cannot pass even information in Item Actions. Just ItemType Actions allow us to use the "Body" property.

Thanks for any help!

Angela

  • Hi Angela,

    You might be able to get the name of the button being called by using inArgs.control.GetId();. Based on the result of that function, you can use a switch statement or some conditional logic to run your location-specific code. Note that I tested this in 11.0 SP15, and you'll need to do some verification to confirm that the control name is accessible through this object in every location.

    If this function is not accessible in all CUI locations, could you let me know what version of Innovator you are using, so I can try to find a common lookup in that version? 

    Chris

    Christopher Gillis

    Aras Labs Software Engineer

  • Hi Chris,

    I can confirm that inArgs.control.GetId(); works both for SP11 and SP15. In my case passing the name of the calling CUI element is a perfect solution for solving the task.

    Thanks for investigating this topic!
    Angela