Jul 31, 2012, 7:20 PM
UpdateContent() problem.
Hello,
First I want to say thank you to the Ext Devs because Ext is an amazing tool kit that has enabled me to develop complex applications easily! Also thank you to the Ext Community for supplying examples that are easy to work off of. With that here is my situation:
I have a TabPanel with 4 tabs. The main tab has a grid in it that upon a cell click it will switch to the 2nd tab. Along with switching tabs I want to update the content in one of my panels in tab 2. When this happens I get an error that states: "Unable to get value of the property 'dom': object is null or undefined" referring to this line of code in ext.axd (I know its one of the dynamic pieces of code):
My conclusion is that something is not getting loaded until tab 2 is manually clicked.
Here is code for the panel that I want to UpdateContent() in:
Please let me know what you think. Thanks! (sorry for the long post, just trying to be specific)
First I want to say thank you to the Ext Devs because Ext is an amazing tool kit that has enabled me to develop complex applications easily! Also thank you to the Ext Community for supplying examples that are easy to work off of. With that here is my situation:
I have a TabPanel with 4 tabs. The main tab has a grid in it that upon a cell click it will switch to the 2nd tab. Along with switching tabs I want to update the content in one of my panels in tab 2. When this happens I get an error that states: "Unable to get value of the property 'dom': object is null or undefined" referring to this line of code in ext.axd (I know its one of the dynamic pieces of code):
cmp.getContentTarget().dom.appendChild(el.dom)
The weird part is if I load the application normally (loads to tab 1), then I click tab 2 at the top where the tabs are, then click back to tab 1, then click my grid button to switch to tab 2 and execute UpdateContent() it works perfectly. My conclusion is that something is not getting loaded until tab 2 is manually clicked.
Here is code for the panel that I want to UpdateContent() in:
<ext:Panel ID="PanelCalendar" runat="server">
<Content >
<div>
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>
<asp:Literal ID="litSelectedYear" runat="server" />
</th>
<% for (int iWeek = 1; iWeek <= 6; iWeek++)
{
for (int iDay = 1; iDay <= 7; iDay++)
{
if (iWeek == 6 && iDay > 2) break; %>
<th>
<%= GetDayName(iDay) %>
</th>
<% }
} %>
</tr>
</thead>
<asp:Repeater ID="repMonths" runat="server" OnInit="repMonths_OnInit" OnItemDataBound="repMonths_OnItemDataBound">
<ItemTemplate>
<tr>
<td class="month">
<asp:HyperLink ID="hylMonth" runat="server" />
</td>
<asp:Repeater ID="repDays" runat="server" OnItemDataBound="repDays_OnItemDataBound">
<ItemTemplate>
<td id="tdDay" runat="server">
<ext:LinkButton ID="test1" runat="server">
<DirectEvents>
<Click OnEvent="popOutBox" />
</DirectEvents>
</ext:LinkButton>
<asp:Literal ID="litDay" runat="server" />
</td>
</ItemTemplate>
</asp:Repeater>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</div>
</Content>
</ext:Panel>
If I comment everything out inside the content section it will still crash. meaning I leave the:<Content> <%--everything commented out--%></Content>
Here is code where I call the actual UpdateContent():public void EmployeeChangeFromTree(string login)
{
if (m_Manager == null || login == null || login == "")
return;
m_Employee = m_Manager.SelectEmployee(login);
Session["Employee"] = login;
if (m_Employee == null)
return;
if (!String.IsNullOrEmpty(m_Employee.employeeTitle))
{
PanelSummary.Title += ", " + m_Employee.employeeTitle;
}
if (m_Employee.startDate.Year != 1)
{
PanelSummary.Title += ", started on: " + m_Employee.startDate.ToShortDateString();
}
this.StoreQuota.DataSource = m_Employee.Quotas();
this.StoreQuota.DataBind();
this.repMonths.DataBind();
StoreLeaveStatus.DataSource = m_Manager.LeaveStatus();
StoreLeaveStatus.DataBind();
StoreLeaveStatus2.DataSource = m_Manager.LeaveStatusWithNS();
StoreLeaveStatus2.DataBind();
WindowsPrincipal user = new
WindowsPrincipal((WindowsIdentity)HttpContext.Current.User.Identity);
if (m_Employee.myManagers.ContainsKey(user.Identity.Name.ToLower()))
{
ButtonApproveAll.Disabled = false;
ComboSetStatusPopOut.Disabled = false;
ComboSetStatus.Disabled = false;
}
else
{
ComboSetStatusPopOut.SetValue(0);
ComboSetStatus.SetValue(0);
ComboSetStatusPopOut.Disabled = true;
ComboSetStatus.Disabled = true;
ButtonApproveAll.Disabled = true;
}
this.PanelCalendar.UpdateContent();
}
I have tried to get around doing UpdateContent() by using DoLayout(), Render(), and Update(). I have attempted to do that to the parent panel, and the entire tab panel. DoLayout() does not update the content, and the other two cause their own errors.Please let me know what you think. Thanks! (sorry for the long post, just trying to be specific)