Welcome Guest Search | Active Topics | Sign In | Register

Very Strange Behavior Options
Samuele
Posted: Thursday, July 26, 2007 8:13:31 AM
Rank: Advanced Member
Groups: Member

Joined: 5/31/2007
Posts: 58
Hi,

I've been busy for reproduce the behavior.. i hope you understand.. before i post the code.

Code: HTML/ASPX
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="CorEuroMach.WebForm1"%>
<%@ Register TagPrefix="eo" Namespace="EO.Web" Assembly="EO.Web" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>WebForm1</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
			<eo:CallbackPanel id="CallbackPanel1" runat="server" Height="150px" Width="200px">
				<eo:Menu id="Menu1" runat="server" ControlSkinID="MSDN" Width="360px">
					<TopGroup>
						<Items>
							<eo:MenuItem Text-Html="New Menu Item"></eo:MenuItem>
							<eo:MenuItem Text-Html="New Menu Item"></eo:MenuItem>
							<eo:MenuItem Text-Html="New Menu Item"></eo:MenuItem>
						</Items>
					</TopGroup>
				</eo:Menu>
			</eo:CallbackPanel>
			<eo:CallbackPanel id="CallbackPanel2" runat="server" Height="150px" Width="200px" Triggers="{ControlID:DataGrid1;Parameter:}">
				<asp:DataGrid id="DataGrid1" runat="server" AutoGenerateColumns="False">
					<Columns>
						<asp:TemplateColumn HeaderText="Name">
							<ItemTemplate>
								<asp:Label id=Label1 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Name") %>'>
								</asp:Label>
							</ItemTemplate>
							<EditItemTemplate>
								<eo:DatePicker id="DatePicker1" runat="server" DayHeaderFormat="FirstLetter" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
									DayCellHeight="16" OtherMonthDayVisible="True" DayCellWidth="19" TitleRightArrowImageUrl="DefaultSubMenuIcon"
									VisibleDate="2007-07-01" ControlSkinID="None">
									<DayHoverStyle CssText="border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid"></DayHoverStyle>
									<TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;"></TitleStyle>
									<DayHeaderStyle CssText="border-bottom: #aca899 1px solid"></DayHeaderStyle>
									<DayStyle CssText="border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid"></DayStyle>
									<SelectedDayStyle CssText="background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid"></SelectedDayStyle>
									<TitleArrowStyle CssText="cursor:hand"></TitleArrowStyle>
									<TodayStyle CssText="border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid"></TodayStyle>
									<PickerStyle CssText="font-family:Courier New; padding-left:5px; padding-right: 5px;"></PickerStyle>
									<OtherMonthDayStyle CssText="color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid"></OtherMonthDayStyle>
									<CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma"></CalendarStyle>
									<DisabledDayStyle CssText="color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid"></DisabledDayStyle>
									<MonthStyle CssText="font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px; font-family: tahoma"></MonthStyle>
								</eo:DatePicker>
							</EditItemTemplate>
						</asp:TemplateColumn>
						<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn>
					</Columns>
				</asp:DataGrid>
			</eo:CallbackPanel>
		</form>
	</body>
</HTML>


Code: Visual Basic.NET
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not IsPostBack Then
            LoadData()
        End If
    End Sub

    Public Function CreateTable() As DataTable
        Dim myDataTable As DataTable = New DataTable("ParentTable")
        Dim myDataColumn As DataColumn
        Dim myDataRow As DataRow

        myDataColumn = New DataColumn
        myDataColumn.DataType = System.Type.GetType("System.String")
        myDataColumn.ColumnName = "Name"
        myDataTable.Columns.Add(myDataColumn)

        For i As Integer = 0 To 2
            myDataRow = myDataTable.NewRow()
            myDataRow("Name") = "Test " & i
            myDataTable.Rows.Add(myDataRow)
        Next

        Return myDataTable
    End Function

    Private Sub LoadData()
        If ViewState("DataTable") Is Nothing Then
            ViewState("DataTable") = CreateTable()
        End If

        DataGrid1.DataSource = ViewState("DataTable")
        DataGrid1.DataBind()
    End Sub

    Private Sub DataGrid1_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.EditCommand
        DataGrid1.EditItemIndex = e.Item.ItemIndex
        LoadData()
    End Sub


When i enter in edit mode TimePicker component not function as it was in Readonly mode.
If i put another TimePicker on form outside the CallBackPanel when i enter in edit mode the component in TemplateColumn work.
If i remove the Menu work..
If i remove the CallBackPanel that contain Menu work..
I've try with AjaxUploader into TemplateColumn and the result is the same.

It's very strange and i've very busy to find this case..
Please help me.

Very Thanks
Samuele
eo_support
Posted: Thursday, July 26, 2007 8:30:58 AM
Rank: Administration
Groups: Administration

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

Thanks for having the detailed reproducing code. What you see is mostly normal. Another post explained a similar situation here:

http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=237

When you use a CallbackPanel to dynamically load a control, since the whole page is not being refreshed, some script modules required by the dynamically loaded control may not be loaded. In this case those script modules should be loaded before the AJAX call --- that is, before you click "Edit" on the Grid. When you put a DatePicker outside of the CallbackPanel, it would do just that. So a workaround is to put a DatePicker outside of the CallbackPanel, but hide it inside a <div style="display:none"></div>. This way the DatePicker is still rendered, but not displayed.

I am not sure why removing the Menu would fix the problem, though. We will look into it and see if we can find out why.

Thanks
Samuele
Posted: Thursday, July 26, 2007 8:50:10 AM
Rank: Advanced Member
Groups: Member

Joined: 5/31/2007
Posts: 58
Thanks for quick answer,

I had already adopted this solution.. but is not good stylist.
Is strange that make therefore only in presence of a menu into an CallBackPanel.

thanks however
Samuele
eo_support
Posted: Thursday, July 26, 2007 8:53:46 AM
Rank: Administration
Groups: Administration

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

A cleaner solution is to set this property to "EO.Web.*":

http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.CallbackPanel.ScriptModules.html

Thanks
Samuele
Posted: Thursday, July 26, 2007 1:05:48 PM
Rank: Advanced Member
Groups: Member

Joined: 5/31/2007
Posts: 58
GREAT SOLUTION!!!

All solved
Tanks


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.