How to set a value into a bean:write in the parent window from a pop-up window Javascript function.
Parent JSP Page:
<td class="rmt-readOnlyData" valign="top">
<bean:message key="request.label.countryOfRisk" bundle="abc">
</td>
<td align="left" valign="top" id="countryRisk">
<bean:write name="RequestForm" property="countryOfRisk">
</td>
Pop-up window Java script:
function setParentWindowProperty() {
var countryOfRisk = window.opener.document.getElementById("countryRisk");
var countryOfRiskName = window.opener.document.countryOfRisk;
countryOfRiskName.value = cel2.childNodes[0].data; // ==> Here is where we set the value to the property countryOfRisk.
// This step is not needed if the property is a text box.
countryOfRisk.innerText = countryOfRiskName.value; // ==> Here is where we set the value to the UI screen.
}
<td class="rmt-readOnlyData" valign="top">
<bean:message key="request.label.countryOfRisk" bundle="abc">
</td>
<td align="left" valign="top" id="countryRisk">
<bean:write name="RequestForm" property="countryOfRisk">
</td>
Pop-up window Java script:
function setParentWindowProperty() {
var countryOfRisk = window.opener.document.getElementById("countryRisk");
var countryOfRiskName = window.opener.document.countryOfRisk;
countryOfRiskName.value = cel2.childNodes[0].data; // ==> Here is where we set the value to the property countryOfRisk.
// This step is not needed if the property is a text box.
countryOfRisk.innerText = countryOfRiskName.value; // ==> Here is where we set the value to the UI screen.
}
0 Comments:
Post a Comment
<< Home