CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> Java

 Popup windows

Print topic Send  topic

Author Message
Bram
Posted: 02/13/2004, 11:25 AM

I have created an popup window that is called from a base window using javascript. When I want to update the value of a textbox in the base window using opener I always get an errormessage that the textbox is not an object.

I think this is caused by the fact that the documentname of the base window is not correct. Does anybody have a solution for this problem? I looked on all the forums but could not find anything like this.
peterr


Posts: 5971
Posted: 02/13/2004, 2:15 PM

I believe that our example "Pop-up List & Smart Lookup" in CCS Example Pack shows exactly how to do this. Have you tried it?

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
donsafar


Posts: 90
Posted: 02/15/2004, 4:19 PM

Peter R.
I have looked at this sample and it updates one field on the form. I have six fields that need to be updated based on the grid row selected. Any ideas on the best way to accomplish this?
_________________
Don Safar
View profile  Send private message
peterr


Posts: 5971
Posted: 02/15/2004, 4:24 PM

Hi Don,

I personally haven't work with such functionality, but looking at the HTML of that pop-up page I see:
function SetOpenerValue(EmpName)
{
window.opener.document.departments.department_manager_id.value = EmpName;
window.opener.focus();
window.close();
}

I believe that you should be able to add references to additional fields in there. Please try this for now.

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Bram

Posts: 5
Posted: 02/15/2004, 11:58 PM

Peter

Thank you for your tip. I did not know about the example pack and it was a great help. I made a small mistake. I changed some things in the html code and changed the name {HTMLFormName} to {htmlformname}. I did not know that this was case sensitive.
View profile  Send private message
Don Safar
Posted: 02/17/2004, 8:18 AM

Here are the modifications I made to get it to work for multiple fields. I
modified the link onclick command as follows:

<td class="InLineDataTD"><a class="InLineDataLink"
onclick='SetOpenerValue("{Company_Name}","{Contact_Name}","{Phone}","{Fax}",
"{Address1}","{Address2}","{City}","{State}","{Zip}","{Contractor_License_Nu
mber}","{ContractorAcctNumber}"); return false;'
href="{Company_Name_Src}">{Company_Name}</a> </td>

Then I modified SetOpenerValue to reflect the new fields.

function SetOpenerValue(CompName, ContactName, Phone, Fax, Address1,
Address2, City, State, Zip, LicNum, AcctNum)
{
window.opener.document.tblBuildingGeneral.ContractorBusinessName.value =
CompName;
window.opener.document.tblBuildingGeneral.ContractorName.value =
ContactName;
window.opener.document.tblBuildingGeneral.ContractorAccountNum.value =
AcctNum;
window.opener.document.tblBuildingGeneral.ContractorNCLicenseNo.value =
LicNum;
window.opener.document.tblBuildingGeneral.ContractorStreetNum.value =
Address1;
window.opener.document.tblBuildingGeneral.ContractorStreetName.value =
Address2;
window.opener.document.tblBuildingGeneral.ContractorCity.value = City;
window.opener.document.tblBuildingGeneral.ContractorState.value = State;
window.opener.document.tblBuildingGeneral.ContractorZip.value = Zip;
window.opener.document.tblBuildingGeneral.ContractorPhone.value = Phone;
window.opener.document.tblBuildingGeneral.ContractorFax.value = Fax;
window.opener.focus();
window.close();
}

This works, but it gives the CCS IDE problems. Once I modified the onclick
value, I no longer have access to modify any of the fields in the grid after
this field. The label markers disappear in the IDE. If I remove the onclick
code, I can make mods, then put the onclick code back in. Also, the IDE
duplicates lines of code inexplicably when changing from html view to design
view. The template markers get out of sync causing a failure in the parsing
engine (-1 subscript). I have to go back into html view and remove the
duplicated lines. I would publish here, but I have the form working and I
have spent more than 6 hours to figure out what was happening, so I don't
want to take a chance on screwing it up. Any ideas on a better way to
implement that will not cause the IDE problems.

"peterr" <peterr@forum.codecharge> wrote in message
news:940300daa95de9@news.codecharge.com...
> Hi Don,
>
> I personally haven't work with such functionality, but looking at the HTML
of that pop-up page I see:
> function SetOpenerValue(EmpName)
> {
> window.opener.document.departments.department_manager_id.value =
EmpName;
> window.opener.focus();
> window.close();
> }
>
> I believe that you should be able to add references to additional fields
in there. Please try this for now.
>
> _________________
> Peter R.
> YesSoftware Support Representative
> http://support.codecharge.com
> Warning: I use Google and CCS Docs/Examples in most of my answers
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

k
Posted: 06/06/2005, 11:24 PM

Quote Don Safar:
Here are the modifications I made to get it to work for multiple fields. I
modified the link onclick command as follows:

<td class="InLineDataTD"><a class="InLineDataLink"
onclick='SetOpenerValue("{Company_Name}","{Contact_Name}","{Phone}","{Fax}",
"{Address1}","{Address2}","{City}","{State}","{Zip}","{Contractor_License_Nu
mber}","{ContractorAcctNumber}"); return false;'
href="{Company_Name_Src}">{Company_Name}</a> </td>

Then I modified SetOpenerValue to reflect the new fields.

function SetOpenerValue(CompName, ContactName, Phone, Fax, Address1,
Address2, City, State, Zip, LicNum, AcctNum)
{
window.opener.document.tblBuildingGeneral.ContractorBusinessName.value =
CompName;
window.opener.document.tblBuildingGeneral.ContractorName.value =
ContactName;
window.opener.document.tblBuildingGeneral.ContractorAccountNum.value =
AcctNum;
window.opener.document.tblBuildingGeneral.ContractorNCLicenseNo.value =
LicNum;
window.opener.document.tblBuildingGeneral.ContractorStreetNum.value =
Address1;
window.opener.document.tblBuildingGeneral.ContractorStreetName.value =
Address2;
window.opener.document.tblBuildingGeneral.ContractorCity.value = City;
window.opener.document.tblBuildingGeneral.ContractorState.value = State;
window.opener.document.tblBuildingGeneral.ContractorZip.value = Zip;
window.opener.document.tblBuildingGeneral.ContractorPhone.value = Phone;
window.opener.document.tblBuildingGeneral.ContractorFax.value = Fax;
window.opener.focus();
window.close();
}

This works, but it gives the CCS IDE problems. Once I modified the onclick
value, I no longer have access to modify any of the fields in the grid after
this field. The label markers disappear in the IDE. If I remove the onclick
code, I can make mods, then put the onclick code back in. Also, the IDE
duplicates lines of code inexplicably when changing from html view to design
view. The template markers get out of sync causing a failure in the parsing
engine (-1 subscript). I have to go back into html view and remove the
duplicated lines. I would publish here, but I have the form working and I
have spent more than 6 hours to figure out what was happening, so I don't
want to take a chance on screwing it up. Any ideas on a better way to
implement that will not cause the IDE problems.

"peterr" <peterr@forum.codecharge> wrote in message
news:940300daa95de9@news.codecharge.com...
> Hi Don,
>
> I personally haven't work with such functionality, but looking at the HTML
of that pop-up page I see:
> function SetOpenerValue(EmpName)
> {
> window.opener.document.departments.department_manager_id.value =
EmpName;
> window.opener.focus();
> window.close();
> }
>
> I believe that you should be able to add references to additional fields
in there. Please try this for now.
>
> _________________
> Peter R.
> YesSoftware Support Representative
> http://support.codecharge.com
> Warning: I use Google and CCS Docs/Examples in most of my answers
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>



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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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