759
Views
6
Comments
Set Container Id Property dynamically
Question

Hello,

I want to set the ID of my container  dynamically which is placed inside list like (id_1, id_2, id_3) cause I need to get these ids in my javascript but I did not find any way in outsystems to achieve this.


Can anyone help ?

2018-10-29 08-31-03
João Marques
 
MVP

Hi Neeraj,


May I propose a different approach?

If you assign a given class to the element inside the list, let's say class RowClass, you can then get the elements on Javascript by using document.getElementsByClassName("RowClass")[N] where N is the 0-based row number of the element.


Hope it helps.


Cheers,

João

UserImage.jpg
Neeraj

João Marques wrote:

Hi Neeraj,


May I propose a different approach?

If you assign a given class to the element inside the list, let's say class RowClass, you can then get the elements on Javascript by using document.getElementsByClassName("RowClass")[N] where N is the 0-based row number of the element.


Hope it helps.


Cheers,

João

 Hello


I understood but how I will get the [N] in my javascript, I don't have any button to call the javascript. I need to get these ids on my preparation call

 

2021-03-18 21-03-15
Benjith Sam
 
MVP

Hi Neeraj,

You can pass the container Id value which is a runtime property, could you please let us know what exactly you are trying to implement/achieve?

Is it a RWA or Traditional application?


Kind regards,

Benjith Sam

2020-09-18 09-37-36
Devendra Baghel

Hi Neeraj,

please refer this forum https://www.outsystems.com/forums/discussion/21320/how-to-set-dynamically-id-of-container/

you can add custom ID attribute in extended property of container. and instead of finding element by ID in javascript find the element by custom ID attribute

Best Regards

Devendra

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