
February 10th, 2013, 11:50 PM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 1
Time spent in forums: 23 m 45 sec
Reputation Power: 0
|
|
|
Other - Accessing parent window from child window?
I have a main window named worklistManager.jsp.
worklistManager.jsp has a pop up window named processManager.jsp.
Again, processManager.jsp has another pop up window, named eventLog.jsp.
Once again eventLog.jsp has a pop up window named eventUsers.jsp.
eventUsers.jsp has a dojox/grid/DataGrid and a button. After selecting a particular row in the grid, then clicking the button, it has to place the value into the textbox of eventLog.jsp after closing eventUsers.jsp.
So far, I have tried the script below to accomplish this, but it's not working as I hoped.
Code:
<script type="text/javascript">
function getEventLogUserSelect(){
if(dijit.byId('dynamiceventusergridCWUSER')){
var selctedItem = dijit.byId('dynamiceventusergridCWUSER').selection.getSelected();
if(selctedItem.length){
dojo.forEach(selctedItem, function(selectedItem){
if(selectedItem !== null){
dojo.forEach(dijit.byId('dynamiceventusergridCWUSER').store.getAttributes(selectedItem), function(attribute){
var value = dijit.byId('dynamiceventusergridCWUSER').store.getValues(selectedItem, attribute);
if(attribute == "USERID"){
window.opener.SetValue(value);
window.close();
}
});
}
});
//alert("grid row selected");
}else{
alert("grid row not selected");
}
}
if(gbshowgridFlag==false){
alert("grid not loaded");
}
}
function SetValue(val){
var txt = document.getElementById('CWPROCESSEVENTLOG.USER_ID');
txt.value = val;
}
</script>
|