User control and desktop windows

  1. #1

    User control and desktop windows

    In a desktop application, I have to open many windows with some times the same content.
    For example, I need to open two document properties window on same time for two different documents.
    To deal with this, I investigated to use a UserControl.
    I set up a specific ID for each UC (UC1 and UC2 for example).
    I arrive to display my 2 desktop windows with the same UC (UC1 and UC2).


    My questions are :
    1 - Even setting up CloseAction to Destroy, I have some ghost div corresponding to the window just destroyed in the dom of the page
    So even destroying the window, I can't use the same UC Id (some js errors occurs)


    2 - How to deal with direct method :
    Must I call them with a prefix like this :
    App.direct.AnyUniqueID.MyMethod() //in my case, the uniqueId are UC1, UC2, ...

    How to know the name of the directmethod :
    For example, I'm in the UC1 and I have a button UC1_Button1 with a click Handler="getInfo()";
    getInfo is a js method that calls a directMethod : how to know the name of the directmethod :
    - App.direct.UC1.GetInfo() or
    - App.direct.UC2.GetInfo()
    Maybe I have to pass the ID of the UC to the getInfo method ?


    Maybe an other solution is to use DirectMethod with WebService like this :
    
    var jsonService = function (name, UCId) {
                Ext.net.DirectMethod.request({
                    url          : "JsonService.asmx/SayHello",
                    cleanRequest : true,
                    json         : true,
                    params       : {
                        name : name
                    },
                    success : function (result) {
              // Setting the local variable
                      Eval('myLocalVar' + UCId) = result;
              Ext.Msg.alert("Json Message", result);
                    }
                });
    In this case, i use only one DirectMethod for all the windows opened.
    But I have to deal with local variables (specific of each window context) as it explains in the previous success method.


    The previous jsonservice is as quickly as a static directmethod ?


    What can you advise me ?


    Thank you.
  2. #2

Similar Threads

  1. Replies: 6
    Last Post: May 30, 2013, 5:49 AM
  2. Replies: 1
    Last Post: Jan 28, 2013, 5:26 AM
  3. Replies: 5
    Last Post: Jan 19, 2011, 3:17 PM
  4. [CLOSED] Desktop BUG: Modal windows can be minimized and you can interact with the other windows
    By juanpablo.belli@huddle.com.ar in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 31, 2009, 2:49 PM
  5. Replies: 1
    Last Post: Mar 17, 2009, 1:17 AM

Tags for this Thread

Posting Permissions