[CLOSED] Portal scroll - code behind

  1. #1

    [CLOSED] Portal scroll - code behind

    I'm trying to load portal from code behind, here are loading methods I'm using:

    
      Private Sub setHome(ByRef pnlContainer As Panel)
    
        Dim portal As Ext.Net.Portal = buildPortal()
        Dim col1 As PortalColumn = addPortalColumn(portal, 0.33)
        Dim col2 As PortalColumn = addPortalColumn(portal, 0.33)
        Dim col3 As PortalColumn = addPortalColumn(portal, 0.33)
        Dim p_1 As Portlet = addPortlet(col1, "1", Icon.Email, "about:blank")
        Dim p_2 As Portlet = addPortlet(col1, "2", Icon.Zoom, "about:blank")
        Dim p_3 As Portlet = addPortlet(col1, "3", Icon.PageGo, "about:blank")
        Dim p_4 As Portlet = addPortlet(col1, "4", Icon.Folder, "about:blank")
        Dim p_5 As Portlet = addPortlet(col1, "5", Icon.Folder, "about:blank")
    
        pnlContainer.Items.Add(portal)
    
     End Sub
    
    
      Public Function buildPortal() As Ext.Net.Portal
    
        Dim portalCfg As New Portal.Config() With {.Layout = "column", _
                                                   .Border = "false", _
                                                   .BodyBorder = "false", _
                                                   .StyleSpec = "background:transparent;", _
                                                   .BodyStyle = "background:transparent;", _
                                                   .AutoScroll = "true", _
                                                   .BodyCssClass = "no-horizontal-scroll"}
    
        portalCfg.LayoutConfig.Add(New ColumnLayoutConfig() With {.FitHeight = False})
        Dim portal As New Portal(portalCfg)
        Return portal
      End Function
    
    
      Public Function addPortalColumn(ByRef portal As Ext.Net.Portal, _
                                      ByVal columnWidth As Double) As Ext.Net.PortalColumn
    
        Dim col_Cfg As New PortalColumn.Config() With {.StyleSpec = "padding:10px 5px 10px 10px;", _
                                                       .ColumnWidth = columnWidth, _
                                                       .Layout = "Anchor"}
        Dim col As New PortalColumn(col_Cfg)
        portal.Items.Add(col)
        Return col
      End Function
    
    
      Public Function addPortlet(ByRef portalColumn As Ext.Net.PortalColumn, _
                                   ByVal title As String, _
                                   ByVal icon As Object, _
                                   ByVal url As String) As Ext.Net.Portlet
    
        Dim pl1 As New Portlet(New Portlet.Config() With {.Frame = "true", _
                                                              .Title = title, _
                                                              .Height = "200", _
                                                              .Padding = "0"})
    
    
        If IsNumeric(icon) Then
            pl1.Icon = icon
          Else
            pl1.IconCls = icon
          End If
    
        pl1.AutoLoad.Url = url
        pl1.AutoLoad.Scripts = True
        pl1.AutoLoad.Mode = LoadMode.IFrame
        pl1.AutoLoad.ShowMask = True
        portalColumn.Add(pl1)
        Return pl1
      End Function
    The portal created is added to a panel (with FitLayout).

    It works fine, but I cannot scroll the portal.
    If I create the same portal (using the shown configs) from markup, it scrolls correctly.

    Where could be the problem?

    Thank you very much.
    Last edited by Daniil; May 24, 2012 at 2:50 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Does the combined height of portlets exceed the portal height?

    Could you provide a full example to reproduce?

    If I create the same portal (using the shown configs) from markup, it scrolls correctly.
    Well, it should be same, so, there should be some difference.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    Does the combined height of portlets exceed the portal height?

    Could you provide a full example to reproduce?



    Well, it should be same, so, there should be some difference.
    1) Yes, the height of portlets exceeds the portal height.

    2) I'll provide you a full example as soon as possible.

    3) Here is markup equivalent:

    
    <ext:Portal runat="server" ID="protalHome" 
                Layout="column"
                Border="false" BodyBorder="false"
                StyleSpec="background:transparent;"
                BodyStyle="background:transparent;"
                AutoScroll="true"
                BodyCssClass="no-horizontal-scroll">
                
      <LayoutConfig>
          <ext:ColumnLayoutConfig FitHeight="false" />
      </LayoutConfig>
                                                    
      <Items>
        <ext:PortalColumn 
            ID="col1" 
            runat="server"
            StyleSpec="padding:10px 5px 10px"
            Frame="true"
            ColumnWidth=".33"
            Layout="Anchor">
          <Items> 
                <ext:Portlet 
                    ID="p1"
                    Title="p1" 
                    icon="Email"
                    runat="server" 
                    Height="200"
                    Padding="0">
                    <AutoLoad ShowMask="true" Url="about:blank" Mode="IFrame" />
                </ext:Portlet>
            
                <ext:Portlet 
                    ID="p2" 
                    Frame="true"
                    Title="p2" 
                    runat="server" 
                    icon="Zoom"
                    Height="200"
                    Padding="0">
                    <AutoLoad ShowMask="true" Url="about:blank" Mode="IFrame" />
                </ext:Portlet>
                
                <ext:Portlet 
                      ID="p3" 
                      Frame="true"
                      Title="p3" 
                      runat="server"
                      icon="PageGo" 
                      Height="200"
                      Padding="0">
                      <AutoLoad ShowMask="true" Url="about:blank" Mode="IFrame" />
                  </ext:Portlet>
                  
                 <ext:Portlet 
                      ID="p4" 
                      Frame="true"
                      Title="p4" 
                      runat="server" 
                      Height="95"
                      IconCls="wf-icon"
                      Padding="0">
                      <AutoLoad ShowMask="true" Url="about:blank" Mode="IFrame" />
                  </ext:Portlet>
                  
                  <ext:Portlet 
                      ID="p5" 
                      Frame="true"
                      Title="p5" 
                      icon="Folder"
                      runat="server" 
                      Height="95"
                      Padding="0">
                      <AutoLoad ShowMask="true" Url="about:blank" Mode="IFrame" />
                  </ext:Portlet>
                                                                            
            </Items>
          </ext:PortalColumn> 
        
          <ext:PortalColumn ID="col2" 
                            runat="server" 
                            StyleSpec="padding:10px 5px 10px 5px"
                            ColumnWidth=".33"
                            Layout="Anchor">
          </ext:PortalColumn>
          
          <ext:PortalColumn ID="col3" 
                            runat="server" 
                            StyleSpec="padding:10px 10px 10px 5px"
                            ColumnWidth=".33"
                            Layout="Anchor">
          </ext:PortalColumn>
      </Items>
                                                    
    </ext:Portal>
  4. #4
    Test1.aspx:

    <%@ Page Language="vb" AutoEventWireup="true" Inherits="Test1" Codebehind="Test1.aspx.vb" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" 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>test1</title>        
    </head>
    
    
    <body id="body">
    
    
    <form id="dpForm" runat="server" target="_self" method="post" enableviewstate="true">
      <ext:ResourceManager ID="extSM" runat="server" StateProvider="PostBack" CleanResourceUrl="false" />  
      <ext:Viewport ID="vpContainer" runat="server" AutoShow="true" >
            <Items>
                <ext:BorderLayout ID="blContainer" runat="server">       
                    <North Split="false" Collapsible="false" MaxHeight="60" MinHeight="60">
                        <ext:Panel ID="pnlHeader" 
                                   runat="server"
                                   Height="60"
                                   BodyBorder="false"
                                   Border="false"
                                   Header="false">
                        </ext:Panel>                                                               
                    </North>
            
                    <Center Split="false">
                        <ext:Panel ID="pnlContainer" Layout="fit"
                                   StyleSpec="background:transparent;"
                                   BodyStyle="background:transparent;"
                                   runat="server"> 
                            
                            <Items>
                                <ext:TabPanel ID="pnlTabs" runat="server"
                                              Border="false" BodyBorder="false"
                                              StyleSpec="background:transparent;"
                                              BodyStyle="background:transparent;">
                                    <Items>
                                        <ext:Panel ID="pnlHome" runat="server" 
                                                   Layout="fit"
                                                   StyleSpec="background:transparent;"
                                                   BodyStyle="background:transparent;"
                                                   Title="Home">
                                            <Items>
                                                
                                            </Items>                                    
                                        </ext:Panel>
                                    </Items>
                                </ext:TabPanel>
                            </Items>  
                                                                 
                        </ext:Panel>
                    </Center>                             
              </ext:BorderLayout>
            </Items>
      </ext:Viewport>        
      
    </form>
    
    
    </body>
    
    
    </html>
    Test1.aspx.vb:

    Imports Ext.Net
    
    
    Partial Class Test1 : Inherits System.Web.UI.Page
    
    
      Protected Sub Page_Load(ByVal sender As Object, _
                              ByVal e As System.EventArgs) _
                              Handles Me.Load
        setHome(pnlHome)
      End Sub
    
    
      Private Sub setHome(ByRef cnt As Panel)
    
    
        Dim portal As Ext.Net.Portal = buildPortal()
        Dim col1 As PortalColumn = addPortalColumn(portal, 0.33)
        Dim col2 As PortalColumn = addPortalColumn(portal, 0.33)
        Dim col3 As PortalColumn = addPortalColumn(portal, 0.33)
        Dim p_movimentazioni As Portlet = addPortlet(col1, "p1", Icon.Email, "ABOUT:BLANK")
        Dim p_ricerche As Portlet = addPortlet(col1, "p2", Icon.Zoom, "ABOUT:BLANK")
        Dim p_archiviazione As Portlet = addPortlet(col1, "p3", Icon.PageGo, "ABOUT:BLANK")
        Dim p_processi As Portlet = addPortlet(col1, "p4", Icon.Folder, "ABOUT:BLANK")
        Dim p_fascicoli As Portlet = addPortlet(col1, "p5", Icon.Folder, "ABOUT:BLANK")
        cnt.Items.Add(portal)
      End Sub
    
    
      Public Function buildPortal() As Ext.Net.Portal
    
    
        Dim portalCfg As New Portal.Config() With {.Layout = "column", _
                                                   .Border = "false", _
                                                   .BodyBorder = "false", _
                                                   .StyleSpec = "background:transparent;", _
                                                   .BodyStyle = "background:transparent;", _
                                                   .AutoScroll = "true", _
                                                   .BodyCssClass = "no-horizontal-scroll"}
    
    
        portalCfg.LayoutConfig.Add(New ColumnLayoutConfig() With {.FitHeight = False})
        Dim portal As New Portal(portalCfg)
        Return portal
      End Function
    
    
      Public Function addPortalColumn(ByRef portal As Ext.Net.Portal, _
                                      ByVal columnWidth As Double) As Ext.Net.PortalColumn
    
    
        Dim col_Cfg As New PortalColumn.Config() With {.StyleSpec = "padding:10px 5px 10px 10px;", _
                                                       .ColumnWidth = columnWidth, _
                                                       .Layout = "Anchor"}
        Dim col As New PortalColumn(col_Cfg)
        portal.Items.Add(col)
        Return col
      End Function
    
    
      Public Function addPortlet(ByRef portalColumn As Ext.Net.PortalColumn, _
                                 ByVal title As String, _
                                 ByVal icon As Object, _
                                 ByVal url As String) As Ext.Net.Portlet
    
    
        Dim pl1 As New Portlet(New Portlet.Config() With {.Frame = "true", _
                                                          .Title = title, _
                                                          .Height = "200", _
                                                          .Padding = "0"})
    
    
        If IsNumeric(icon) Then
            pl1.Icon = icon
          Else
            pl1.IconCls = icon
          End If
    
    
        pl1.AutoLoad.Url = url
        pl1.AutoLoad.Scripts = True
        pl1.AutoLoad.Mode = LoadMode.IFrame
        pl1.AutoLoad.ShowMask = True
        portalColumn.Add(pl1)
        Return pl1
      End Function
    
    
    End Class
  5. #5
    Thanks for the samples.

    Please remove
    .Layout = "column"
    of the Portal config.

    It overrides LayoutConfig with FitHeight when you create the Portal the way as you do.

    But
    FitHeight="false"
    is required to get vertical scrolling working.

    P.S. You could place code behind directly on ASPX page wrapping in
    <%@ Page Language="vb" %>
    
    <script runat="server">
       Protected Sub Page_Load(ByVal sender As Object, _
                                ByVal e As System.EventArgs) _
                                Handles Me.Load
            setHome(pnlHome)
        End Sub
    
        ...
    </script>
    It would make our life easier.
  6. #6
    Quote Originally Posted by Daniil View Post
    Thanks for the samples.

    Please remove
    .Layout = "column"
    of the Portal config.

    It overrides LayoutConfig with FitHeight when you create the Portal the way as you do.

    But
    FitHeight="false"
    is required to get vertical scrolling working.

    P.S. You could place code behind directly on ASPX page wrapping in
    <%@ Page Language="vb" %>
    
    <script runat="server">
       Protected Sub Page_Load(ByVal sender As Object, _
                                ByVal e As System.EventArgs) _
                                Handles Me.Load
            setHome(pnlHome)
        End Sub
    
        ...
    </script>
    It would make our life easier.
    Thank you for your response,

    that solves the scroll problem, but if I remove Layout="column", I can see only one column although I've configured three columns.

    P.S.
    Next time I'll place code behind on .aspx page, I'm sorry.
  7. #7
    Confirmed. I have discovered that LayoutConfig is not rendered at all with Portal.Config. I will check it.

    For now please use:
        Public Function buildPortal() As Ext.Net.Portal
            Dim portal As New Portal() With
                {
                    .Border = "false", _
                    .BodyBorder = "false", _
                    .StyleSpec = "background:transparent;", _
                    .BodyStyle = "background:transparent;", _
                    .AutoScroll = "true"
                }
            portal.LayoutConfig.Add(New ColumnLayoutConfig() With { .FitHeight = False })
            Return portal
        End Function
  8. #8
    Quote Originally Posted by Daniil View Post
    Confirmed. I have discovered that LayoutConfig is not rendered at all with Portal.Config. I will check it.

    For now please use:
        Public Function buildPortal() As Ext.Net.Portal
            Dim portal As New Portal() With
                {
                    .Border = "false", _
                    .BodyBorder = "false", _
                    .StyleSpec = "background:transparent;", _
                    .BodyStyle = "background:transparent;", _
                    .AutoScroll = "true"
                }
            portal.LayoutConfig.Add(New ColumnLayoutConfig() With { .FitHeight = False })
            Return portal
        End Function
    Thank you very much, your workaround works fine.

    If you prefer mark as solved.
  9. #9
    Quote Originally Posted by Daniil View Post
    Confirmed. I have discovered that LayoutConfig is not rendered at all with Portal.Config. I will check it.
    Well, creating controls by its constructor which applies Control.Config is not supported at the moment. And, probably, it won't be supported in Ext.NET v1 at all.

    We will consider to support it in Ext.NET v2.

Similar Threads

  1. How to make the portal scroll bar at the top
    By jy00882735 in forum 2.x Help
    Replies: 1
    Last Post: Aug 16, 2012, 11:41 AM
  2. [CLOSED] Portal Deluxe not shows Scroll bar in IE 8.0
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Feb 08, 2011, 3:19 AM
  3. [CLOSED] [1.0] Render Portal Code behind Mask Issues
    By ljankowski in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 10, 2010, 11:18 AM
  4. Dynamic portal and portlets in code behind
    By Sofficino in forum 1.x Help
    Replies: 1
    Last Post: Jun 08, 2009, 4:42 AM
  5. Replies: 11
    Last Post: Oct 23, 2008, 8:45 AM

Tags for this Thread

Posting Permissions