Set Focus to an element inside a table
Question

Looking for a way to set focus to an element say a button or a checkbox inside a table. The widget ID available to the setfocus is the same in Service Studio for all row positions in the table. The widget id is somewhat codified by outsystems includes the module name,table name, row number etc but hardcoding this seems inneficient. 

Say I wanted to focus on the 3rd row checkbox.

Tried GetElementsbyName() and overwritting the name with a current row of the table. So name = Checkbox3

Adding a tag and then being able to set focus to the tag?

mvp_badge
MVP

Hi André,


You can set a class for the checkbox and use the Document.GetElementsByClassName() method to get the array of elements. You can then use the [Position] to get the element you want, taking account that Position is zero-based (first position is 0, second position is 1, and so forth). Check this example on how to use it.


Kind Regards,
João

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.