Getting the IDs of widgets, containers, etc

Getting the IDs of widgets, containers, etc

  
Hey everybody,
This is a follow up question to a previous question.  I found this disturbing.  I used the id's of widgets and containers in my javascript coding, but when I added an image to one of the containers on the webscreen all of the id's that I used.....changed.  Wow!  Now I have to change all of the id's of widgets and containers in my javascript coding.  If I changed servers from dev to QA, the id's will change once more.  How can I program in Javascript to capture the changing id's of widgets and container when a webscreen is changed.
Thanks in advance.
Frank
Hi Frank,

The correct way to use widget ids is to fill the the "Name" property of that widget and then in the expression with your javascript code do a "'" + <Name>.RuntimeId + "'"


Regards,
João Rosado
Joao suggestion did not work.  var unHideLoanInfo=document.getElementById(" ' " + <DisplayLoanInfo>.RuntimeId + " ' "); alert(unHideLoanInfo);  Failed the page.
                                                  var unHideLoanInfo=document.getElementById("DisplayLoanInfo").RuntimeId); alert(unHideLoanInfo);    Failed the page.
                                                  var unHideLoanInfo=" ' " + <DisplayLoanInfo>.RuntimeId + " ' "; alert(unHideLoanInfo); Failed the page.
This has been a frustrating experience just to get the id of a widget, whose id can change dynamically.
Any suggestions?
Frank
 
 
This one should work:
"var unHideLoanInfo=document.getElementById('" + DisplayLoadInfo.Id + "'); alert(unHideLoanInfo);"