Component Loader using MVC [Razor] error

  1. #1

    Component Loader using MVC [Razor] error

    I'm having difficulty resolving an issue with Component loader in MVC using Razor views. I'm pretty sure the problem is simply the component loader only wants to have Ext.Net components, but it's also likewise that MVC Razor views want the ResourceManager loaded - even into partial views, which the component loader will then try and render and fail.

    for example:

    Main viewport..
    X.Viewport ( )
        .Layout ( LayoutType.Border )
        .Items (
            X.Panel ( )
            //.Title("North")
            .Region ( Region.North )
            .Split ( true )
            .Height ( 111 )
            .Border ( false )
            .ItemsFromAction ( "Header_Partial" )
            ,
            X.Panel ( )
            .Title ( "West" )
            .Region ( Region.West )
            .Layout ( LayoutType.Accordion )
            .Width ( 300 )
            .MinWidth ( 300 )
            .MaxWidth ( 300 )
            .Split ( true )
            .Collapsible ( true )
            .Items (
                X.Panel ( )
                .Title ( "Navigation" )
                .Border ( false )
                .BodyPadding ( 6 )
                .Icon ( Icon.FolderGo )
                .Items (
                    X.Button ( )
                    .Text ( "tryme" )
                    .DirectEvents (
                        de =>
                        {
                            de.Click.Before = "console.log(App.SearchBrowserConfig);return(false);";
                            de.Click.Url = Url.Action ( "test" );
                        }
                    )
                )
                ,
    
                X.Panel ( )
                .Title ( "Settings" )
                .Border ( false )
                .BodyPadding ( 6 )
                .Icon ( Icon.FolderWrench )
                .Html ( "Some settings in here" )
            )
            ,
            X.TabPanel ( )
            .Region ( Region.Center )
            .ID ( "HomePageFilterResults" )
            .Listeners (
                l =>
                {
                    l.TabChange.Handler = "TabChange(oldTab,newTab)";
                }
            )
            .Items (
                panelitems =>
                {
                    foreach ( var browser in Model.HomePageResults )
                    {
                        panelitems.Add (
                            X.Panel ( )
                            .ID ( "Tab" + browser.DisplayName )
                            .Title ( browser.DisplayName )
                            .Loader ( X.ComponentLoader ( )
                                .Url ( Url.Action ( "TestComponent") )
                                .Mode ( LoadMode.Component )
                                .Params ( new
                                {
                                    browserName = browser.ObjectName
                                } )
                                .LoadMask ( lm => lm.ShowMask = true )
                            )
                        );
    
                    }
                }
            )
    //... more
        )
    )   
    }
    TestComponent
    @{
        Layout = null;
        @Html.X().ResourceManager().CleanResourceUrl(false) //<- LoadMode.Component can't render this, nor can the view work without it
        var X = Html.X();
        
    }
    @(
        X.Button()
        .Text("showmeplease")      
    )

    It would be terrific if there were an example on mvc.ext.net of a component-loaded view as a starting point for us to use. I would love to avoid the use of frames, but it seems I'm stuck with them until I can load even the simplest of partial views.
  2. #2
  3. #3
    Quote Originally Posted by Vladimir View Post

    This was exactly what I needed. I've applied the example and have the component loading via LodeMode.Script.

    Thanks Vladimir, much appreciated. You may close this thread.

Similar Threads

  1. Replies: 5
    Last Post: May 17, 2013, 4:54 PM
  2. Loader Mode="Component" Error
    By Filipe88 in forum 2.x Help
    Replies: 0
    Last Post: Feb 11, 2013, 10:21 PM
  3. [CLOSED] Question about component loader
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 22, 2013, 4:57 PM
  4. [CLOSED] reference of a control loaded by component loader
    By mirwais in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 28, 2012, 1:05 PM
  5. [CLOSED] Component Loader
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 13
    Last Post: Nov 13, 2012, 3:08 PM

Posting Permissions