# Error with custom method call from context menu

**URL:** <https://forum.inductiveautomation.com/t/error-with-custom-method-call-from-context-menu/72908>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [April 26, 2023, 9:12am UTC](https://forum.inductiveautomation.com/t/error-with-custom-method-call-from-context-menu/72908 "2023-04-26T09:12:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthias\_Wuest](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Matthias\_Wuest](https://forum.inductiveautomation.com/u/Matthias_Wuest)\
**Post date:** [April 26, 2023, 9:12am UTC](https://forum.inductiveautomation.com/t/error-with-custom-method-call-from-context-menu/72908/1 "2023-04-26T09:12:07Z")

</div>

I have a button component to perform different actions using the context menu, but have encountered a problem with calling custom methods on the same component. Editor version is 8.1.25 (b2023021409)

To open the menu on the button, I use the following option:  
 ![requestMenu](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/4/24233fc1e94a3f6b8f9c8bee6fde016c24a38ce8.png)

Then I want to call "customMethod" without any parameters from one of the context menu options (also on the button). I also tried with "self.customMethod" in the name property:  
 ![contextmenu](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/a/da92d283a63ca8dae6a505b48f4f1332e821b785.png)

The method "customMethod" is defined on the button:  
 ![customMethod](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/6/262a970fc55a27db971e71708a6098ee4728d443.png)

On the gateway logger I get the following error:

 ![error](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/2/c20cbe044a9bb3895e2bedeb205944ab66acb56a.png)

Alternatively, we could use messages for the same functionality and that works as intended. Does anybody know why the method approach does not work?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 26, 2023, 12:42pm UTC](https://forum.inductiveautomation.com/t/error-with-custom-method-call-from-context-menu/72908/2 "2023-04-26T12:42:40Z")

</div>

Start here, but read the whole topic:

> [@Transaction groups triggered expression item updating when trigger is false](https://forum.inductiveautomation.com/t/transaction-groups-triggered-expression-item-updating-when-trigger-is-false/17196/14):
>
> Ok, so I’ve been down the rabbit hole and found Ignition’s (undocumented) PyComponentWrapper. I haven’t deciphered it enough to be sure, but it seems to be invoked only for particular situations, based on the string constants in the class file (like “getComponent” and “getComponents”). To play with this, I constructed a conversion adapter like so: public class PyComponentAdapter implements PyObjectAdapter { public PyComponentAdapter() {} @Override public boolean canAdapt(Object jObj) { …

TL/DR: Install my free [Simulation Aids module](https://inductiveautomation.com/moduleshowcase/module/automation-professionals-llc-simulation-aids) to get reliable jython behavior with components no matter what java methods delivered them.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [April 26, 2023, 1:55pm UTC](https://forum.inductiveautomation.com/t/error-with-custom-method-call-from-context-menu/72908/3 "2023-04-26T13:55:53Z")

</div>

This is a known bug, I think right now the fix will be in 8.1.27.

> [@New Feature: Component Context Menu](https://forum.inductiveautomation.com/t/new-feature-component-context-menu/68763/28):
>
> Methods were working, then stopped today. I'm on 8.1.25. When is 8.1.26 scheduled to be released? Edit, issues for me are on the alarm status table. Testing with a button, for example, works fine for me.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [April 27, 2023, 7:30pm UTC](https://forum.inductiveautomation.com/t/error-with-custom-method-call-from-context-menu/72908/4 "2023-04-27T19:30:07Z")

</div>

I installed 8.1.27 today and it looks like they did fix this bug.
