Question


Cotiviti
IN
Last activity: 22 Nov 2018 12:36 EST
Set div id attribute for the Layouts
Can we set id attribute for the layouts so that when I inspect the screen on browser it should show the <div id="myID"> instead of auto generated id.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution


Pegasystems Inc.
GB
Which Pega version are you using, and what kind of layout?
You can't set the ID, but on the presentation tab for a Dyanmic Layout, if you enable "Display advanced presentation options" then you can set a CSS class that will be included in the class attribute of the DIV.
You can also set a value for "Test ID" in the general tab which will set the data-test-id attribute.
-
John Paul Raja Christu Raja


Cotiviti
IN
Thanks Marc for the reply!
Pega Version is 7.4 and Layout is Dynamic Layout and Repeating Layout.
I am aware of Test ID and CSS class. I am specially looking for id .


Pegasystems Inc.
US
Hi Ajay,
I don't think we would be able to give id attribute for an auto generated control .
You can make use of Tour id or Test id for that control for testing purpose .
or we should create a custom control in order to have our own id's .


Cotiviti
IN
Thanks bathb for the reply!
I am specially looking for id . I could have use Test ID but Test ID is only available for controls not for Layouts.


Pegasystems Inc.
US
Hi Ajay, Would it be possible to explain us your use-case that way we could see if there are alternatives since there is no out-of-box option to have id selector on auto generated layout.
Thanks,
Chithra.


Cotiviti
IN
Hi Chithra,
Thanks for the reply. Now we are using Tour ID(data-tour-id) as an alternative.


Pegasystems Inc.
US
Hi Ajay, Using tour id or test id may not be a good candidate but as suggested by Marc use "Display advanced presentation options" in the presentation to set CSS class would be a better choice.