1. #1
    Sencha Premium Member
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    286
    Vote Rating
    48
    Ekambos is a jewel in the rough Ekambos is a jewel in the rough Ekambos is a jewel in the rough

      0  

    Default GXT client side file generation + Integration with Adobe Flex

    GXT client side file generation + Integration with Adobe Flex


    Hello community,
    sometimes ago i started the project located at http://code.google.com/p/gwt4air/
    wich goal was tu bring Java and AIR together so one can easely export his GWT(GXT) application to the desktop without rewriting any code. On top of that the project added support for PDF and Excel generation. Now with gwt4air 2.1 coming out soon I m glad to announce a way to add client side file generation on your GWT (GXT) apps(note that Flash Player version 9 or above is required).

    I create a GWT widget wich you can include into your GXT application and interact with to access the file generation libraries inside gwt4air. The API will be something like this.
    Code:
    ContentPanel cp = new ContentPanel();
    cp.setHeaderVisible(true);
    cp.setHeading("Reports");
    cp.add(Exporter.get(100, 100, new ExporterInitializationHandler() {
      @Override
      public void onInitialization() {
        Exporter.getExportButton().setLabel("Export PDF");
        Exporter.getExportButton().setHeight(40);
       Exporter.addClickHandler(new FlashEventListener<Event>() {
    		@Override
    		protected void onFlashEvent(Event event) {
    		  PDF pdf =PDF.newInstance();
                      pdf.addPage();
    	          pdf.setTextStyle(RGBColor.newInstance(0x006400));
    	         pdf.writeText(15, "Export  Preview");
    
                       FileReference fr = FileReference.newInstance();
    	           fr.save(pdf.save(), "GXT.PDF");
    
       }
    });
    
    }
    }));
    
    cp.add(ChartWidget.newInstance());
    panel_.jpg


    If you even want to combine your GWXT project with the Adobe FLEX framework, you know that this is not straigthforward.
    Now leaveraging a simpe java API you will be able to bring GXT and Flex together
    Code:
    Flex.init(new FlexInitializationHandler() {
       @Override
        public void onInitialization() {
            Application.get().setStyle("backgroundColor", "#268CE1");
    	Panel panel = Panel.newInstance("EXT-GWT and Adobe FLEX");
    	IFrame iframe = Frame.newInstance("http://www.sencha.com/examples/#overview");
    	
             panel.addElement(iframe);
    
             ControlBar controlBar = ControlBar.newInstance();
    	  controlBar.addElement(Button.newInstance("Reload"));
    	  panel.addElement(controlBar);
              
               Application.get().addElement(panel);
    
    			}
    });

    I hope you guyz will like this.

    Regards,

    Alain
    Attached Images

Similar Threads

  1. Load file and edit it on client side
    By GXTDebutant in forum Ext GWT: Discussion
    Replies: 4
    Last Post: 17 Nov 2010, 6:01 AM
  2. any tutorial with extjs and adobe flex air
    By chesterx in forum Ext.air for Adobe AIR
    Replies: 0
    Last Post: 5 Jul 2009, 3:35 AM
  3. Replies: 2
    Last Post: 30 May 2008, 4:30 AM
  4. load javascript file dynamically from client side
    By topcoder1 in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 13 Aug 2007, 11:33 AM

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