MenuItem for XojoWeb

if I insert the following code in a button in xojo desktop I get a menuitem, Is there a way to do it in xojo Web too?

Code in Button:

dim base as new MenuItem
Dim Item1 as new MenuItem
Item1.Text = “Item 1”
base.Append (Item1)
dim m as new menuitem
m = base.PopUp

Kind regards

In the opening event of the button add something like this:

Var myMenu As New WebMenuItem
myMenu.AddMenuItem( "Item 1" )
myMenu.AddMenuItem( "Item 2" )
Me.ContextualMenu = myMenu

it works when you press the right button on the button, but I need it when the button is clicked as in the desktop app how can I do?

https://documentation.xojo.com/api/user_interface/web/webbutton.html#webbutton-menu

There’s an example on this page

The example works fine on xojo 2.0 I would need something that works on xojo 1.0 web framework. Thank you!

1 Like

Ah sorry, I thought this was a web 2.0 question :frowning:

using webarchive and consulting the old guide and found the solution in case others need it

Code in Show Button:

Dim menu As New WebMenuitem
menu.Append(New WebMenuItem(“Item 1”))
menu.Append(New WebMenuItem(“Item 2”))
Me.ContextualMenu = menu

Code in Action button:

Me.PresentContextualMenu

I thank those who followed the post!