View Full Version : Please help. Refresh ext:panel

Mar 24, 2009, 8:40 PM

First of, you guys are rock. I learn a lot from this site. I'm current build a web application that do the following:

1/ In Page1.aspx: generate 3 dynamic tabs and assign autoload value for each tab accordingly. This part part work fine.
2/ Let say page1.apsx generate 3 tabs, and autoload render the content for tab 1 (from page2.aspx) base on some reset value (this part also work). On this page2.aspx, I have a dropdown and a button so that when user select the value in the dropdown, a chart is render base on user's selected value.

This is the code for page2.aspx

<form id="frmWinSight" runat="server">
<ext:ScriptManager ID="srmgrChartContent" runat="server" />
<ext:Store ID="strdTypeList" runat="server" AutoLoad="true">
<ext:JsonReader ReaderID="rdrType">
<ext:RecordField Name="TypeID" Type="String" />
<ext:RecordField Name="TypeName" Type="String" />
<Load Handler="#{cbxChartType}.setValue(this.getAt(0).data[#{cbxChartType}.valueField]);" Single="false" />

<ext:Panel ID="pnlOptions" runat="server" Collapsible="true" Title="Chart View"
AutoHeight="true" BodyStyle="background-color: #dfe8f6; padding:3px;">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<td width="210">
<ext:Combobox FieldLabel="Chart Type" ID="cbxChartType" runat="server"
StoreID="strdTypeList" DisplayField="TypeName" ValueField="TypeID"
width="200" Mode="Local" ForceSelection="true" TriggerAction="All" />
<td width="80"><ext:Checkbox ID="cbxAllDates" BoxLabel="All Dates" runat="server" /></td>
<td width="110"><ext:Checkbox ID="cbxMileStones" BoxLabel="Mile Stones" runat="server" /></td>
<td width="110"><ext:Checkbox ID="cbxOptData" BoxLabel="Option Data" runat="server" /></td>
<td align="left">
<ext:Button ID="btnLoadChart" runat="server" Text="Load Chart" >
<Click OnEvent="btnLoadChart_Click">
<EventMask ShowMask="true" />

<ext:Panel ID="pnlMainContent" runat="server" AutoHeight="true" >
<asp:PlaceHolder id="plhdContent" runat="server" />
<div id="dChartContent_<%= iPortletID %>">


<asp:TextBox id="tbCurTabID" runat="server" Style="display:none;visibility:hidden;" />
<asp:TextBox id="tbCurTypeID" runat="server" Style="display:none;visibility:hidden;" />
<asp:TextBox id="tbCurType" runat="server" Style="display:none;visibility:hidden;" />

and in the code-behind of this page, everytime user click the load chart button, it call this ajaxfunction

protected void btnLoadChart_Click(object sender, CooliteLib.AjaxEventArgs e)
int ChartID = Convert.ToInt32(cbxChartType.SelectedItem.Value);

string sImgUrl = chartObj.getChartURL(ChartID, elementID, periodID, unitID,
strFlags, strExtra, lWidth, lHeight);


plhdContent.Controls.Add(new LiteralControl("<table border=\"0\" cellpadding=\"3\" cellspacing=\"3\" width=\"98%\" align=\"center\">\n" +
"<tr><td align=\"center\"><img src=\"" + sImgUrl + "\" width=\"" + lWidth.ToString() + "\"" +
" height=\"" + lHeight.ToString() + "\" border=\"0\"></td></tr>\n" +

The problem is is I get the new chart URL from my webservice correctly and assign it to the placeholder to swap the image, but it doesn't do anything. Can somebody let me know what I did wrong or let me know if there's better way to do this simple app.

Thanks in advance