Mar 22, 2010, 8:43 AM
[CLOSED] [1.0] Problem with Multifield.Fields.Remove component
Hi,
I create runtime a panel "pnlfiltro_campo" and inside it a multfield "multif_campo"; I add two fields: an ext.net.textfield and an ext.net.button.
The problem is on RemovePanel ("pnlfiltro_campo") 's function.
I run my page and my panel ("pnlfiltro_campo") is displayed correctly but when I click on "remove panel"'s button after few minutes appears a msg "Do you want to interrupt script? Internet explorer is slowed down by one of the script of the page; computer could not respond". If I confirm stopping script in my panel "pnlfiltro_campo" disappear textfield component but not button component, so I think that the problem is when page try to remove button...
The same problem occours if in multifield I add an ext.net.datafield instead of ext.net.button component.
Differently, if in multifield I add an ext.net.combobox instead of ext.net.button component, it works perfectly!!
Here the code:
Public Sub CreatePanel()
Dim Filtro As New Panel
Filtro.ID = "PANELFILTRO_CAMPO"
Filtro.EnableViewState = "false"
Filtro.Header = False
Filtro.Icon = Icon.BulletCross
Filtro.Draggable = True
Filtro.AutoWidth = False
Filtro.AutoHeight = False
Dim Pnl As Panel = AddCampo()
Pnl.ID = "PNLFILTRO_CAMPO"
Filtro.Items.Add(Pnl)
'FiltriColonna is defined in markup and it is an Ext.Net.PortalColumn of "PortalFiltri" ext.net.portal
FiltriColonna.Items.Add(Filtro)
End Sub
Public Function AddCampo() As Panel
Dim Layout As New MultiField
Layout.ID = "MULTIF_CAMPO"
Dim Tb As New Ext.Net.TextField
Tb.ID = "FILTRO_CAMPO"
Dim BttnCerca As New Ext.Net.Button
BttnCerca.Icon = Icon.Zoom
BttnCerca.ID = "BTTN_PAGINA_CAMPO"
BttnCerca.DirectEvents.Click.ExtraParams.Add(New Parameter("CAMPO", 1))
BttnCerca.DirectEvents.Click.EventMask.ShowMask = True
BttnCerca.DirectEvents.Click.EventMask.Msg = "Caricamento dati in corso..."
AddHandler BttnCerca.DirectEvents.Click.Event, AddressOf BottoneApriFiltroPagina
Layout.Fields.Add(Tb)
Layout.Fields.Add(BttnCerca)
Dim Pnl As New Panel
Pnl.Items.Add(Layout)
Return Pnl
End Function
Public Sub RemovePanel() 'first test
Dim Pannello As Ext.Net.Panel
Pannello = PortalFiltri.FindControl("PANELFILTRO_CAMPO")
Dim Parent As PortalColumn = Pannello.Parent
If Not IsNothing(Pannello) Then
Parent.Remove(Pannello.ClientID)
Parent.DoLayout()
End If
End sub
Public Sub RemovePanel() 'second test
Dim Contenitore As Ext.Net.Panel
Contenitore = PortalFiltri.FindControl("PNLFILTRO_" & Campo)
Dim Layout As New MultiField
Layout = Contenitore.FindControl("MULTIF_" & Campo)
If Not IsNothing(Layout) Then
Dim Bottone As New Ext.Net.Button
Bottone = Contenitore.FindControl("BTTN_PAGINA_" & Campo)
If Not IsNothing(Bottone) Then
Bottone.DirectEvents.ClearDirectEvents()
Layout.Fields.Remove(Bottone)
End If
End If
Layout.Fields.RemoveRange(0, Layout.Fields.Count)
Contenitore.Remove(Layout.ClientID)
Contenitore.RemoveAll()
Contenitore.DoLayout()
End Sub
I try to remove panel in different ways but with no results.Thanks in advance
Paolo