Welcome Guest Search | Active Topics | Sign In | Register

eo:Dialog in aspx-Form Options
PRO POTSDAM GmbH
Posted: Friday, September 15, 2023 8:24:22 AM
Rank: Advanced Member
Groups: Member

Joined: 6/17/2010
Posts: 35
On an aspx page i have included the control eo.Dialog for messages.

Via javascript I call the control with the command eo_GetObject("Dialog01").

I get the error message "TypeError: Cannot read properties of null (reading: 'setCaption')

If I include the control via a UserControl (*.ascx) the call works without problems.

Code: HTML/ASPX
[size=4]<%@ Page Language="C#" EnableViewState="false" CodeFile="datenArchiv.aspx.cs" AutoEventWireup="true" Inherits="datenArchiv" %>
<%@ Register TagPrefix="eo" Assembly="EO.Web" Namespace="EO.Web" %>
<!DOCTYPE html>
<html lang="de">
<head id="Head1" runat="server">
	<title>Overview data</title>
	<link rel="stylesheet" href="../App_Themes/ProPotsdam/datenArchiv.css" type="text/css" />
	<script src="../App_Themes/ProPotsdam/datenArchiv.js"></script>
</head>
<body>
	<form id="form1" runat="server">
		<span class="formular">
		<br>
		<table>
			
			...

		</table>
		<div id="DivDialog01">
			<eo:Dialog runat="server" id="Dialog01" BackShadeColor="gray" BackShadeOpacity="25" AnchorElementID="" ShowDirection="TopLeft" OffsetX="0" OffsetY="0" BackColor="#47729F" ControlSkinID="None" Width="350px" Height="250px" HeaderHtml="" BorderStyle="Solid"	CloseButtonUrl="00070101" ClientSideOnCancel="OnDialog1Cancel" MinimizeButtonUrl="00070102" AllowResize="False" BorderWidth="1px" BorderColor="#335C88" RestoreButtonUrl="00070103" >
				<HeaderStyleActive CssText="heigth:20px;padding-right:4px;padding-left:4px;font-size:small;background-image:url(00070104);padding-bottom:3px;padding-top:3px;font-family:tahoma;text-align:center"></HeaderStyleActive>
				<ContentStyleActive CssText="border-top: #335c88 1px solid; background-color: #e5f1fd"></ContentStyleActive>
				<ContentTemplate>
					<textarea id="LDiaText" class="memoTCP2" style="position:absolute;left:30px;top:50px;color:black;height:130px;width:290px;color:blue" />
					<input type="button" id="Button24" value="Ja" style="position:absolute;left:95px;top:200px;width:75px" onclick="OnDialog1CloseJa();"/>
					<input type="button" id="Button25" value="Nein" style="position:absolute;left:180px;top:200px;width:75px" onclick="OnDialog1CloseNein();" />
				</ContentTemplate>
				<FooterTemplate></FooterTemplate>
			</eo:Dialog>
		</div>
		</span>
	</form>
</body>
</html>[/size]


Code: JavaScript
[size=4]function imagebuttonEpressed() {

	try
	{

		divImage15Einblenden();

		showMsgBox('imagebuttonEpressed()', 'Export data?', 10);

		...



function showMsgBox(_nameOfFunction, _question, _index) {

	try
	{

		var oDialog=eo_GetObject("Dialog01");
		oDialog.setCaption(_nameOfFunction);

		...[/size]




eo_support
Posted: Friday, September 15, 2023 6:57:25 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

The root of the issue is the textarea element in your ContentTemplate. You need to change it from:

Code: HTML/ASPX
<textarea id="LDiaText" class="memoTCP2" style="...." />

To:

Code: HTML/ASPX
<textarea id="LDiaText" class="memoTCP2" style="....">
</textarea>


textarea element can not be self closed. Otherwise everything after the textarea will be considered contents of the textarea element.

Thanks!
PRO POTSDAM GmbH
Posted: Monday, September 18, 2023 4:06:23 AM
Rank: Advanced Member
Groups: Member

Joined: 6/17/2010
Posts: 35
Arrgh!
This worked.
Thanks!
eo_support
Posted: Monday, September 18, 2023 9:33:46 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
You are very welcome. Please feel free to let us know if there is anything else.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.