View Full Version : [CLOSED] Possible bugs?

Sep 13, 2008, 7:32 PM
Hi guys,

I'm found something that sounds like a bug but I'm not sure it is. I think its me doing something awfully wrong :)

I have a BorderLayout with two regions, Center and South.

In the Center I have a GridPanel and in the South I have a set of controls to display data based on the row i have selected.

In order to do this I use an AjaxEvent and a UserParameter. When a row is selected, the event is fired, I catch the parameter and update the data contained on the controls in the southern region.

Now the problem I having is weird. The controls I have in the southern region are two, a TextField and a TextArea. If both controls have the property Disabled="false", I have no problem at all, but if i set Disabled="true" on the TextArea, i get an exception when a new row is selected and even before reaching my method...

This is the exception that's beign raised: Object reference not set to an instance of an object.
And this is the trace:

[NullReferenceException: Object reference not set to an instance of an object.]
Coolite.Ext.Web.TextArea.set_Text(String value) +49
Coolite.Ext.Web.TextArea.LoadPostData(String postDataKey, NameValueCollection postCollection) +137
Coolite.Ext.Web.Field.System.Web.UI.IPostBackDataH andler.LoadPostData(String postDataKey, NameValueCollection postCollection) +42
System.Web.UI.Page.ProcessPostData(NameValueCollec tion postData, Boolean fBeforeLoad) +693
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1743

Now it's getting even weirder. I was trying to adapt an example that Vlad gave me on something else to show you guys what the error was. But what I found is ANOTHER problem that i definitely think is related to the first want and is what makes me think maybe I'm the one doing something wrong.

In this sample, I don't get an exception when I select a new row. Instead, nothing is being updated in the TextArea when I set its Text property in the GridPanel1_RowSelectedChanged methos.
The Textfield is being updated but the TextArea is not! O.o

Really estrange.

Anyway, here is my sample. Help :)


<%@ Page Language="C#" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
if (!this.IsPostBack)
this.MyData.DataSource = new object[]
new object[] {"3m Co", 71.72, 0.02, 0.03, "9/1 12:00am"},
new object[] {"Alcoa Inc", 29.01, 0.42, 1.47, "9/1 12:00am"},
new object[] {"Wal-Mart Stores, Inc.", 45.45, 0.73, 1.63, "9/1 12:00am"}


protected void GridPanel1_RowSelectedChanged(object sender, AjaxEventArgs e)
if (!String.IsNullOrEmpty(e.UserParams["Company"]))
this.TextArea1.Text = e.UserParams["Company"];
this.TextField1.Text = e.UserParams["Company"];

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Coolite Example - Simple Array Grid</title>
<form id="form1" runat="server">

<ext:ScriptManager ID="ScriptManager1" runat="server" StateProvider="None" />

<h1>Array Grid Example</h1>

<p>This example shows how to create a grid from Array data.</p>

<ext:Store ID="MyData" runat="server">
<ext:RecordField Name="company" />
<ext:RecordField Name="price" Type="Float" />
<ext:RecordField Name="change" Type="Float" />
<ext:RecordField Name="pctChange" Type="Float" />
<ext:RecordField Name="lastChange" Type="Date" DateFormat="n/j h:ia" />

<ext:Panel ID="Panel1" runat="server" Height="580">
<ext:BorderLayout ID="BorderLayout1" runat="server">
<ext:Panel ID="Panel2" runat="server" Title="Center">
Title="Array Grid"
<ColumnModel ID="ColumnModel1" runat="server">
<ext:Column ColumnId="Company" Header="Company" Width="160" Sortable="true" DataIndex="company" />
<ext:Column Header="Price" Width="75" Sortable="true" DataIndex="price">
<Renderer Format="UsMoney" />
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
<RowSelect OnEvent="GridPanel1_RowSelectedChanged">
<ext:Parameter Name="Company" Value="this.getSelected().data['company']" Mode="Raw" />
<EventMask ShowMask="false" />
<South Collapsible="true" Split="true">
<ext:Panel ID="Panel3" runat="server" Height="150" Title="South">
area <ext:TextArea ID="TextArea1" runat="server"></ext:TextArea><br />
field <ext:TextField ID="TextField1" runat="server"></ext:TextField>

Sep 14, 2008, 6:31 AM
Hi Chelonian,

Thanks for the great sample demonstrating the problem. I copied/pasted you code into a new .aspx and it worked without any revisions. I remember revising the TextArea .LoadPostData Method just recently and although I don't remember what exactly fixed the problem, but I can confirm your sample is working perfectly now. 

The fix will be available with the v0.6 release. 

Sep 14, 2008, 1:00 PM
Awesome Geoff, thanks :)