[CLOSED] question about the #{} notation in Handler

  1. #1

    [CLOSED] question about the #{} notation in Handler

    Hi,

    I have a MVC3 project using Razor ViewEngine. I am under the impression that #{Draw1} the a Handler like this

    listeners.Click.Handler = "#{Draw1}.surface.getGroup('circles')
    should turn into Javascript like this

    App.Draw1.surface.getGroup('circles')
    However, it is actually turn into the following js

    Ext.get("Draw1").surface.getGroup('circles')
    and surface is an undefined property. Thus, js throws an exception " Cannot call method 'getGroup' of undefined"
    Last edited by Daniil; May 04, 2012 at 9:49 PM. Reason: [CLOSED]
  2. #2
    Hi,

    #{} searches a control with specified server ID and replace it with its ClientID.

    But there are no controls in Razor, so, nothing to search.

    But, fortunately, #{} is not required in Razor, because there is no any INamingContainer and you can use just
    Namespace.componentID
    to refer a component.

    The default Namespace is "App".

Similar Threads

  1. [CLOSED] Fn vs Handler (when to use Fn and Handler)
    By hgouw in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 21, 2011, 1:39 AM
  2. [CLOSED] GridCommand Add Handler ?
    By sisa in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 11, 2011, 12:16 PM
  3. [CLOSED] [1.0] Add handler during DirectEvent
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 22, 2010, 2:02 PM
  4. [CLOSED] CommitFailed Handler in V 1.0
    By egodoy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 02, 2010, 1:08 PM
  5. [CLOSED] Handler on RadioButton
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 08, 2009, 10:45 AM

Posting Permissions