Duplicated
Last Updated: 09 Sep 2023 11:42 by ADMIN
Philip
Created on: 23 Apr 2020 15:38
Category: Button
Type: Feature Request
9
Id attribute on buttons (TelerikButtons, GridCommandButtons, etc..)

It would help me with my testing mostly.

===

ADMIN EDIT

You may also want to vote for and follow this request for adding Id property to all components

https://feedback.telerik.com/blazor/1495842-add-id-parameter-on-all-blazor-components

If you need this attribute for testing only,  you may find interesting this request: https://feedback.telerik.com/blazor/1513117-translators-for-selenium-testing-for-the-telerik-ui-for-blazor-components. If so, Vote for it and Follow it so we can know there is interest, and so you can get status updates.

===

 

Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
4 comments
NovaStor
Posted on: 21 Oct 2021 20:43

Hi.

I just wanted to note that `ButtonGroupToggleButton` components also expose an `Id` property, because they inherit from `ButtonBase`, but it doesn't seem to be implemented because the rendered HTML doesn't include the expected `id` attribute.

ADMIN
Marin Bratanov
Posted on: 29 Sep 2020 18:28

Hi Philip,

The ID was added to the Button due to internal refactoring, but the grid command buttons do not implement it yet, even though they inherit the property and you see it in the intellisense.

At this point, adding a custom Class is the best option I can offer for identifying command buttons in the grid for your tests. Once an ID parameter gets implemented it should be relatively easy to switch to that if you extract that comparison logic for buttons in a method.

Regards,
Marin Bratanov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Philip
Posted on: 29 Sep 2020 17:14
It seems as if this feature has been implemented at some point. I'm looking at an environment on 2.17.0 and I have an Id property available on TelerikButtons and GridCommandButtons. Not sure when it was introduced, but seems like all it is missing is maybe some documentation as the only reference to it is in the API reference.
ADMIN
Marin Bratanov
Posted on: 23 Apr 2020 15:40

To add a small clarification - if this does get exposed for command buttons, it is likely that the developer would be responsible for ensuring it is unique, as each button would get repeated for each row. This also applies for reusing components and when you have more than one instance of the same component on the same page - you will need to have unique IDs on all rendered elements across the entire HTML page.

 

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.