|
Rank: Member Groups: Member
Joined: 1/10/2008 Posts: 26
|
Hi, I have a strange behaviour when setting visibillity to true on a tabstrip. When a progressbar's Runtask is done I use use ClientSideOnTaskDone to perform a partial postback from a javascript. During this postback i set the visible property for a tabstrip and a multiview to true. The problem is that only the multiview appears. I have made a test project where I toggle the visibillity and noticed the following behaviour: - first time only the Multipage appears - second time a get two tabstrips on top of the multiview - third time the tabstrip appears correctly and it looks like the tab page I want What can be my problem? aspx page: ]
Code: HTML/ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!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 runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function ImportDone(sender)
{
__doPostBack('updatePanel1', '');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<eo:ProgressBar ID="ProgressBarTest" runat="server" Width="250px" BackgroundImage="00060101"
BackgroundImageLeft="00060102" BackgroundImageRight="00060103" ControlSkinID="None"
IndicatorImage="00060104" IndicatorIncrement="7" OnRunTask="ProgressBarTest_RunTask"
ClientSideOnTaskDone="ImportDone" StartTaskButton="Button1" />
<br />
<asp:Button ID="Button1" runat="server" Text="Start RunTask" />
<br />
<asp:UpdatePanel runat="server" ID="updatePanel1" UpdateMode="Conditional">
<ContentTemplate>
<eo:TabStrip ID="tabStrip" runat="server" MultiPageID="multiPage" ControlSkinID="None"
Visible="false">
<LookItems>
<eo:TabItem Image-BackgroundRepeat="RepeatX" Image-Mode="TextBackground" Image-SelectedUrl="00010225"
Image-Url="00010222" ItemID="_Default" LeftIcon-SelectedUrl="00010224" LeftIcon-Url="00010221"
NormalStyle-CssText="color: #606060" RightIcon-SelectedUrl="00010226" RightIcon-Url="00010223"
SelectedStyle-CssText="color: #2f4761; font-weight: bold;">
<SubGroup OverlapDepth="8" Style-CssText="font-family: tahoma; font-size: 8pt; background-image: url(00010220); background-repeat: repeat-x; cursor: hand;">
</SubGroup>
</eo:TabItem>
</LookItems>
<TopGroup>
<Items>
<eo:TabItem Text-Html="Skapade">
</eo:TabItem>
<eo:TabItem Text-Html="Kastade">
</eo:TabItem>
</Items>
</TopGroup>
</eo:TabStrip>
<eo:MultiPage ID="multiPage" runat="server" Height='180px' Width='100%' Visible="false">
<eo:PageView ID="PageView1" runat="server" Width="100%">
<asp:Literal runat="server" ID="importedData"></asp:Literal>
Page1
</eo:PageView>
<eo:PageView ID="PageView2" runat="server" Width="100%">
<asp:Literal runat="server" ID="skippedData"></asp:Literal>
Page2
</eo:PageView>
</eo:MultiPage>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
code behind:
Code: C#
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string controlName = Request.Params.Get("__EVENTTARGET");
if(controlName == updatePanel1.ID)
{
tabStrip.Visible = !tabStrip.Visible;
multiPage.Visible = !multiPage.Visible;
}
}
protected void ProgressBarTest_RunTask(object sender, EO.Web.ProgressTaskEventArgs e)
{
int i = 0; //dummy
}
}
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, That's because our JavaScript library is not correctly intialized when the page initially load, because the TabStrip's Visible is set to false, so none of the JavaScript files required by the TabStrip is rendered. Try place a dummy TabStrip outside of the UpdatePanel:
Code: HTML/ASPX
<eo:TabStrip runat="server" ID="dummyTabStrip" style="display:none">
<TopGroup>
<Items>
<eo:TabItem Text-Html="Dummy">
</eo:TabItem>
</Items>
</TopGroup>
</eo:TabStrip>
Note the dummy tabstrip's style is set to "display:none" so it is never visible (do not use Visible="false"). Thanks
|
|
Rank: Member Groups: Member
Joined: 1/10/2008 Posts: 26
|
Thanks, I realise that I have low knowledge in which order the page is rendered. I got the tabstrip to show now with your example. The problem I now have is that I get the following message: Quote:The Tabstrip 'tabtrip' is associated with MultiPage 'multiPage'. But the MultiPage do not exist. I know the id is correct because it works if I set visible = true from the start. Therefore I guess the problem is related to how the page is render. What do I need to do? The MultiPage is showing so it has been rendered.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
That appears to be a problem, we will look into it and see what we can do. In the mean time, you can replace ASP.NET UpdatePanel with our CallbackPanel. It should work fine with our own CallbackPanel. The CalbackPanel works very similar to UpdatePanel.
Thanks
|
|
Rank: Member Groups: Member
Joined: 1/10/2008 Posts: 26
|
Ok, I have changed but I do not understand how to retrieve which control that caused the postback. Normally I would do this in the Page_Load:
Code: C#
protected void Page_Load(object sender, EventArgs e)
{
string controlName = Request.Params.Get("__EVENTTARGET");
if(controlName == updatePanel1.ClientID)
{
//do something
}
}
You have some callBackEventArgs but I do not think I can access them from Page_Load (I am using eo_Callback from a javascript instead of __postBack).
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi Patrik,
You don't need to do that in Page_Load. You need to:
1. Edit the CallbackPanel's Trigger property to set the button as a trigger; 2. Handle the button's click event as if the CallbackPanel does not exist;
Thanks
|
|
Rank: Member Groups: Member
Joined: 1/10/2008 Posts: 26
|
Hi,
in the test project I use a button but in my real application I do not have that. I respond on the progressbars ClientSideOnTaskDone. In there I do a postback because I need to present the result from the method connected to the RunTask. I have the result stored in a session so that I can receive it when doing my postback. That´s why I need to handle it in the Page_Load. Can I not access the trigger of the postback when using your eo_Callback?
/Patrik
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
When you use eo_Callback, you can handle CallbackPanel_Execute event. When you use regular postback, you can handle the triggering controls's event. A _doPostBack also triggers a regular postback. So if you give _doPostBack the correct parameters, it will act the same as if a button is clicked. So you can still use your _doPostBack, just supply it with the ID of your trigger control. That way the corresponding server side event should be triggered (Your original code Request.Params.Get("__EVENTTARGET") would also work). If you use eo_Callback, then that function takes an additional parameter for you to pass arbitrary data back to the server.
Thanks
|
|
Rank: Member Groups: Member
Joined: 1/10/2008 Posts: 26
|
Hi,
thank you for your quick responses and your patience. I had missed the CallbackPanel_Execute event which works fine with eo_Callback function. I now have the functionality I was looking for. Your support is excellent!
For fun I did a test also just swapping the eo_Callback to a __doPostBack. I use the exact same control ID. When I did that I got a complete different behaviour. It seems like a complete postback is done instead of a partial one. It theen seems like the ClientSideOnTaskDone event is fired again and again (because the postback call is in that method).
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Patrik wrote:Hi, For fun I did a test also just swapping the eo_Callback to a __doPostBack. I use the exact same control ID. When I did that I got a complete different behaviour. It seems like a complete postback is done instead of a partial one. It theen seems like the ClientSideOnTaskDone event is fired again and again (because the postback call is in that method). That's interesting. We will take a look and see what we can find. Nevertheless it's good to know that everything is working for you!
|
|