Dec 15, 2008, 5:38 PM
[CLOSED] Create Stateful Portal - Save Position and Collapse of Portlets
I am trying to create a dynamic portal that will look up the portlets selected by a particular user and display them in the order they chose and in the last collapse mode they chose. I have an AJAX handler on the close tool on the portlet header, but I can't seem to find where to call an AJAX function after the portlet is moved or collapsed.
Any suggestions on a better way to do this dynamic portlet would be greatly appreciated also.
Thanks in advance,
Any suggestions on a better way to do this dynamic portlet would be greatly appreciated also.
Thanks in advance,
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Portal Example</title>
<script runat="server">
Protected Overloads Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Ext.IsAjaxRequest Then
Dim Portlet1 As New Portlet
Portlet1.Title = "First Dynamic Portlet"
Portlet1.AutoLoadIFrame = "http://www.google.com"
Portlet1.Height = 400
Portlet1.ShowIFrameMask = "true"
'Portlet1.Listeners.Collapse.Fn = "Ext.Msg.alert('Success')"
'Portlet1.Listeners.Move.Fn = "Coolite.AjaxMethods.PortletClick3(1)"
''''''''****************
'create a tool that removes a portlet, I need this same type of thing for collapse and move :)
Dim Tool1 As New Tool
Tool1.Type = ToolType.Close
Tool1.Handler = "Coolite.AjaxMethods.PortletRemove(1,{success: function(result) {Ext.Msg.alert('Success', result);}});panel.ownerCt.remove(panel, true);"
Portlet1.Tools.Add(Tool1)
''''''''****************
Dim a1 As New Anchor
a1.Items.Add(Portlet1)
AnchorLayout1.Anchors.Add(a1)
Dim Portlet2 As New Portlet
Portlet2.Title = "Second Dynamic Portlet"
Dim Tool2 As New Tool
Tool2.Type = ToolType.Close
Tool2.Handler = "Coolite.AjaxMethods.PortletRemove(2,{success: function(result) {Ext.Msg.alert('Success', result);}});panel.ownerCt.remove(panel, true);"
Portlet2.Tools.Add(Tool2)
Dim a2 As New Anchor
a2.Items.Add(Portlet2)
AnchorLayout1.Anchors.Add(a2)
End If
End Sub
<AjaxMethod()> _
Public Function PortletRemove(ByVal Index As Integer) As String
'do a DB update to remove this from the user's list of portlets
Return "Remove Portlet - Index: " & Index
End Function
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ScriptManager ID="ScriptManager2" runat="server"></ext:ScriptManager>
<ext:Portal ID="Portal1" runat="server" Title="Portal">
<Body>
<ext:ColumnLayout ID="ColumnLayout1" runat="server">
<ext:LayoutColumn ColumnWidth=".5">
<ext:PortalColumn ID="PortalColumn1" runat="server" StyleSpec="padding:10px 0 10px 10px">
<Body>
<ext:AnchorLayout ID="AnchorLayout1" runat="server"></ext:AnchorLayout>
</Body>
</ext:PortalColumn>
</ext:LayoutColumn>
<ext:LayoutColumn ColumnWidth=".5">
<ext:PortalColumn ID="PortalColumn2" runat="server" StyleSpec="padding:10px 0 10px 10px">
<Body></Body>
</ext:PortalColumn>
</ext:LayoutColumn>
</ext:ColumnLayout>
</Body>
</ext:Portal>
<ext:Label ID="lblTemp" runat="server"></ext:Label>
</form>
</body>
</html>