[CLOSED] #{ControlID} resolution not working correctly in MVC Web Forms mode (?)

  1. #1

    [CLOSED] #{ControlID} resolution not working correctly in MVC Web Forms mode (?)

    Hi,

    I am starting the migration of our project from Ext.Net 1.7 to Ext.Net 2.0, but experienced a strange issue regarding the #{ControlID} resolution. In fact, the reference is translated into "Ext.get(ControlID)" instead of "ControlID" or "Ext.getCmp(ControlID)". This behavior is incorrect since it leads to javascript issues.

    Looking at Ext.Net sources I've seen that strangely, the "IsMVC" property of the MvcResourceManager looks "false"... but the project is actually a WebForms MVC 3.0, created using the Visual Studio 2012 Wizard, and adding Ext.Net through NuGet.

    Sample project (VS 2012):
    https://dl.dropboxusercontent.com/u/...plication1.zip

    If you look at the attached sample project you can replicate the behavior:
    1) Copy and refresh the NuGet packages locally
    2) Compile and go to "http://<appBaseUrl>/Home/About" I change this page with a BorderLayout taking your sample code.
    3) After page rendered, try pressing the mapped keys, you get the following error:
    Uncaught TypeError: Object [object Object] has no method 'toggleCollapse'

    It looks like a bug, but it could be also my fault. Could you please help on the same?
    Thank you!
    Last edited by Daniil; Apr 30, 2013 at 4:14 AM. Reason: [CLOSED]
  2. #2
    Hi @adrianot,

    A MvcResourceManager is used under the Razor View Engine only. So, I am not sure how you have access to it. Could you clarify/demonstrate?

    Regarding #{} resolving. Is the resolved control on the same view where you used #{}?
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @adrianot,

    A MvcResourceManager is used under the Razor View Engine only. So, I am not sure how you have access to it. Could you clarify/demonstrate?

    Regarding #{} resolving. Is the resolved control on the same view where you used #{}?
    Hi Daniil, well, yes the resolved control is on the same view, please look at the attached project (dropbox link I already attached). The code is identical to one of your samples located under:
    https://examples2.ext.net/#/Keys/Key...egions_Toggle/

    On your sample page, it works, while on a new MVC web-forms project, getting components from NuGet it's not).
    Well, we noticed the issue on the <KeyMap> element.

    On the example, the viewport is firstly defined:


    <ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
            <Items>
                <ext:Panel 
                    ID="North" 
                    runat="server" 
                    Title="North" 
                    Region="North" 
                    Frame="true" 
                    Height="200" 
                    Collapsible="true" 
                    />
    ... then after the ViewPort, the <KeyBinding> handler is specified. The same is found on our sample App under "Home/About" view, but there it's not working.

    <ext:KeyMap ID="KeyMap1" runat="server" Target="={Ext.isGecko ? Ext.getDoc() : Ext.getBody()}">        
            <Binding>
                <ext:KeyBinding Handler="#{North}.toggleCollapse();">
                    <Keys>
                        <ext:Key Code="N" />
                    </Keys>
                </ext:KeyBinding>
    ...

    Thank you for help sorting this out.
    Last edited by Daniil; Apr 22, 2013 at 12:30 PM. Reason: Please use [CODE] tags
  4. #4
    I think it is a bug within the v2.1 release.

    It has been fixed in v2.2. The NuGet package was updated in a few days ago. You can update.

    If you don't want to update, please do not use #{}, but use references like "App.North", etc.
  5. #5
    Quote Originally Posted by Daniil View Post
    I think it is a bug within the v2.1 release.

    It has been fixed in v2.2. The NuGet package was updated in a few days ago. You can update.

    If you don't want to update, please do not use #{}, but use references like "App.North", etc.
    Hi Daniil, thank you for your quick reply.

    It looks like NuGet package, the one I downloaded Friday, it's already the version 2.2.0. Is it possible that this version is still not including this fix?

    Thanks.
  6. #6
    I think you have to install the Ext.Net.MVC package.
    https://nuget.org/packages/Ext.NET.MVC/

    The common package doesn't know how to resolve #{} under MVC.
  7. #7
    Quote Originally Posted by Daniil View Post
    I think you have to install the Ext.Net.MVC package.
    https://nuget.org/packages/Ext.NET.MVC/

    The common package doesn't know how to resolve #{} under MVC.
    Hi Daniil,
    I tried both with the Ext.Net 2.2.0 official NuGet package as well as Ext.Net MVC 2.2.0 package (published April, 20th).

    However, nothing changes. The behavior still looks the same.
    Hope you can take a look at the attached project, just expand and run you'll see this behavior.

    Thanks!
  8. #8
    I had to apply something changes to get your test project runnable. Though, finally, it indeed reproduces the problem. We are investigating. Thanks for the test case.
  9. #9
    It has been fixed in SVN. The NuGet package will be updated with the next release.

Similar Threads

  1. [CLOSED] Form Validation not working correctly
    By wisdomchuck in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 04, 2013, 8:30 AM
  2. [CLOSED] Forms authentication RedirectFromLoginPage not working
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jun 05, 2012, 1:25 PM
  3. [CLOSED] AutoExpandColumn is not working on low resolution
    By yobnet in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 25, 2010, 10:47 AM
  4. Replies: 4
    Last Post: May 07, 2009, 11:44 PM
  5. Get ControlID from external Javacript file
    By Washburn in forum 1.x Help
    Replies: 2
    Last Post: Apr 20, 2009, 10:04 AM

Posting Permissions