Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum Trapping a button click

  • Trapping a button click

    Posted by Ron Beach on February 15, 2024 at 5:22 pm

    Is there a way to indicate that a button has been clicked and will execute after the current method executes? If I do an “on evAfter” on an entry field and I clicked a button to trigger the event, I used to be able to trap the button click (in Omnis 6) with a #er value. If my button order # was 15, when I clicked it, #er would have a value of 2015 in my field’s method and I could trap that value. This no longer works.

    Andreas Pfeiffer replied 2 months, 1 week ago 2 Members · 3 Replies
  • 3 Replies
  • Andreas Pfeiffer

    Administrator
    February 15, 2024 at 5:32 pm

    Hi Ron,

    I am not sure if I understand you correctly. Typically you would put an evClick within the $event method of the button. So whenever the button is clicked the code after On evClick will be executed.

    Best,

    Andreas

  • Ron Beach

    Member
    February 15, 2024 at 7:33 pm

    Andreas

    I figured out the solution using references.

    Here’s what I was up against: I have a number field in a list, which gets mathematically adjusted after an “evAfter” unless a button is clicked, If the button is clicked, a different mathematic equation is used. The original problem was the “evAfter” executed before the button’s method. I wanted the button’s method to execute instead of the method following “evAfter” . By trapping the reference to the button click, I can choose which method executes. This may not make sense to you but I got it working. Thanks for replying.

    • Andreas Pfeiffer

      Administrator
      February 15, 2024 at 7:50 pm

      Ron,

      I wonder if a Switch control would be more suitable to achieve this.

      Best regards,

      Andreas

Log in to reply.