I am using icefaces , the managed bean's postconstruct method populates some data by making a network call. In the xhtml I am binding this to a hidden outputText
<h:outputText id="hdnBtnForData" value="#{XBean.hiddenData}" style="display: none;" />
This XBean.hiddenData is populated in postconstruct mehtod. Now when i try to get the the value of outputText in Javascript , it always gives me undefined.
In Javascript I am getting the value as below.
var res = document.getElementById("xxxxForm:hdnBtnForData");
console.log("value is + JSON.stringify(res.value));
My understanding is that JS is evaluated even before the postconstruct is able to put data in the variable. How do i solve this. Any pointers would be very helpful.