PDA

View Full Version : [CLOSED] Problem with treepanel and xmldatasource



infonext
Jun 15, 2013, 4:51 PM
Hi all,

i have one problems with treepanel and xmldatasource.

This is an error that i get when page load (and consequently i get a blank page).

The code is:



<asp:XmlDataSource ID="MnuXmlDataSource" runat="server"
DataFile="~/App_Data/authors.xml"></asp:XmlDataSource>


<exts:ExtendendTabPanel Margins="10 0 10 0" Frame="true" runat="server" ID="tabpanel1" Region="Center" Border="false">
<TabBar>
<ext:ToolbarFill ID="ToolbarFill1" runat="server" />
<exts:ExtendendButton ID="btnstart" runat="server" IconUrl="Images/extnet16.png" TextAlign="Right" Text="Menu">
<Bin>
<exts:ExtendendPanel ID="mnupanel" runat="server" Layout="AccordionLayout" Floating="true">
<Items>
<exts:ExtendendTreePanel
ID="TreePanel1"
runat="server"
Width="300"
Height="450"
AutoScroll="true" Security="SISTEMA">
<Store>
<ext:TreeStore ID="TreeStore1" runat="server" DataSourceID="MnuXmlDataSource">
<DataBindings>
<ext:NodeBinding DataMember="Funzioni" Text="Funzioni" />
<ext:NodeBinding DataMember="Procedura" TextField="Text" />
<ext:NodeBinding DataMember="Funzione" TextField="Text" />

</DataBindings>
</ext:TreeStore>
</Store>
<Listeners>
<ItemClick Handler="if (record.data.href) { e.stopEvent(); #{mnupanel}.hide();#{tabpanel1}.tabBar.layout.over flowHandler.scrollToItem(Ext.getCmp('btnstart'));}" />
</Listeners>
<DirectEvents>
<ItemClick OnEvent="treeClick">
<ExtraParams>
<ext:Parameter Name="treenodehref" Value="record.data.href" Mode="Raw"></ext:Parameter>
<ext:Parameter Name="recid" Value="record.getId()" Mode="Raw"></ext:Parameter>
<ext:Parameter Name="title" Value="record.data.text" Mode="Raw"></ext:Parameter>
</ExtraParams>
</ItemClick>
</DirectEvents>

</exts:ExtendendTreePanel>
</Items>
<TopBar>
<ext:Toolbar ID="Toolbar2" runat="server" ClassicButtonStyle="true">
<Items>

<ext:Button ID="Button3" runat="server" Text="Chiudi" Handler="function(){this.up('panel').hide();}">
</ext:Button>
<ext:ToolbarFill ID="ToolbarFill2" runat="server" />
</Items>
</ext:Toolbar>
</TopBar>
</exts:ExtendendPanel>
</Bin>
<Listeners>
<Click Handler=" this.bin[0].show(); this.bin[0].alignTo(this.el);menuhide(#{tabpanel1},#{mnuPanel })">
</Click>
</Listeners>
</exts:ExtendendButton>

</TabBar>


</exts:ExtendendTabPanel>




Xml file is:



<?xml version="1.0" encoding="utf-8" ?>
<Funzioni>
<Procedura Text="Sistema">
<Funzione NodeID="Ruoli" Icon="None" Text="Ruoli" Expanded="true">
<Gestione Href="~/Views/Ruoli/MainRuoli.aspx" NodeID="MainRuoli" Text="Gestione" IsLeaf="true" />
<Gestione Icon="None" Href="~/Views/Ruoli/MainRicercaStampa.aspx" NodeID="VisualizzaStampa" Text="Ricerca / Stampa" IsLeaf="true" />
<Gestione Icon="None" Href="~/Views/Ruoli/RuoliFunzioniMain.aspx" NodeID="RuoliFunzioni" Text="Abil. Ruoli-Funzioni" IsLeaf="true" />

</Funzione>
<Funzione Text="Gruppi" Icon="None" NodeID="Gruppi" Expanded="true" >
<Gestione Icon="None" Href="~/Views/Gruppi/MainGruppi.aspx" NodeID="MainGruppi" Text="Gestione" IsLeaf="true"/>
<Gestione Icon="None" Href="~/Views/Gruppi/MainRicercaStampa.aspx" NodeID="GruppiVisualizzaStampa" Text="Ricerca / Stampa" IsLeaf="true" />

</Funzione>
<Funzione Text="Utenti" Icon="None" NodeID="Utenti" Expanded="true" Security="UTENTI">
<Gestione Icon="None" Href="~/Views/Utenti/MainUtenti.aspx" NodeID="MainUtenti" Text="Gestione" IsLeaf="true" />
<Gestione Icon="None" Href="~/Views/Utenti/MainUtentiRuoliGruppi.aspx" NodeID="MainUtentiRuoliGruppi" Text="Abil. Utenti-Ruoli-Gruppi" IsLeaf="true" />
<Gestione Icon="None" Href="~/Views/Utenti/MainRicercaStampa.aspx" NodeID="UtentiVisualizzaStampa" Text="Ricerca / Stampa" IsLeaf="true" />
</Funzione>

</Procedura>

</Funzioni>



The error is:

Message: Object reference not set to an instance of an object

Stack Trace:



in Ext.Net.TreeStoreBase.DataBindRecursive(Node node, IHierarchicalEnumerable enumerable)
in Ext.Net.TreeStoreBase.DataBindRecursive(Node node, IHierarchicalEnumerable enumerable)
in Ext.Net.TreeStoreBase.DataBindRecursive(Node node, IHierarchicalEnumerable enumerable)
in Ext.Net.TreeStoreBase.DataBindRecursive(Node node, IHierarchicalEnumerable enumerable)
in Ext.Net.TreeStoreBase.DataBindNode(Node node, String path)
in Ext.Net.TreeStoreBase.PerformDataBinding()
in Ext.Net.TreeStoreBase.PerformSelect()
in Ext.Net.TreeStoreBase.DataBind()
in Ext.Net.TreeStoreBase.EnsureDataBound()
in Ext.Net.TreeStoreBase.OnPreRender(EventArgs e)
in System.Web.UI.Control.PreRenderRecursiveInternal()
in System.Web.UI.Control.PreRenderRecursiveInternal()
in System.Web.UI.Control.PreRenderRecursiveInternal()
in System.Web.UI.Control.PreRenderRecursiveInternal()
in System.Web.UI.Control.PreRenderRecursiveInternal()
in System.Web.UI.Control.PreRenderRecursiveInternal()
in System.Web.UI.Control.PreRenderRecursiveInternal()
in System.Web.UI.Control.PreRenderRecursiveInternal()
in System.Web.UI.Control.PreRenderRecursiveInternal()
in System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Any idea about?

P.s. Exented controls are controls inherited with an addictional property.

Daniil
Jun 17, 2013, 6:23 AM
Hi @infotext,

Please add the following NodeBinding.

<ext:NodeBinding DataMember="Gestione" TextField="Text" LeafField="IsLeaf" />

infonext
Jun 17, 2013, 12:52 PM
Hi Daniil,

ok, i'll try.