[CLOSED] Ext.Net.X.GetCmp - how to call in parent?

  1. #1

    [CLOSED] Ext.Net.X.GetCmp - how to call in parent?

    Hey,

    Im trying to get a reference to a ComboBox that exists in another Page, ie the Parent page.

    I want to do something like this:


    // ci = ClientId sent in by Parent page at some point
    Ext.Net.ComboBox cb = (Ext.Net.ComboBox)Ext.Net.X.GetCmp(ci);
    cb.SetValueAndFireSelect(oa.Data.Id);
    But since I am at the wrong page, I cannot find the ComboBox. How can I call this for the parent page?
    Last edited by Daniil; May 02, 2011 at 10:27 AM. Reason: [CLOSED]
  2. #2
    Hi,

    It is impossible, ASP.NET page cannot get controls from another page
  3. #3
    Mm, I suspected that.

    So Im trying something like this from the child page:

    // ...
    string ci = (string)Session["clientId"];
    string s = "parent.Ext.getCmp('" + ci + "').setValue('" + oa.Data.Id + "')";
    X.Js.Call(s);
    // ...
    That works, the Control is assigned the value.

    Then I wanted to fire an event for the same control, but that doesnt work:

    s = "parent.Ext.getCmp('" + ci + "').fireEvent('select')";
    X.Js.Call(s);
    I know its too little info to answer any errors in my code, but the general idea should work??
  4. #4
    Quote Originally Posted by wagger View Post
    Then I wanted to fire an event for the same control, but that doesnt work:

    s = "parent.Ext.getCmp('" + ci + "').fireEvent('select')";
    X.Js.Call(s);
    I know its too little info to answer any errors in my code, but the general idea should work??
    It should work. Please clarify how exactly does not it work? Any error, exception?
  5. #5
    Hi,

    Please try 'X.Js.AddScript' instead 'X.Js.Call'

Similar Threads

  1. Replies: 6
    Last Post: Feb 15, 2012, 4:15 PM
  2. Replies: 1
    Last Post: Nov 12, 2011, 5:41 PM
  3. [CLOSED] call parent js function from client window
    By majestic in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Oct 29, 2010, 9:21 AM
  4. [CLOSED] Child page to parent page call
    By majestic in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 05, 2010, 5:41 PM
  5. [CLOSED] Finding a menu with Ext.getCmp()
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Jun 22, 2009, 3:40 AM

Tags for this Thread

Posting Permissions