Bug? Sub Menu Action not executed

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

when defining a sub menu, the items are not executed when clicked. Pls find testproject attached.

To Test: Go to Menu File > Export > HTML , expected to show info in the log but nothing happens.
 

Attachments

  • test.zip
    1 KB · Views: 320

rwblinn

Well-Known Member
Licensed User
Longtime User
Your naming is wrong
B4X:
Sub menuFileExport_Action
    Log("Clicked Menu File > Sub Menu Export > Sub Menu Item HTML...")
End Sub
Hi agraham,

that is one level to high (file > export). I want a level down (file > export > html>. It does not execute.

Have changed the name of the submenu item to menuFileExportHTML. See below. Nothing happens when clicking?

B4X:
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private menuFileClose As MenuItem
    Private menuitemFileExportHTML As MenuItem
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("1") 'Load the layout file.
    MainForm.Show
End Sub

Sub menuFileClose_Action
    MainForm.Close   
End Sub

Sub menuitemFileExportHTML_Action
    Log("Clicked Menu File > Sub Menu Export > Sub Menu Item HTML...")
End Sub
 

agraham

Expert
Licensed User
Longtime User
Hmm! I see what you mean. Sorry I didn't read carefully enough and missed the sub-menu. It looks like a Designer LoadLayout initialize bug. menuFileExportHTML seems to have been initialized with its parent name.

You can see this by adding another sub-menu at the level of menuFileExportHTML. Both of them raise an event named menuFileExport_Action.

One for Erel I think.
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Hmm! I see what you mean. Sorry I didn't read carefully enough and missed the sub-menu. It looks like a Designer LoadLayout initialize bug. menuFileExportHTML seems to have been initialized with its parent name.

You can see this by adding another sub-menu at the level of menuFileExportHTML. Both of them raise an event named menuFileExport_Action.

One for Erel I think.
Indeed and many thanks for checking as well.
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Thank You and please let know when the next update will be available.
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi Erel,

works fine. Thanks a lot for this quick fix! :)
 
Top