JuiceUI events not firing in server side?

170 views
Skip to first unread message

Geo

unread,
May 13, 2012, 4:19:56 AM5/13/12
to Juice UI
Hi all,

I promise I've googled a lot about this before posting, I've been
trying the last two days but I think I'm just misunderstanding some
basic principle and that's why i can't find any info to solve my
problem.

I can't get event to fire (server side)...

here is a simple test where the drag stop event does not fire as (I)
expected:

thanks in advance for your help!

----- CODE BEHIND -----

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MonParking
{
public partial class test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
drag1.Stop += new EventHandler(drag1_Stop);

lbInfo.Text = "initial @ " + DateTime.Now.ToString("fff");
}

void drag1_Stop(object sender, EventArgs e)
{
lbInfo.Text = DateTime.Now.ToString("fff"); //<------ this
event never is not fired!
}
}
}

----- END OF CODE BEHIND -----

----- ASP PAGE -----

<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="test.aspx.cs" Inherits="MonParking.test" %>

<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="lbInfo" runat="server"></asp:Label>
<br />
<br />
<br />
<br />
<asp:Label ID="lbDragMe" runat="server"
BackColor="#FF0066" Text="Drag me!"></asp:Label>
<juice:Draggable ID="drag1" runat="server"
TargetControlID="lbDragMe" AutoPostBack="true" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

----- END OF ASP PAGE -----


Andrew Powell (appendTo)

unread,
May 14, 2012, 11:58:54 AM5/14/12
to jui...@googlegroups.com
The draggable control's Stop event isn't an AutoPostback event at the moment. You can have a look at the event declaration here: https://github.com/appendto/juiceui/blob/master/Juice/Draggable.cs#L315 If it was, you'd see AutoPostback = true. I'll make a note to update the documentation on the site to denote which events can trigger an autopostback.

There also appears to be a bug in the event model. The Stop event *should* trigger if something else causes a postback, like a button for example.

I'll be noting both of these issues at http://github.com/juiceui/issues if you'd like to track them.
Reply all
Reply to author
Forward
0 new messages