[CLOSED] Revisting Updates to Listeners and DirectEvents inside DirectEvents.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Revisting Updates to Listeners and DirectEvents inside DirectEvents.

    We talked about something related to this here: http://forums.ext.net/showthread.php...in-code-behind


    So I'm revisiting this because I'm finding a number of deficiencies how I can change/update/remove listeners in a DirectEvent using server-side code.

    We addressed remove, sorta. I still think you should review my suggestions at the end of that thread. I see no reason why ext.net maintains such a rich set of enumerators of events for each control if we can't refer to them directly to construct the javascript for us. Example. Button1.Listeners.Click.Remove(); Instead, presently, to remove a listener, I have to call X.AddScript( Button1.ClientID + ".removeListener( '" + listenername + "');"; This goes for all listener commands including suspend, resume, on, etc. This goes for the DirectEvent events too. Everywhere else inside Ext.net, you do a great job of resolving property setting controls between initialization and DirectEvent javascript construction commands. You did add RemoveDirectListener, but again, we need to reference by name the eventname. It's not a part of the Event Enumeration of DirectEvents.

    Then we come to add. The only way to add a listener in a DirectEvent is using On, which is back to naming the event. I guess this allows us to attach more than one event to a single listener name. This will at least allow us to add a listener during a DirectEvent at least. But how do we add a DirectEvent in a DirectEvent?

    Then there's update. Not even present or possible in a DirectEvent.

    I have a case where I have a button with a listener in the presentation layer with a handler which contains a format string, example: Handler="document.location='{0}'; I do a lot of format or replaces of the {0} with urls that have to be constructed. This works great as long as I update it in the initial Page_Load lifecycle. But I have a case where I can't do that till the DirectEvent. I guess one could argue it's probably unwise to set up a format string that is being rendered to the initialized listener; perhaps it would be better to do an Add later. But in this case, my button is disabled or hidden so no risk of being clicked. Let me argue my case further, let's say I want to prepend or append javascript the existing handler in the DirectEvent without changing what's already present? I do this at times. At this point, the only way to do this is remove the listener then add.

    So I'm asking for a fuller library of add/replace/update/delete/suspend/resume/etc set of functions on the serverside for the base of ComponentListener and ComponentDirectEvent that are able to create javascript for the client in a DirectEvent in the same way I can edit other properties of a control in a DirectEvent. Also each should support Clear or RemoveAll.

    These should match the set of commands found as methods available for listeners here: http://docs.sencha.com/extjs/4.2.1/#...til.Observable and matched to support equivalently to directevents.
    Last edited by Daniil; Jan 13, 2014 at 5:34 AM. Reason: [CLOSED]

Similar Threads

  1. [CLOSED] ClientID inside DirectEvents
    By krzak in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 01, 2011, 10:32 AM
  2. Replies: 1
    Last Post: Aug 21, 2010, 9:49 AM
  3. Dynamic DirectEvents
    By Dominik in forum 1.x Help
    Replies: 3
    Last Post: Jul 30, 2010, 12:58 PM
  4. DirectEvents are not available at all for any control
    By lordofthexings in forum 1.x Help
    Replies: 3
    Last Post: May 19, 2010, 4:47 PM
  5. [CLOSED] DirectEvents inside a window
    By sharif in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 15, 2010, 11:16 AM

Tags for this Thread

Posting Permissions