Adobe Flex

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentAdobe Flex

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old May 20th, 2013, 07:00 AM
info20111 info20111 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: May 2013
Posts: 1 info20111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 11 sec
Reputation Power: 0
Problem with datagrid and a jav aservice

Hi
i Have a list recuperated from java with is composed of object(string+number) i would like to fill a datagrid with this list after a clik at a button i had tested the list recuperated from my service with alerts it return correct values but the values wich are filled in the datagrid are totaly false i dont' know how it was filled please can you help me ?
the flex code is here
Code:
protected function button2_clickHandler(event:MouseEvent):void { startDate=StartDateField.selectedDate; endDate=EndDateField.selectedDate; CountTicketsByStatusResult.addEventListener(Result  Event.RESULT,getTicketByStatus); CountTicketsByStatusResult.token = ticketServiceImpl.CountTicketsByStatus(startDate,e  ndDate); }

Code:
private function getTicketByStatus(evt:ResultEvent):void { AC=evt.result as ArrayCollection; for (var i:int=0 ; i < AC.length ; i++) { Alert.show("element"+AC.getItemAt(i)); } datagrid.dataProvider=AC; }

Code:
<s:DataGrid id="datagrid" x="312" y="225" width="242" height="178" dataProvider="{AC}"

this is my service that i have used from java
Code:
public Number countTicketByType(Date start,Date end,String type) { String query = "select count(ticket.id) from TicketEntity ticket where lower(ticket.status) ='"+type.toLowerCase()+"'"+" and ticket.dateCreation between :debut and :fin"; javax.persistence.Query q = ticketDao.getEntityManager().createQuery(query); q.setParameter("debut", start); q.setParameter("fin", end); Number countResult = (Number) q.getSingleResult(); System.out.println("Count Nbreticket " +type+" result:"+ countResult); return countResult; } @Override public List CountTicketsByStatus(Date start, Date end) { ArrayList <Object> listResultat=new ArrayList<Object>(); ArrayList <Number> ticketsByStatus= new ArrayList <Number> (); ArrayList <String> possibleStatus = new ArrayList <String> (); possibleStatus.add("Resolved"); possibleStatus.add("Closed"); possibleStatus.add("New"); possibleStatus.add("Invalid"); for(int i=0;i< possibleStatus.size();i++) { listResultat.add(possibleStatus.get(i)); Number nbre=countTicketByType(start, end, possibleStatus.get(i)); ticketsByStatus.add(nbre); listResultat.add(nbre); } return listResultat; }

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentAdobe Flex > Problem with datagrid and a jav aservice


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap