dynamic id of link if it has been loaded using ajax 

dynamic id of link if it has been loaded using ajax 

  
Hi everyone, 
                   Here is my situation. I click on one link and make a div visible using ajax. Now that div has a table records widget. To make the row clickable in table records , I added a link (and have made it invisible using "display: none;") in the row and on the onclick event on row , I have added this javascript,
document.getElementById('" + NameOfTheLink.Id + "').click();

But this id is empty. What am I missing ? 

Regards
Hi Khushwant,

Does the link has a name?

Can you post a sample?
Hi Pedro, After looking through the source , I have found out the root cause. It seems that onclick event of each row  is getting the dynamic id for the like from previous row. When I removed the onclick event from the row and have added it to the cell level on the cell after the link, it started to get the correct id (but of couse its working only on the cell click and not row click). I have attached the sample source as well. 


Pedro Cardoso wrote:
Hi Khushwant,

Does the link has a name?

Can you post a sample?
 
 Hi Pedro,
                Can you confirm that it is a bug in the outsystems code generation or Am I missing something ? 

Regards

 

I've build a simple test (attached) with a list of users and an onclick on tr, as you can see in the picture and I was able to reproduce the simtoms you talked about.

As you can see from the picture, the first row has no id on the click handler.





for a workaround, find again the eSpace with a click event that looks for the link using jQuery find.

Hope it helps

Thanks Pedro, That worked great.