DirectEvent scope and undefined IDs

Page 2 of 2 FirstFirst 12
  1. #11
    You replace "ProfilesSummary" by 'this' reference therefore such cannot be occured (you have no any reference on that panel now)
    Please post example which we can run localy
  2. #12
    HI Vlad,

    Even with "this", the error still appears, this time after the nested view has been loaded... the nested controller is:
    public ActionResult Index(long campaignId, string containerId)
            {
                var profiles = m_profilesAPI.GetForCampaign(campaignId);
    
                var pr = new Ext.Net.MVC.PartialViewResult(containerId, RenderMode.AddTo);
                pr.ViewName = "sample";
    
                return pr;
            }
    And the partial view is:
    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamimc>" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <ext:FormPanel ID="ProfileDetails" IDMode="Predictable" runat="server" ButtonAlign="Right" AutoHeight="true"
                   Padding="5" Width="500" Border="false" Cls="transparent-panel" LabelWidth="150">
        <Items>
            <ext:DisplayField ID="ProfileId" runat="server" Text="Example" FieldLabel="Id"></ext:DisplayField>
        </Items>
        <Buttons>
            <ext:Button ID="SaveButton" runat="server" Text="Confirm" Icon="Disk">
            </ext:Button>
        </Buttons>
    </ext:FormPanel>
    This is the response from the controller:
    <script type="text/javascript">Ext.net.append(Ext.getBody(),["<div id=\"ID_ae24928824e645678622966ae5e50e2d_Content\" class=\"x-hidden\"><div id=\"ID_ae24928824e645678622966ae5e50e2d_UC_Profil eDetails_Container\">","</div></div>"].join(''));Ext.net.ResourceMgr.destroyCmp("ID_ae24 928824e645678622966ae5e50e2d");Ext.net.ResourceMgr .registerIcon(["Disk"]);new Ext.Panel({id:"ID_ae24928824e645678622966ae5e50e2d ",xtype:"panel",contentEl:"ID_ae24928824e645678622 966ae5e50e2d_Content",border:false,header:false}); new Ext.form.FormPanel({id:"ID_ae24928824e645678622966 ae5e50e2d_UC_ProfileDetails",labelWidth:150,cls:"t ransparent-panel",renderTo:"ID_ae24928824e645678622966ae5e50e 2d_UC_ProfileDetails_Container",autoHeight:true,wi dth:500,items:{id:"ID_ae24928824e645678622966ae5e5 0e2d_UC_ProfileId",xtype:"displayfield",fieldLabel :"Id",value:"Example"},border:false,buttons:[{id:"ID_ae24928824e645678622966ae5e50e2d_UC_SaveBu tton",iconCls:"icon-disk",text:"Confirm"}],padding:5,method:"POST",url:"/Profiles/?campaignId=1&containerId=ProfilesSummary"});Profi lesSummary.addAndDoLayout(ID_ae24928824e6456786229 66ae5e50e2d);</script>

    Nothing appears and I get the usual "ProfilesSummary is not defined", probably coming from the last line:
    ProfilesSummary.addAndDoLayout(ID_ae24928824e64567 8622966ae5e50e2d);

    Honestly I could not find a reason for this, since the ProfilesSummary panel is created (as in the previous response) and rendered no problem... indeed if I change to return "this.body.id" for the Panel and then use RenderMode.RenderTo rather than AddTo, everything works...
  3. #13
    Try this
    return Ext.net.ResourceMgr.ns ? (Ext.net.ResourceMgr.ns + "." + this.id) : this.id;
  4. #14
    That's weird, it does not work but the error changed... This is the JS generated by the nested panel:

    <script type="text/javascript">Ext.net.append(Ext.getBody(),["<div id=\"ID_76035c7b6ccc4fc4b1b3289a8def2a68_Content\" class=\"x-hidden\"><div id=\"ProfileDetails_Container\">","</div></div>"].join(''));Ext.net.ResourceMgr.destroyCmp("ID_7603 5c7b6ccc4fc4b1b3289a8def2a68");Ext.net.ResourceMgr .registerIcon(["Disk"]);new Ext.Panel({id:"ID_76035c7b6ccc4fc4b1b3289a8def2a68 ",xtype:"panel",contentEl:"ID_76035c7b6ccc4fc4b1b3 289a8def2a68_Content",border:false,header:false}); new Ext.Panel({id:"ProfileDetails",cls:"transparent-panel",renderTo:"ProfileDetails_Container",autoHei ght:true,width:500,items:{id:"ProfileId",xtype:"di splayfield",fieldLabel:"Id",value:"Example"},layou t:"auto",border:false,buttons:[{id:"SaveButton",iconCls:"icon-disk",text:"Confirm"}],padding:5});Calendar.ProfilesSummary.addAndDoLayout(ID_76035c7 b6ccc4fc4b1b3289a8def2a68);</script>

    So yes, it did prefix the panel with "Calendar.", but now the error I get is:
    "ID_76035c7b6ccc4fc4b1b3289a8def2a68 is not defined"

    Which makes me feel that we simply moved the namespace problem to the actual item being rendered.., Any idea?
  5. #15
    Well, i guess using global namespace with dynamic controls is not good idea because dynamic renderer doesn't now know about that namespace
    So, in you case it is better to avoid namespace using
  6. #16
    Yeah makes sense :)

    I solved the problem by just putting everything in the Global Namespace... thank for your time.
  7. #17
    We will review that problem in v2 to avoid such issues with namespace
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 7
    Last Post: Oct 21, 2014, 6:22 AM
  2. Replies: 0
    Last Post: Jun 13, 2012, 8:47 AM
  3. [CLOSED] Ext.net.DirectMethods Scope
    By dev in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 31, 2012, 10:39 AM
  4. Ext.Msg.Alert scope
    By Kheu in forum 1.x Help
    Replies: 0
    Last Post: Jul 06, 2009, 4:36 AM
  5. Restrcting a viewport within the tab scope
    By prashobkumar in forum 1.x Help
    Replies: 8
    Last Post: Dec 13, 2008, 6:45 AM

Tags for this Thread

Posting Permissions