NetTalk Central

Author Topic: Using popup menu/menuitem on a browse row  (Read 3926 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Using popup menu/menuitem on a browse row
« on: July 16, 2024, 04:46:31 AM »

Quote from: Bruce on February 08, 2024, 01:10:29 AM

14.17 is up.
It contains an option "send to server" in the browse menu item options.
This triggers a browse event "menuitem" which you can handle in the TakeEvent routine.



Hi,

I am trying to implement the popup menu on a browse and am unsure of how to handle the event.
I have it working up to the point of where I have a case structure in TakeEvent routine which fires the correct code for each item.

However am unsure of what code to embed here besides my code?
Some of the items will be updated file fields and then writing the values to disk.

What housekeeping routines must I call to keep everything happy and updated?

thanks

Johan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Using popup menu/menuitem on a browse row
« Reply #1 on: July 16, 2024, 08:48:28 PM »
I think you need to post an example - I think you are embedding in the wrong place.

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: Using popup menu/menuitem on a browse row
« Reply #2 on: July 16, 2024, 09:34:36 PM »
Hi Bruce

Is there an example of how to implement the menu field on a browse?
or perhaps in the docs that I can look at?

As per the screenshots there is a "send to server" but no place to embed the code, where do I put that code.

In a previous post you mentioned the TakeEvent routine

14.17 is up.
It contains an option "send to server" in the browse menu item options.
This triggers a browse event "menuitem" which you can handle in the TakeEvent routine.



thanks

Johan


osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Using popup menu/menuitem on a browse row
« Reply #3 on: July 17, 2024, 03:43:01 AM »
i use another approach, in a browse create a buttons and his buttons call another window that send or process any code, look my images the button request open a popup window to send email

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Using popup menu/menuitem on a browse row
« Reply #4 on: July 17, 2024, 08:07:51 PM »
You're on the right track Johan,
In the browse procedure, TakeEvent routine, of 'menuitem' event.
You can see the text of the item in loc:MenuItemText, and you can get the current row by checking p_web.GSV('MAI:MailBoxNumber') since that is the unique id field of the browse.

>> However am unsure of what code to embed here besides my code?
none
>> Some of the items will be updated file fields and then writing the values to disk.
cool, then you need to open the table, read the record, update the values, and close the table.
If you want to refresh the row call
do CallRow

>> What housekeeping routines must I call to keep everything happy and updated?
nothing is required. If there are ancillary things you want to happen, then it's probably useful to metion what they are, and I can advise on those.

Cheers
Bruce

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: Using popup menu/menuitem on a browse row
« Reply #5 on: July 17, 2024, 10:05:18 PM »
Hi Bruce

Thanks, got it working.

To confirm,
in the case of changing a status field and the browse is filtered on status and that record should no longer be in the current visible list
then correct call is a call to CallBrowse to reset the whole List/Browse?
That's working nicely,

thanks

Johan