Hello,
Having a problem when closing docks where the serverside postback method is not being called.
The docks are dynamically created using the page_init method and have a DockCommand added which is used to close the dock. When clicking the command button the user is prompted using javascript to confirm that they want to remove the dock. The dock is removed from the screen but the serverside postback method is not called. This method is used to persist the dock removal in session and database.
Serverside code for adding dock command
Javascript to prompt user before closing dock
This was working but decided to mysteriously stop behaving. Any ideas as to why would be greatly appreciated. A serverside event for the PositionChanged command is being called via postback with no problems.
To fix this I did try changing the dock creating to use the DockCloseCommand instead of the DockCommand. This presented a different problem where the dock is removed from the screen before the javascript prompt is displayed. This is not desired, especially when the user click cancel when they don't want to remove the dock.
Alternate code tried for adding dock command
We're using version the 2009 Q2 release (version 2009.2.826.20) of the controls in which I believe the animation bug that can cause this behaviour was fixed.
Thanks,
Brad.
Having a problem when closing docks where the serverside postback method is not being called.
The docks are dynamically created using the page_init method and have a DockCommand added which is used to close the dock. When clicking the command button the user is prompted using javascript to confirm that they want to remove the dock. The dock is removed from the screen but the serverside postback method is not called. This method is used to persist the dock removal in session and database.
Serverside code for adding dock command
Dim closeDock As New DockCommand() |
closeDock.OnClientCommand = "PromptRemoveDock" |
closeDock.AutoPostBack = True |
closeDock.Name = "Close" |
closeDock.Text = "Remove" |
closeDock.CssClass = "DockCloseCommand" |
dock.CommandsAutoPostBack = True |
dock.Commands.Add(closeDock) |
AddHandler dock.Command, AddressOf Dock_Command |
Javascript to prompt user before closing dock
function PromptRemoveDock(sender, eventArgs) |
{ |
if (confirm('Remove "' + sender.get_title() + '"?')) |
{ |
sender.set_closed(true); |
} |
else |
{ |
eventArgs.set_cancel(true); |
} |
} |
This was working but decided to mysteriously stop behaving. Any ideas as to why would be greatly appreciated. A serverside event for the PositionChanged command is being called via postback with no problems.
To fix this I did try changing the dock creating to use the DockCloseCommand instead of the DockCommand. This presented a different problem where the dock is removed from the screen before the javascript prompt is displayed. This is not desired, especially when the user click cancel when they don't want to remove the dock.
Alternate code tried for adding dock command
Dim closeCommand As DockCloseCommand |
closeCommand = New DockCloseCommand |
closeCommand.AutoPostBack = True |
closeCommand.OnClientCommand = "PromptRemoveDock" |
dock.Commands.Add(closeCommand) |
AddHandler dock.Command, AddressOf Dock_Command |
We're using version the 2009 Q2 release (version 2009.2.826.20) of the controls in which I believe the animation bug that can cause this behaviour was fixed.
Thanks,
Brad.