1. #1
    Sencha User
    Join Date
    Jul 2008
    Posts
    15
    Vote Rating
    0
    randymay is on a distinguished road

      0  

    Default Fire GXT Event from within ExtJS

    Fire GXT Event from within ExtJS


    I am implementing a Dashboard using the Portal and Portlet classes in GXT. The content of the Portlets are currently coded in ExtJS, and are appended to the Portlet by using the setInnerHtml() method.

    The challenge I am having is that I have created an Event Listener in the GXT code, and I would like to initiate it from inside the Portlet (which is ExtJS code). I set the ID of the Portlet, but when I use Ext.getCmp(), the result is undefined.

    How can I initiate a GXT event from within ExtJS code?

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Ext.getCmp will only find ExtJS components.

    You need to make a bridge between yuor java code and the javascript code. You can do this with JSNI.

  3. #3
    Sencha User
    Join Date
    Jul 2008
    Posts
    15
    Vote Rating
    0
    randymay is on a distinguished road

      0  

    Default


    Thanks! That works beautifully.

  4. #4
    Ext GWT Premium Member
    Join Date
    Mar 2009
    Posts
    226
    Vote Rating
    3
    The_Jackal is on a distinguished road

      0  

    Default


    What was you solution randymay?

  5. #5
    Sencha User
    Join Date
    Jul 2008
    Posts
    15
    Vote Rating
    0
    randymay is on a distinguished road

      0  

    Default


    In my GXT Controller, I have the following code:

    Code:
    public native void nativeRefreshPortlet() /*-{
    		var foo = this;
    		$wnd.nativeRefreshPortlet = function(portletId, url) {
    		    foo.@packageName.PortalController::refreshPortlet(Ljava/lang/String;Ljava/lang/String;)
    		    	(portletId, url);
    		};
    }-*/;
    This creates a function in JavaScript that I can call using this code in my page:

    Code:
    nativeRefreshPortlet(portletId, url);

Similar Threads

  1. [CLOSED] GXT 1.1.2: DateField does not fire Change Event
    By firejack in forum Ext GWT: Bugs (1.x)
    Replies: 5
    Last Post: 23 Aug 2011, 3:38 AM
  2. How to fire the selection change event(GXT 2.0.1)
    By blade5 in forum Ext GWT: Discussion
    Replies: 1
    Last Post: 18 Nov 2009, 1:06 PM
  3. [GXT 2.0 M2] SliderField doesen't fire a Change Event
    By Chayton in forum Ext GWT: Bugs (2.x)
    Replies: 0
    Last Post: 28 May 2009, 7:42 AM
  4. [fix/bug] ComboBox select event should fire change event also
    By andrei.neculau in forum Community Discussion
    Replies: 1
    Last Post: 22 Sep 2007, 2:57 PM

Thread Participants: 2

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar