Hi
We want to display a label whose contents are set dynamically through database. So, in smart Client how can we do it.
I was also not able to do it using DOM objects. It says the object is null if I use document.getElementById(‘label1’).text or document.getElementById(‘label1’).value
Also, we want this content to be set first time the page loads, so in which method or event should I place the code.
Thanks
Gaurav
Hi Guarav,
You would typically display such contents in an HTMLFlow. You could populate it by calling dataSource.fetchData() and calling HTMLFlow.setContents() in the callback.
To be called on page load, use Page.setEvent(‘load’, callback).
Note that when using SmartClient, you should never go directly to the DOM if you can avoid it. One of the key benefits of SmartClient is shielding you from low-level cross-browser issues such as memory leaks, inconsistent layout, and inconsistent events, but SmartClient can only consistently do so if you stick to the high-level object-oriented APIs SmartClient provides.