Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MenuBarElement: looking up menu items by ID rather than by a caption #8186

Closed
Artur- opened this issue Jan 10, 2017 · 9 comments · Fixed by #12124
Closed

MenuBarElement: looking up menu items by ID rather than by a caption #8186

Artur- opened this issue Jan 10, 2017 · 9 comments · Fixed by #12124

Comments

@Artur-
Copy link
Member

Artur- commented Jan 10, 2017

From @vaadin-bot on December 1, 2015 11:24

Originally by mvysny2


Instead of finding menu items by caption, I would consider adding a support for menu items to have developer-defined string ID, and changing the API to looking up menu items by this ID. This also helps if the application may be localized, which causes menu items to different captions based on locale.
This would also solve https://dev.vaadin.com/ticket/16874


Imported from https://dev.vaadin.com/ issue #19327

Copied from original issue: vaadin/testbench#799

@Artur- Artur- added the bug label Jan 10, 2017
@Artur-
Copy link
Member Author

Artur- commented Jan 10, 2017

From @vaadin-bot on December 1, 2015 13:5

Originally by @Legioth


Depends on #3653 in the framework.

@fante76
Copy link

fante76 commented Nov 15, 2017

Hi, any news about this problem?

@stale
Copy link

stale bot commented Apr 14, 2018

Hello there!

It looks like this issue hasn't progressed lately. There are so many issues that we just can't deal them all within a reasonable timeframe.

There are a couple of things you could help to get things rolling on this issue (this is an automated message, so expect that some of these are already in use):

  • Check if the issue is still valid for the latest version. There are dozens of duplicates in our issue tracker, so it is possible that the issue is already tackled. If it appears to be fixed, close the issue, otherwise report to the issue that it is still valid.
  • Provide more details how to reproduce the issue.
  • Explain why it is important to get this issue fixed and politely draw others attention to it e.g. via the forum or social media.
  • Add a reduced test case about the issue, so it is easier for somebody to start working on a solution.
  • Try fixing the issue yourself and create a pull request that contains the test case and/or a fix for it. Handling the pull requests is the top priority for the core team.
  • If the issue is clearly a bug, use the Warranty in your Vaadin subscription to raise its priority.

Thanks again for your contributions! Even though we haven't been able to get this issue fixed, we hope you to report your findings and enhancement ideas in the future too!

@stale stale bot added the Stale Stale bot label label Apr 14, 2018
@focbenz
Copy link
Contributor

focbenz commented Apr 16, 2018

In our application we use FontIcons in front of the actual captions in the MenuItems. So it is even harder to identify those by captions. Would also very much like to see the ability to set IDs for the items inside the MenuBarElement.

@stale stale bot removed the Stale Stale bot label label Apr 16, 2018
@AlexWagner
Copy link

Moreover it would be useful if we could add/remove stylenames as in button component.

@stale
Copy link

stale bot commented Sep 13, 2018

Hello there!

We are sorry that this issue hasn't progressed lately. We are prioritizing issues by severity and the number of customers we expect are experiencing this and haven't gotten around to fix this issue yet.

There are a couple of things you could help to get things rolling on this issue (this is an automated message, so expect that some of these are already in use):

  • Check if the issue is still valid for the latest version. There are dozens of duplicates in our issue tracker, so it is possible that the issue is already tackled. If it appears to be fixed, close the issue, otherwise report to the issue that it is still valid.
  • Provide more details how to reproduce the issue.
  • Explain why it is important to get this issue fixed and politely draw others attention to it e.g. via the forum or social media.
  • Add a reduced test case about the issue, so it is easier for somebody to start working on a solution.
  • Try fixing the issue yourself and create a pull request that contains the test case and/or a fix for it. Handling the pull requests is the top priority for the core team.
  • If the issue is clearly a bug, use the Warranty in your Vaadin subscription to raise its priority.

Thanks again for your contributions! Even though we haven't been able to get this issue fixed, we hope you to report your findings and enhancement ideas in the future too!

@stale stale bot added the Stale Stale bot label label Sep 13, 2018
@focbenz
Copy link
Contributor

focbenz commented Sep 14, 2018

Please do not stale this ... I think the suggestion to also add and remove stylenames might be good too.

@stale stale bot removed the Stale Stale bot label label Sep 14, 2018
@cdir
Copy link

cdir commented Oct 14, 2020

I think @Artur- was right labeling this as a bug. I just rold our customers "no problem you get the ID for automated UI tests in a second" and then realize that it is not supported. Realy? This is a bug not an enhancement.

TatuLund added a commit that referenced this issue Oct 16, 2020
Menu items, do have generated id's. This PR modifies the component to set this id as DOM attribute to the element. This fix is not a perfect solution, but helps significantly testing of the MenuBar.

Fixes: #8186
Ansku pushed a commit that referenced this issue Oct 22, 2020
)

Use generated IDs for MenuItems when an ID is set for MenuBar. Tying the ID to MenuBar's ID helps with the possible case of having multiple MenuBars on the same view and avoids to have excess id's when not needed.

Fixes: #8186
Ansku pushed a commit that referenced this issue Dec 1, 2020
)

Use generated IDs for MenuItems when an ID is set for MenuBar. Tying the ID to MenuBar's ID helps with the possible case of having multiple MenuBars on the same view and avoids to have excess id's when not needed.

Fixes: #8186
Ansku added a commit that referenced this issue Dec 1, 2020
) (#12156)

Use generated IDs for MenuItems when an ID is set for MenuBar. Tying the ID to MenuBar's ID helps with the possible case of having multiple MenuBars on the same view and avoids to have excess id's when not needed.

Fixes: #8186

Authored-by: Tatu Lund <tatu@vaadin.com>
@TatuLund
Copy link
Contributor

TatuLund commented Dec 7, 2020

From Vaadin 8.12.1: if you set the MenuBar id, say "my-menu", the menu items will have generated id's "my-menu-1", "my-menu-2", ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants