how to pop-up a new window from direct event handler

  1. #1

    how to pop-up a new window from direct event handler

    I think that it is another client-side vs server side issue, but I could't work out.

    Almost all the EXT.net examples with direct event create the new window (or panel/viewport) in ASP.net Page_Load() function, some use the client-side event to display the window.

    I tried to do things like this in a direct event handler (Button_Click is a direct event handler to a button click):

    <script runat="server">
        protected void Button_Click(object sender, DirectEventArgs e)
        {
            Window win = new Window();
            win.Show(); 
        }
    </script>
    I noticed also that the examples put always a "placeholder" at the end, which is an asp.net server control. But even if I put that, nothing happens.

    I have two questions:

    1. Is it possible to launch a custom window from direct event handler?
    2. If on this custom window, there are other custom components or buttons, in which way I can write the direct event handler for those buttons, or manipulate those components ?

    Many thanks again!
  2. #2
    I figured out that I should also call .Update() in order to show the newed window as follows.

    But another problem raised: after the .Update(), I can't change the property of this window, even if I call "Update" again:

    <script runat="server">
        protected void Button_Click(object sender, DirectEventArgs e)
        {
            Window win = new Window();
            win.Title = "title1";
            win.Show(); 
            win.Update();
            win.Title = "title2";
            win.Update(); // this does not change the title of the window.
        }
    </script>
  3. #3
    The following sample should help, see

    https://examples1.ext.net/#/XRender/Basic/New_Window/

    You just call .Render() once you're finished configuring the component.

    Hope this helps.
    Geoffrey McGill
    Founder
  4. #4
    Cool! Many thanks again Geoffrey! I did not notice that example at the bottom.

    It is a bit difficult to grasp the things without a step-by-step guidance. It would be a great boost for beginners along with the rising popularity of ASP.net.

Similar Threads

  1. Desktop Window gridpanel direct event not firing
    By Karun Javvadi in forum 2.x Help
    Replies: 0
    Last Post: Jul 31, 2012, 12:16 PM
  2. Replies: 5
    Last Post: Jun 25, 2012, 6:19 PM
  3. [CLOSED] Event handler before direct event handlers
    By matejgolob in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 08, 2012, 2:31 PM
  4. Set Handler Event on code-behind for Window
    By maurox in forum 1.x Help
    Replies: 0
    Last Post: Apr 18, 2012, 1:55 PM
  5. [CLOSED] Desktop Window | Show Handler | Stop Event
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jul 20, 2010, 10:32 PM

Posting Permissions