CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Return Valure from Pop-Up - Help anyone please

Print topic Send  topic

Author Message
efficinet

Posts: 7
Posted: 04/10/2006, 1:01 PM

I have an issue that I have been trying to resolve for hours and something just is not making sense. Any help is appreciated.

I have a form that has a link to the popup, you click on the link in the popup and its is to return the value back to an assigned form field. It appears to fail and I am not sure why. I utilized the example in the example set.

The Main Window - I have an editable grid that displays one record in one column. The grids name is trees. Inside the grid I have a field called TextBox1 and I have a link that launches the pop-up. The pop-up launches fine.

The popup window has a grid with multiple records displayed. The field PlantCommon was changed to a link that triggers the setopenervalue function. When I click on the link instead of the window closing and the new value being assigned to the text box the pop up navigates to its directory (because there is no href assigned).

Here is the code for the pop-up link:

<td><a onclick="SetOpenerValue(this);return false;" href="{PlantCommon_Src}">{PlantCommon}</a>

Here is the javascript in the head section for the popup:

<script language="JavaScript">
function SetOpenerValue(currentObj)
{
var IE = (document.all) ? 1 : 0;
if(IE) {
var PName = currentObj.innerText;
} else {
var PName = currentObj.text;
}
window.opener.document.Trees.TextBox1.value = PName;
window.opener.focus();
window.close();
}
</script>

If I remove the window.opener.document.Trees.TextBox1.value = PName; then the window closes properly. This tells me (I think) that my error is in that statement. I just don't quite understand where.

Here is the code for the form on the main window:

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<title>::Austin Outdoor Estimating System::</title>
<meta content="CodeCharge Studio 3.0.3.1" name="GENERATOR">
<link href="../Styles/Pine/Style.css" type="text/css" rel="stylesheet">
<script language="JavaScript">
function OpenPop_UpList()
{

var URL = document.getElementById("PlantList").href;

win = window.open( URL, "PlantList", "left=100,top=10,width=480,height=480,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
win.focus();
}

</script>
<script language="JavaScript" type="text/javascript">
//Begin CCS script
//Include JSFunctions @1-5F6E2629
</script>
<script language="JavaScript" src="../ClientI18N.cfm?file=Functions.js&locale={res:CCS_LocaleID}" type="text/javascript" charset="utf-8"></script>
<script language="JavaScript" type="text/javascript">
//End Include JSFunctions

//page_Trees_TreePlant_OnChange @21-1966BFB5
function page_Trees_TreePlant_OnChange()
{
var result;
//End page_Trees_TreePlant_OnChange

//Custom Code @45-2A29BDB7
document.TreeItem.is_change.value = 1;
return false;
//End Custom Code

//Close page_Trees_TreePlant_OnChange @21-BC33A33A
return result;
}
//End Close page_Trees_TreePlant_OnChange

//bind_events @1-A4E71174
function bind_events() {
if(typeof(initTreesElements) == "function"){
initTreesElements();
var icount = TreesElements.length;
for(var i = 0; i < icount; i++){
check_and_bind("TreesElements["+i+"][TreesTreePlantID]", "onchange", page_Trees_TreePlant_OnChange);
}
}
forms_onload();
}
//End bind_events

window.onload = bind_events; //Assign bind_events @1-19F7B649

//End CCS script
</script>
</head>
<body bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0">
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
<tr>
<td>{header} {jsmenu} </td>
</tr>

<tr>
<td align="middle">
<!-- BEGIN EditableGrid Trees -->
<form name="{HTMLFormName}" action="{Action}" method="post">
<input type="hidden" value="{FormState}" name="FormState">{FormScript} 
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top">
<table class="Header" cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="HeaderLeft"><img src="../Styles/Pine/Images/Spacer.gif" border="0"></td>
<th>Edit Tree Detail </th>

<td class="HeaderRight"><img src="../Styles/Pine/Images/Spacer.gif" border="0"></td>
</tr>
</table>

<table class="Grid" cellspacing="0" cellpadding="0">
<!-- BEGIN Error -->
<tr class="Error">
<td colspan="2">{Error}</td>
</tr>
<!-- END Error -->
<!-- BEGIN Row -->
<!-- BEGIN RowError -->
<tr class="Error">
<td colspan="2">{Error}</td>
</tr>
<!-- END RowError -->
<tr class="Row">
<th>Tree Quantity</th>

<td><input maxlength="10" size="10" value="{TreeQuantity}" name="{TreeQuantity_Name}"> <input value="{TextBox1}" name="{TextBox1_Name}"></td>
</tr>

<tr class="Row">
<th>Tree Plant</th>

<td><input maxlength="10" size="50" value="{TreePlant}" name="{TreePlant_Name}"> <a id="PlantList" onclick="OpenPop_UpList();return false;" href="{Link2_Src}">PlantList</a></td>
</tr>

<tr class="Row">
<th>Tree Caliper</th>

<td>
<select name="{TreeCaliper_Name}">
<option value="" selected>Select Value</option>
{TreeCaliper_Options}
</select>
</td>
</tr>

<tr class="Row">
<th>Tree Height</th>

<td>
<select name="{TreeHeight_Name}">
<option value="" selected>Select Value</option>
{TreeHeight_Options}
</select>
</td>
</tr>

<tr class="Row">
<th>Tree Spread</th>

<td>
<select name="{TreeSpread_Name}">
<option value="" selected>Select Value</option>
{TreeSpread_Options}
</select>
</td>
</tr>

<tr class="Row">
<th>Tree Container</th>

<td>
<select name="{TreeContainer_Name}">
<option value="" selected>Select Value</option>
{TreeContainer_Options}
</select>
</td>
</tr>

<tr class="Row">
<th>Tree Material Cost</th>

<td><input maxlength="12" size="12" value="{TreeMaterialCost}" name="{TreeMaterialCost_Name}"></td>
</tr>

<tr class="Row">
<th>Tree Stake Kit</th>

<td>
<select name="{TreeStakeKit_Name}">
<option value="" selected>Select Value</option>
{TreeStakeKit_Options}
</select>
</td>
</tr>

<tr class="Row">
<th>Tree Fertilizer</th>

<td><input type="checkbox" value="1" name="{TreeFertilizer_Name}" {TreeFertilizer}></td>
</tr>

<tr class="Row">
<th>Tree Soil</th>

<td><input type="checkbox" value="1" name="{TreeSoil_Name}" {TreeSoil}></td>
</tr>

<tr class="Row">
<th>Tree Install Type</th>

<td>
<select name="{TreeInstallType_Name}">
<option value="" selected>Select Value</option>
{TreeInstallType_Options}
</select>
</td>
</tr>

<tr class="Row">
<th>Delete</th>

<td>
<!-- BEGIN CheckBox CheckBox_Delete --><input type="checkbox" value="1" name="{CheckBox_Delete_Name}" {CheckBox_Delete}><!-- END CheckBox CheckBox_Delete --></td>
</tr>

<tr class="Row">
<td colspan="2"> </td>
</tr>
<!-- END Row -->
<!-- BEGIN NoRecords -->
<tr class="NoRecords">
<td colspan="2">No records </td>
</tr>
<!-- END NoRecords -->
<tr class="Footer">
<td style="TEXT-ALIGN: right" colspan="2"><input type="hidden" value="{is_change}" name="{is_change_Name}">
<!-- BEGIN Button Button_Submit --><input type="image" src="../Styles/Pine/Images/en/ButtonUpdate.gif" value="Submit" border="0" name="{Button_Name}"><!-- END Button Button_Submit --></td>
</tr>
</table>
<a href="{Link1_Src}">Return to Tree List</a></td>
</tr>
</table>
</form>
<!-- END EditableGrid Trees --></td>
</tr>

<tr>
<td>{footer}</td>
</tr>
</table>
</body>
</html>

Any help is greatly appreciated.

_________________
Efficinet Inc.
www.efficinet.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.