Feb 26, 2009, 9:58 AM
[CLOSED] CardLayout rendering ALL panel contents at once AND OUTSIDE the CardLayout?
Hi,
I have a rather urgent issue to solve. I'm working with an SVN code versio downloaded on monday.
At first I thought it might have to do with my app, but the I reproduced the issue simply modifying a little your Coolite sample.
It is simply that whatver content I put in any of the CardLayout panels gets rendered BEFORE the CardLayout, the content of all panels is rendered visible at the same time... I must be missing something here... right?.
Here it goes the code:
<%@ Page Language="C#" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Card Layout</title>
<link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
<script runat="server">
protected void Next_Click(object sender, EventArgs e)
{
int index = int.Parse(WizardLayout.ActiveItem);
if ((index + 1) < WizardLayout.Items.Count)
{
WizardLayout.ActiveItem = (index + 1).ToString();
}
CheckButtons();
}
protected void Prev_Click(object sender, EventArgs e)
{
int index = int.Parse(WizardLayout.ActiveItem);
if ((index - 1) >= 0)
{
WizardLayout.ActiveItem = (index - 1).ToString();
}
CheckButtons();
}
private void CheckButtons()
{
int index = int.Parse(WizardLayout.ActiveItem);
btnNext.Disabled = index == (WizardLayout.Items.Count - 1);
btnPrev.Disabled = index == 0;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ScriptManager ID="ScriptManager1" runat="server" />
<ext:Panel ID="WizardPanel" runat="server" Title="Example Wizard" BodyStyle="padding:15px" Height="300" >
<Body>
<ext:CardLayout ID="WizardLayout" runat="server" ActiveItem="0">
<ext:Panel runat="server"
Html="<h1>Welcome to the Wizard!</h1><p>Step 1 of 3</p>" Border="false"
Header="false" ID="Panel1">
<Body>
<ext:Button ID="Button1" Text="Botonazo" runat="server"> </ext:Button>
</Body>
</ext:Panel>
<ext:Panel runat="server" Html="<p>Step 2 of 3</p>" Border="false"
Header="false" ID="Panel2">
<Body>
<ext:Button ID="Button2" Text="Botonazo2222" runat="server"> </ext:Button>
</Body>
</ext:Panel>
<ext:Panel runat="server"
Html="<h1>Congratulations!</h1><p>Step 3 of 3 - Complete</p>" Border="false"
Header="false" ID="Panel3">
<Body>
<ext:Button ID="Button3" Text="Botonazo3333" runat="server"> </ext:Button>
</Body>
</ext:Panel>
</ext:CardLayout>
</Body>
<Buttons>
<ext:Button ID="btnNext" runat="server" Text="Next">
<AjaxEvents>
<Click OnEvent="Next_Click" ViewStateMode="Include">
</Click>
</AjaxEvents>
</ext:Button>
<ext:Button ID="btnPrev" runat="server" Text="Prev" Disabled="true">
<AjaxEvents>
<Click OnEvent="Prev_Click" ViewStateMode="Include">
</Click>
</AjaxEvents>
</ext:Button>
</Buttons>
</ext:Panel>
</form>
</body>
</html>
Please, 'Ive been wasting hours on this, and now I'm runing against the clock with a delivery to a productive environment...Thanks in advance!