The flex of the foreground handles the Java return list type

Source: Internet
Author: User

The Backstage Java program returns a list type and the foreground's flex reads it, what about this?

Returns the Java code for the list

1 package com.duduli.li;
2
3 import java.util.ArrayList;
4  import java.util.Date;
5 import java.util.List;
6
7 public class  Testlist {
8     @SuppressWarnings("unchecked")
9      public List returnList(){
10
11         Perl p = new Perl ();
12         p.setId(1);
13         p.setName ("tom");
14         p.setDate(new Date());
15
16          Perl p2 = new Perl();
17         p2.setId(2);
18         p2.setName("john");
19          p2.setDate(new Date());
20
21         Perl p3 = new Perl();
22         p3.setId(3);
23         p3.setName ("cate");
24         p3.setDate(new Date());
25
26          List<Perl> list = new ArrayList();
27          list.add(p);
28         list.add(p2);
29          list.add(p3);
30
31         return list;
32     }

Register well in Remoting-config.xml.

1     <destination id="returnlist">
2          <properties>
3              <source>com.duduli.li.Testlist</source>
4          </properties>
5     </destination>

The flex in the foreground is displayed in a DataGrid.

Use RemoteObject to invoke the registered destination.

<mx:RemoteObject  id="rl" destination="returnlist" result="resultHandler (event)"/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.