[flexcoders] Re: AIR 1.5.3 application build problem on Linux

2009-12-15 Thread jason_williams_mm
Can you please log a bug for this issue using www.adobe.com/wish.  Please 
include the information here and include the specifics of the OS, window 
manager, version, etc.

Thanks
jw

--- In flexcoders@yahoogroups.com, "aejaz_98"  wrote:
>
> 
> 
> 
> 
> Looks like it is not possible to build a windows air installer
> on Linux with SDK 3.4(with either SDK 1.5.2 or 1.5.3) although
> this worked fine with Flex SDK 3.4(with included AIR SDK 1.5)
> earlier.
> 
> Strangely when I now try to switch back to Flex SDK 3.3, I am 
> getting these errors,
> 
> App_mx_managers_SystemManager.as(75): col: 38 Error: Method marked override 
> must override another method.
> [mxmlc] 
> [mxmlc] override public function get preloadedRSLs():Dictionary
> [mxmlc]  ^
> [mxmlc] 
> [mxmlc] _App_mx_managers_SystemManager.as(87): col: 34 Error: Method 
> marked override must override another method.
> [mxmlc] 
> [mxmlc] override public function allowDomain(... domains):void
> [mxmlc]  ^
> [mxmlc] 
> [mxmlc] _App_mx_managers_SystemManager.as(105): col: 34 Error: Method 
> marked override must override another method.
> [mxmlc] 
> [mxmlc] override public function allowInsecureDomain(... 
> domains):void
> [mxmlc]  ^
> [mxmlc] 
> 
> Any help would be appreciated.
> 
> Thanks,
> Aejaz
> 
> --- In flexcoders@yahoogroups.com, "aejaz_98"  wrote:
> >
> > Hi,
> > 
> > I have a build environment set on RHEL Linux which uses
> > ant to produce a .air installer for my application. With
> > Flex SDK 3.3 & ant the .air installer used to install
> > the application successfully on Windows XP/Vista & application
> > worked as expected.
> > 
> > Recently I upgraded to Flex 3.4 SDK on the Linux build machine,
> > but now the AIR application installed (on Windows XP) with 
> > the ant generated .air installer(on the Linux build machine) doesn't show 
> > the startup screen, although in the task manager I see that the process is 
> > alive.
> > 
> > In order to figure out what was wrong I did quite a bit of
> > searching but couldn't find anything worthwhile. Then I 
> > tried the same build script on Windows XP using Flex 3.4
> > SDK & the generated application(after installation) worked 
> > successfully. The only difference between Linux & windows
> > was that Windows XP had AIR runtime whereas Linux did not.
> > Since things worked with SDK 3.3 with no AIR runtime on Linux,
> > I doubt that this is an issue. 
> > 
> > So far both Linux & Windows had AIR SDK 1.5.2, I then upgraded
> > both to AIR SDK 1.5.3 but there was no change in behaviour
> > i.e. installer produced in Windows worked but installer 
> > created on Linux didn't.
> > 
> > Finally, I tried using adl as follows. The installed application
> > (using the .air installer created on Windows) had following 
> > directory structure,
> > 
> > C:\App
> > C:\App\App.swf
> > C:\App\META-INF\AIR\application.xml
> > C:\App\META-INF\AIR\publisherid
> > C:\App\META-INF\AIR\hash
> > 
> > I copied all the files under META-INF to C:\App & then tried
> > to run the following, command,
> > 
> > C:\App> adl application.xml
> > 
> > That showed the startup screen.
> > 
> > Then I uninstalled the application & installed the application
> > using the .air installer created on Linux & then copied the 
> > contents under META-INF to c:\App & tried the same command again,
> > this time the startup screen didn't show up but on the command 
> > prompt, following error was shown,
> > 
> > VerifyError: Error #1014: Class mx.core::WindowedApplication could not be 
> > found.
> > at flash.display::MovieClip/nextFrame()
> > at mx.managers::SystemManager/deferredNextFrame()
> > at mx.managers::SystemManager/preloader_initProgressHandler()
> > at flash.events::EventDispatcher/dispatchEventFunction()
> > at flash.events::EventDispatcher/dispatchEvent()
> > at mx.preloaders::Preloader/timerHandler()
> > at flash.utils::Timer/_timerDispatch()
> > at flash.utils::Timer/tick()
> > 
> > I don't have any idea about why the WindowedApplication won't
> > be found in this particular case. If anyone has any clue, 
> > please help.
> > 
> > Thanks,
> > Aejaz
> >
>




[flexcoders] Re: Problems with Julian Dates with AIR percision?

2009-07-04 Thread jason_williams_mm
Hi Charlie,
Can you post an example of the code that you are using? It would help to see an 
example table definition along with the AS code you are using.

Thanks,
jw


--- In flexcoders@yahoogroups.com, Charlie Hubbard  wrote:
>
> I'm writing some unit tests for my database, and I'm having a real problem
> with Julian date comparisons in the SQLite database.  I'm trying to load
> records by the following query:
> 
> select * from Table where created_at > ?
> 
> If my given Date is less than stored dates by 100ms SQLite fails to hand
> them back.  I've taken the times stored in SQLite and put them into
> coversion programs to convert them to unix epoch longs, and millisecond
> percision is stored in the number.  SQLIte does have percision down to the
> millisecond, but when I do a sql query they fail to compare correctly.  I've
> also confirmed that I do get back the milliseconds correctly stored in the
> actionscript's Date object.  Has anyone else had trouble like this?  Should
> I just store them as unix epoch integers rather than SQLite's Julian?  These
> timestamps are important and I want them to be as precise as possible so
> while I could chalk it up to only have second precision that increases the
> likelyhood of mistakes if operations occur within that second.
> 
> Charlie
>




[flexcoders] Re: AIR app crashes and burns on Mac

2009-05-12 Thread jason_williams_mm
Can you please log a bug with your test case attached at:

http://www.adobe.com/go/wish

Thanks,
jw


--- In flexcoders@yahoogroups.com, "jer_ela"  wrote:
>
> adl, the development runtime for AIR is crashing on me.  This seems to be 
> related to using SQL lite.  It had been crashing at one place in the code 
> intemittently, then was stable for a while.  Now it is crashing consistantly 
> at another place in the code.  Changing the sdk from 3.2 to 3.3 didn;t have 
> any effect.
> 
> Has anyone else had this problem and know of a cure? This has me dead in the 
> water.
> 
> Here is the top part of the dump info
> 
> Process: adl [211]
> Path:/Applications/Adobe Flex Builder 3 Plug-in/sdks/3.3/bin/adl
> Identifier:  adl
> Version: ??? (???)
> Code Type:   X86 (Native)
> Parent Process:  eclipse [189]
> 
> Date/Time:   2009-05-12 14:52:20.669 -0400
> OS Version:  Mac OS X 10.5.6 (9G55)
> Report Version:  6
> 
> Exception Type:  EXC_BAD_ACCESS (SIGBUS)
> Exception Codes: KERN_PROTECTION_FAILURE at 0x000c
> Crashed Thread:  0
>




[flexcoders] Re: AIR SQLite:Does anyone have this issue with DB connected asynchronously?

2009-03-31 Thread jason_williams_mm
Have you logged a bug?  Intermittent issues are very hard to track down.  What 
platform are you using (windows, OS X, Linux)? What version of the runtime?

Thanks,
jw


--- In flexcoders@yahoogroups.com, "handitan"  wrote:
>
> Hi all,
> 
> I posted this question quite a while ago but I just want to bump this thread 
> up to see if anyone has any idea of the issue that I am facing.
> Please read below.
> 
> Thx!
> 
> --- In flexcoders@yahoogroups.com, "handitan"  wrote:
> >
> > Hi all,
> > 
> > Before I present the issue, I am listing my FB and SDK versions:
> > - FlexBuilder 3.0.2
> > - AIR SDK 1.5
> > - Flex SDK 3.3 milestone build.
> > All the latest good stuffs.
> > 
> > Now, I have an issue with DB that's connected asynchronously doesn't ALWAYS 
> > firing SQLEvent.RESULT or SQLErrorEVENT.ERROR whenever a SQL statement is 
> > executed.
> > 
> > For example:
> > I got a login screen with login textInput, password textInput, and login 
> > button. When the login button is clicked, it does a query to check whether 
> > the login and password exist in the DB.
> > And events will be fired accordingly if it's a success or not.
> > 
> > HOWEVER, the events don't always fired! Sometimes it fires but sometimes 
> > it's not. It's happening intermittently.
> > 
> > Does anyone else have this issue??
> > 
> > Btw, I don't have this issue at all when I have my DB opened synchronously. 
> > Unfortunately, working with it has some big challenges as well. So if I can 
> > get the DB-async to work properly, it will save a lot of time.
> > 
> > Thx!
> >
>




[flexcoders] Re: Custom functions in SQLite using AIR

2009-02-20 Thread jason_williams_mm
There is no way to do this currently, but, a *great* feature request.
 Please visit www.adobe.com/go/wish and make the request.

jw

--- In flexcoders@yahoogroups.com, "fan...@..."  wrote:
>
> Hello, 
> 
> Is there a way to define custom aggregation functions in SQLite using
> AIR?  
> 
> From the documentation, I noticed that AIR supports SUM, MIN, MAX,
> AVG, COUNT, and TOTAL:
> http://www.adobe.com/go/learn_air_aslr_en?localDatabaseSQLSupport.html
> 
> SQLite lets you define your own functions in C:
> http://www.sqlite.org/c3ref/create_function.html
> 
> Thanks, 
> 
> -george
>




[flexcoders] Re: Database connection from AIR application

2008-12-22 Thread jason_williams_mm
Kotha,
Can you elaborate on your use case a little? If you are not interested
in accessing server side logic, why are you wanting to get data from
outside of the runtime (there is an embedded SQL database in the runtime)?

jw

--- In flexcoders@yahoogroups.com, kotha poornima 
wrote:
>
> Hi Fidel,
> First of all Thanks for the reply.
> And i need to clarify one more thing from you:
> If we are going to write any server-side code like java or
coldfusion then we have to deploy in Tomcat or Weblogic Servers
right!!! Then how we can say the application as Desktop application
rather than a webapplication.
> 
> 
> 
> 
> 
> From: Fidel Viegas 
> To: flexcoders@yahoogroups.com
> Sent: Thursday, December 18, 2008 1:00:09 PM
> Subject: Re: [flexcoders] Database connection from AIR application
> 
> 
> On Thu, Dec 18, 2008 at 7:59 AM, kotha poornima  wrote:
> > Hi all,
> > I am going to create a AIR Desktop application. Am i able to
connect to the
> > database such as SQL Server or MYSQL from AIR to retrieve data.
Can anyone
> > give me an idea how can i do this task or send me any websites
regarding the
> > same.
> 
> No, you need to write server-side code in java, php, ruby, .net,
> etc..., or your can use a "gateway" such as merapi.
> 
> All the best,
> 
> Fidel.
>




[flexcoders] Re: AIR SQLLite, ints, and NULLs

2008-11-23 Thread jason_williams_mm
--- In flexcoders@yahoogroups.com, "Charlie Hubbard"
<[EMAIL PROTECTED]> wrote:
>
> I've read over all of the docs on Air, but there seems to be a missing
> discussion around NULL values in SQLLite and how those map back to
> datatypes.  What I've found is that if I have an int field type I
can't get
> a NULL value to ever get inserted into the SQLLite.  It just ends up
> inserting 0 (zero).  In Java we'd just convert to using a true
Object like
> Integer class, and that would handle this problem for us.  What is the
> equivalent with Actionscript?  If you want NULLs and numbers what is an
> object and a number, and will Air convert between the two correctly?
> 
> Thanks
> Charlie
>

It would help to see the code that you are using, however, the
following code gives the same results in both 1.5 and 1.1:



http://www.adobe.com/2006/mxml";
layout="absolute" creationComplete="run()">





-- trace output --

(Array)#0
  [0] (Object)#1
id = (null)
  [1] (Object)#2
id = 1
  [2] (Object)#3
id = 2
  [3] (Object)#4
id = 3

Each of the values returned in the object is a Number.  Hope that
helps some.

jw



[flexcoders] Re: sqlite insert issue

2008-11-03 Thread jason_williams_mm
--- In flexcoders@yahoogroups.com, "Johannes Nel" <[EMAIL PROTECTED]> 

The confusion here is due to the affinities that you have selected.
When the AIR embedded db cannot find the affinity specified it
defaults to NUMERIC.  There is no affinity called "timestamp" (or
"bigint" for that matter) and you are left with a NUMERIC affinity. 
In this case the string value of "2008-08..." is being inserted into a
field in which a NUMERIC value is expected.  The embedded db in the
AIR runtime makes an attempt to convert that string into the desired
value, however, a conversion isn't possible, and the result is the
error you see.  Why does this work in SQLite? In the SQLite db
affinities are not enforced, so when the attempt to convert fails the
string value is inserted as is.

If you change the affinity specified here to DATE you will get what
you expect, and additionally, when you select the value back out you
will get an AS3 Date object. 

jw

wrote:
>
> Hi All
> I have a sql statement which runs sans any issues in my sqlite
viewer, but
> when executed from within air it gives me the error
> SQLError: 'Error #3132: Data type mismatch.', details:'could not convert
> text value to numeric value.'
> this is the table schema
> CREATE TABLE category (
> id bigint NOT NULL,
> "version" integer NOT NULL,
> name character varying(255),
> ordering integer NOT NULL,
> "external" boolean NOT NULL,
> createddate timestamp without time zone,
> modifieddate timestamp without time zone,
> createdby_id bigint,
> modifiedby_id bigint
> );
> and here is the sql statement
> insert into category(id, version, name, ordering, external, createddate,
> modifieddate, createdby_id, modifiedby_id) values
> (477,14,'Leads',0,'false',NULL,'2008-08-19 16:46:54.26',NULL,1109);
> 
> any ideas?
> i find it really weird that this works on a SQLite level, but not
from AS.
> 
> johan
> 
> 
> -- 
> j:pn
> \\no comment
>




[flexcoders] Re: AIR Persistance mechanisims?

2008-05-14 Thread jason_williams_mm
You can skip the step of sending this to a ByteArray and
Base64Encoding it, by using the additional affinities added for AIR
applications.  For example, using the following create statement:

CREATE TABLE vo (objID String UNIQUE NOT NULL, objValue Object);

You can then store the objects directly using a parameterized query
like the following:

myStatement.text = "INSERT INTO vo VALUES (:objID, :objValue);";
myStatement.parameters[":objID"] = vo.uid;
myStatement.parameters[":objValue"] = vo;
myStatement.execute();
 
Reading them out of the database is done with a simple select:

myStatement.text = "SELECT objValue FROM vo WHERE objID = :objID";
myStatement.parameters[":objID"] = textInput.text;
myStatement.execute();

The SQLResult.data property will then have a single object in the
array (should it be found) that is the stored object (no conversion
from bytearray, or encoding required).  You still have to use the
[RemoteObject] metadata.  Don't forget that this approach occludes the
 object from creating selective queries, but, you can hoist properties
that are deemed necessary to columns in the table and allow searching
against those.
  

--- In flexcoders@yahoogroups.com, "jer_ela" <[EMAIL PROTECTED]> wrote:
>
> Here is one I have been working on.  It serializes the object with AMF
> so it only needs one table.  Note that your classes need to have a
> [RemoteClass] metadata tag ( no alias needed) in order for them to be
> deserialized correctly.  Note that the static initialize method needs
> to be called before the class can be instantiated.
> 
> package CloudSplitter.CodeGenerator.business
> { 
>   import flash.data.SQLConnection;
>   import flash.data.SQLResult;
>   import flash.data.SQLStatement;
>   import flash.errors.SQLError;
>   import flash.filesystem.File;
>   import flash.utils.ByteArray;
>   
>   import mx.controls.Alert;
>   import mx.utils.Base64Decoder;
>   import mx.utils.Base64Encoder;
> 
>   public class PersistanceManager
>   {
>   static private var connection:SQLConnection;
>   private var tableName:String = "persistant_object";
>   
>   static public function initialize(persistanceDbName:String):void
>   {
>   if (connection == null)
>   {   connection = 
> createConnection(persistanceDbName);
>   }
>   }
>   
>   static public function getConnection():SQLConnection
>   {
>   if (connection == null)
>   {   
>   throw new Error("PersistanceManager has not 
> been initialzed");
>   }
>   else
>   {
>   return connection;
>   }
>   
>   }
>   
>   public function PersistanceManager()
>   {
>   if (connection == null)
>   {   
>   throw new Error("PersistanceManager can not be 
> instantiated until
> it has been initialzed");
>   }
>   }
>   
>   static private function
> createConnection(persistanceDbName:String):SQLConnection
>   {
>   var connection:SQLConnection = new SQLConnection();
>   var dbFile:File =
> File.applicationStorageDirectory.resolvePath(persistanceDbName);
>   try
>   {
>   connection.open(dbFile);
>   }
>   catch (error:SQLError)
>   {
>   showError(error);
>   }   
>   return connection;  
>   }
>   
>   public function createPersistanceTable():Boolean
>   {
>   var createStmt:SQLStatement = new SQLStatement();
>   createStmt.sqlConnection = connection;
>   var sql:String =
>   "CREATE TABLE IF NOT EXISTS " + tableName + " ( 
> " +
>   tableName + "_id INTEGER PRIMARY KEY 
> AUTOINCREMENT" +
>   "   ,identifier TEXT UNIQUE NOT NULL" +
>   "   ,object_data BLOB" +
>   ")";
>   createStmt.text = sql;
>   try
>   {
>   createStmt.execute();
>   var success:Boolean = true;
>   }
>   catch (error:SQLError)
>   {
>   showError(error);
>  

[flexcoders] Re: AIR - Async vs Sync SQLite connections

2008-04-21 Thread jason_williams_mm
The overhead in opening a connection only occurs when the database is
not empty. We force some initialization to occur during an open
operation to report errors right away rather than waiting until the
first statement is executed. The initialization time is proportional
to the number of tables and indexes within the database, as meta-data
is read and loaded into memory for each. 

Generally you should only have need for a single connection.  As long
as you are using the same connection for each operation the connection
will take care of serializing access to the underlying database
whether you  are using the aysnc or sync API.  Using a single
connection will avoid the issues of locking within the same AIR
application.  

The use-case for multiple simultaneously open connections to the same
database, would be if you wanted to have more than one async read
occurring simultaneously.

Hope that helps some,
jw

--- In flexcoders@yahoogroups.com, Cameron Childress <[EMAIL PROTECTED]> wrote:
>
> Looking for a pointer to some advice about a few SQLite issues. 
> 
> Is it generally best practice to keep a connection open and keep
reusing 
> it (perhaps stashing it in the ModelLocator) or is it better to
recreate 
> a connection each time you need to do a SQL operation?
> 
> Also, I have read some about why to use sync vs async connections to 
> SQLite, but not much about using both sync and async in different parts 
> of an AIR application.  I've found that keeping a sync connection open 
> and stashed in a ModelLocator locks the db so that I can't make async 
> connections.  Since SQLite is a file based DB, this is not
surprising at 
> all, but it does definitely call into question my initial effort at 
> keeping a connection open and just reusing it all over the place.
> 
> Anyone have any advice or any good blog postings about this subject?  
> Specifically about when best to make and destroy connections.
> 
> Thanks!
> 
> -Cameron
>




[flexcoders] Re: How to asynchronously dispatch an event

2007-03-23 Thread jason_williams_mm
You can do this with a timer.  There is also an undocumented 
unsupported class in the rpc package that does this as well, but, 
*use it at your own risk*

import mx.rpc.AsyncDispatcher;

new AsyncDispatcher(myEventDispatchMethod, [myEvent], 10);

It basically takes a method closure and a list of arguments to pass 
to that method along with the delay in milliseconds before calling 
the closure.




--- In flexcoders@yahoogroups.com, "pgp.coppens" 
<[EMAIL PROTECTED]> wrote:
>
> Thanks for your reply Mark
> >
> > Why would it matter for the API whether or not event dispatching 
was
> asynchronous? Clients still listen for events and hear them; the 
only
> difference would be that the stack would get taller on the sync 
calls.
> >
> 
> The main reason is that I want to give the "user" of the api the
> ability to add some custom information to the return value of the 
data
> model call and make that available in the callback (much like one 
can
> add 'stuff' to the AsyncToken returned from e.g. an HTTPService
> invocation).
> 
> > If you *really* needed to make ape async behavior, you could have
> the sync methods use a doLater() method to wait a frame before
> broadcasting an event.
> 
> Thanks for the doLater() pointer. I can only find info on
> UIModel.doLater() in the 1.5 docs of flex. Has something changed in
> 2.0 in that context.
> 
> 
> Again, I appreciate people taking the time to get be bootstrapped 
with
> flex.
> 
> Peter
>




[flexcoders] Re: DB access in Apollo

2007-03-07 Thread jason_williams_mm
I was looking for something more along the lines of: "MySQL supports 
this particular SQL dialect, or has this feature which make development 
so much easier, etc..."



[flexcoders] Re: DB access in Apollo

2007-03-06 Thread jason_williams_mm
--- In flexcoders@yahoogroups.com, Impudent1 <[EMAIL PROTECTED]> wrote:
>
> Russell Sprague wrote:
> > I vote for MySQL.
> 
> Agreed
> 
> Impudent1
> LeapFrog Productions
>


Are there specific reasons why you want or need MySQL?



[flexcoders] Re: Bug! Filters are Demolishing my ArrayCollection Data Bindings!

2006-11-16 Thread jason_williams_mm
Hi,
In your post you wrote:

> They are not really meant to create a new collection
> that you can then add items to.

Actually, while you are correct on the one hand that they [collection 
views] are not meant to create a new collection, one of the design 
centers for views was meant to allow manipulating the view and 
transparently updating the underlying list.  This means that you can 
add items to the view which may or may not appear in that view but 
will definitely update the underlying list and potentially show up in 
other views operating against the same list.

I will get a bug logged against the SDK for this.  

Thanks,
jw


--- In flexcoders@yahoogroups.com, "dwischusen" <[EMAIL PROTECTED]> 
wrote:
>
> Hi Giff,
> 
> 
> I agree that this probably a bug, in that the addItemAt() method 
call
> should either produce the expected behavior or throw an error, but I
> do think that you are trying to use Filters for something other than
> what they were intended for.
> 
> Filters are suppose to allow you "use a filter function limit the
> ICollection view to a subset of the data provider source."  So they
> allow you to filter data, view the data, and then reset to the 
values
> in the source.  They are not really meant to create a new collection
> that you can then add items to.
> 
> When you use a sort or a filter, the collection stores the values in
> an array called localIndex.  When there is data in this array (i.e.,
> localIndex != null), any component that is reading from this
> collection will read from the localIndex, not the source.  In this
> situation, when you try to add an item to collection you are trying 
to
> add it to the localIndex, which is not really allowed.  If you look 
at
> the docs for localIndex (see below) you will see that it should not
> contain anything that is not in the source.
> 
> localIndex property   
> 
> protected var localIndex:Array
> When the view is sorted or filtered the localIndex property contains
> an array of items in the sorted or filtered (ordered, reduced) view,
> in the sorted ordder. The ListCollectionView class uses this 
property
> to access the items in the view. The localIndex property should 
never
> contain anything that is not in the source, but may not have
> everything in the source. This property is null when there is no 
sort. 
> 
> So, if you want to filter and then add items to the results you 
shoul
> store the results of the filter in a new collection and then add the
> items to that collection, or you could use a temporary collection to
> do the filtering for you and the return the results back to your
> original collection (see below FilterAC() below).
> 
> Derek
> 
> 
> http://www.adobe.com/2006/mxml"; 
width="600">
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "thegiffman"  wrote:
> >
> > Hi Folks - I have a serious bug here.  I was wondering if there 
is a
> > good workaround or if this has been documented.
> > 
> > Basically, it seems that if you add a filter function to an
> > ArrayCollection, any future changes to the collection are tacked 
on to
> > the end, until you explicitly call the refresh() function.  This 
is a
> > rather serious problem, because data bindings do not wait for 
refresh
> > calls!  
> > 
> > For instance, if I have an AC of objects, and I add another 
object to
> > the beginning of that AC, the object will normally be put at the
> > beginning.  However, if I have added a filter and called the 
refresh()
> > function at least once, this item gets added to the END of the 
array.
> > 
> > To make matters worse, if you have an AC of bindable objects, this
> > even holds for items that are edited.  Say I have an AC of a 
simple
> > bindable Class with a "name" property.  If I then do something 
like: 
> > 
> > myArrayCollection[3].name = myArrayCollection[3].name + "!";
> > 
> > The third item will be pulled out of its spot, and tacked onto the
> > end!  This is a serious problem if an AC is bound to a TileList or
> > similar display component.  This means that, for any item that is
> > updated, the entire list is going to be redrawn, and redrawn 
wrongly!
> >  If I am super careful to put refresh() calls after every property
> > change, things seem to fix themselves.  But this horribly 
subverts the
> > MVC architecture and the entire purpose of DataBindings.  Indeed, 
the
> > DataBindings are now responsible for creating extra overhead doing
> > things that aren't wanted.
> > 
> > Any help on this would be most appreciated.
> > 
> > Giff Ransom
> > Emergent Game Technologies
> > 
> > 
> > 
> > P. S. - here is an example to see the bug.
> > 
> > 1) paste the following code into a new applica

[flexcoders] Re: Loop with call to Flex Data Services

2006-11-01 Thread jason_williams_mm
Okay, well that is a bit more complex.  To simplify the client code 
and the number of network round trips, I would suggest building up a 
list of the project ids and pass that as an argument to the fill 
request.  This way you only make one call to the remote destination 
and remove the complexity you will require in the client code which 
will be exacerbated if you decide to use paging later on.

Doing this on the client might look something like this:

// ...
private var totalTasks:ArrayCollection = new ArrayCollection();
// ...
taskDataService.addEventListener(DataServiceResultEvent.RESULT, 
resultHandler)
var token:AsyncToken = taskDataService.fill(...);
token.collection = tmpArray;
token.isLastFill = i == projectsArray.length;

function resultHandler(event:DataServiceResultEvent):void
{
   var collection:ArrayCollection = ArrayCollection
(event.token.collection);
   if (collection != null)
   {
   var cursor:IViewCursor = collection.createCursor();
   while (!cursor.afterLast)
   {
  totalTasks.addItem(cursor.current);
  cursor.moveNext();
   }

   if (event.token.isLastFill)
   {
   // do something with the final results
   }
   }
}

Hope that helps.


--- In flexcoders@yahoogroups.com, "jonathan_merey" <[EMAIL PROTECTED]> 
wrote:
>
> Actually, I want to concat the tmpArray of each loop ant return it 
then.
> 
> --- In flexcoders@yahoogroups.com, "jason_williams_mm" 
> wrote:
> >
> > Each fill operation is asynchronous and so are the calls to 
Alert.show
> > ().  This means that code doesn't stop when these lines of code 
are 
> > executed it continues to run the very next line.
> > 
> > With the fill operation you will not get a valid length until the 
> > server responds to the request, however, during that time you 
will 
> > continue to execute more fill requests until all projects within 
the 
> > projectsArray have been iterated.
> > 
> > It is not clear what you are after here, if you want to display 
the 
> > length of the filled collection after the server has responded 
then 
> > you could do something like the following:
> > 
> > tmpArray.addEventListener(CollectionEvent.COLLECTION_CHANGE, 
> > collectionChangeHandler);
> > taskDataService.fill(...);
> > 
> > function collectionChangeHandler(event:CollectionEvent):void
> > {
> >if (event.kind == CollectionEventKind.RESET)
> >{
> >   // display the length using the event.target.length
> >}
> > }
> > 
> > The RESET kind is only dispatched when the collection has been 
> > initially filled when managed by DataService.
> > 
> > There are more sophisticated approaches to this problem as well 
like 
> > using a responder with the AsyncToken returned from the fill() 
> > method, but, it is unclear if you are only after debugging 
> > information or not.  If you really only want debugg information 
then 
> > use the  in your application MXML and a debug 
> > player then inspect the flashlog.txt or the console when using 
> > FlexBuilder in debug mode.
> > 
> > --- In flexcoders@yahoogroups.com, "jonathan_merey"  
> > wrote:
> > >
> > > My problem is simple. I know each of my projects have tasks. If 
I
> > > delete the loop. The second Alert.show print the good length. 
But 
> > with
> > > the loop, the second Alert.show print 0 except for the last 
loop. 
> > If i
> > > delete the first Alert.show, the second print 0 even for the 
last
> > > loop.  I understood its due to a problem of exectution time but 
how
> > > can i do to do what i want. Thank you.
> > > 
> > > 
> > > Here is the code :
> > > 
> > > private function getTasks():void
> > > {
> > > currentState='';
> > > if (document.listProject.selectedIndex == -1)
> > > {
> > > var projectsArray:ArrayCollection =
> > > ArrayCollection(document.listProject.dataProvider);
> > > var tmpArray:ArrayCollection = new ArrayCollection();
> > > var i:int;
> > > for (i = 0; i < projectsArray.length; i++)
> > > {
> > > mx.controls.Alert.show(projectsArray.getItemAt
(i).id);
> > > taskDataService.fill(tmpArray, "tasksProject",
> > > [projectsArray.getItemAt(i).id]);
> > > mx.controls.Alert.show(tmpArray.length.toString());
> > > 
> > > }
> > > }
> > >else
> > > taskDataService.fill
(document.tasksArray, "tasksProje

[flexcoders] Re: Loop with call to Flex Data Services

2006-11-01 Thread jason_williams_mm
Each fill operation is asynchronous and so are the calls to Alert.show
().  This means that code doesn't stop when these lines of code are 
executed it continues to run the very next line.

With the fill operation you will not get a valid length until the 
server responds to the request, however, during that time you will 
continue to execute more fill requests until all projects within the 
projectsArray have been iterated.

It is not clear what you are after here, if you want to display the 
length of the filled collection after the server has responded then 
you could do something like the following:

tmpArray.addEventListener(CollectionEvent.COLLECTION_CHANGE, 
collectionChangeHandler);
taskDataService.fill(...);

function collectionChangeHandler(event:CollectionEvent):void
{
   if (event.kind == CollectionEventKind.RESET)
   {
  // display the length using the event.target.length
   }
}

The RESET kind is only dispatched when the collection has been 
initially filled when managed by DataService.

There are more sophisticated approaches to this problem as well like 
using a responder with the AsyncToken returned from the fill() 
method, but, it is unclear if you are only after debugging 
information or not.  If you really only want debugg information then 
use the  in your application MXML and a debug 
player then inspect the flashlog.txt or the console when using 
FlexBuilder in debug mode.

--- In flexcoders@yahoogroups.com, "jonathan_merey" <[EMAIL PROTECTED]> 
wrote:
>
> My problem is simple. I know each of my projects have tasks. If I
> delete the loop. The second Alert.show print the good length. But 
with
> the loop, the second Alert.show print 0 except for the last loop. 
If i
> delete the first Alert.show, the second print 0 even for the last
> loop.  I understood its due to a problem of exectution time but how
> can i do to do what i want. Thank you.
> 
> 
> Here is the code :
> 
> private function getTasks():void
> {
> currentState='';
> if (document.listProject.selectedIndex == -1)
> {
> var projectsArray:ArrayCollection =
> ArrayCollection(document.listProject.dataProvider);
> var tmpArray:ArrayCollection = new ArrayCollection();
> var i:int;
> for (i = 0; i < projectsArray.length; i++)
> {
> mx.controls.Alert.show(projectsArray.getItemAt(i).id);
> taskDataService.fill(tmpArray, "tasksProject",
> [projectsArray.getItemAt(i).id]);
> mx.controls.Alert.show(tmpArray.length.toString());
> 
> }
> }
>else
> taskDataService.fill(document.tasksArray, "tasksProject",
> [document.listProject.selectedItem.id]);
>  }
>





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

<*> To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 



[flexcoders] Re: Flex Data Services configuration problem

2006-09-18 Thread jason_williams_mm
--- In flexcoders@yahoogroups.com, "amalabie" <[EMAIL PROTECTED]> wrote:
>
> I'm trying to configure Flex Data Services with Hibernate on the back 
end and I'm running into these problems as shown below. Any pointers to 
solve these would be highly appreciated. <

You need to specify/configure the missing hibernate options in the data-
management-config.xml.  Take a look at the following documentation for 
an example:

http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/ww
help.htm?context=LiveDocs_Parts&file=1203.html







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

<*> To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: Flex - Database

2006-09-18 Thread jason_williams_mm
--- In flexcoders@yahoogroups.com, Tom Chiverton <[EMAIL PROTECTED]> 
wrote:


> Thought-making, certainly :-) Suppose I was using FDS, so I've got 
lots of client-side logic for what can and can't be changed. I then 
have to duplicate that all server-side as well, because I don't trust 
the client. That's just as much work as *not* using FDS, isn't it ? <

How the application logic is partitioned is orthogonal to the use of 
FDMS.  If your application needs some or all of the following 
features you should consider using FDMS:

- ability to edit/revert changes locally
- ability to send changes in a batch
- ability to perform edits when disconnected from remote destination
- ability to perform conflict detection/notification and resolution
- ability to replicate changes across multiple clients
- ability to cluster services and provide fail over






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

<*> To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] Re: Flex - Database

2006-09-18 Thread jason_williams_mm
--- In flexcoders@yahoogroups.com, Tom Chiverton <[EMAIL PROTECTED]> 
wrote:
 
> Thought-making, certainly :-)
Suppose I was using FDS, so I've got lots of client-side logic for what 
can and can't be changed. I then have to duplicate that all server-side 
as well, because I don't trust the client. 
That's just as much work as *not* using FDS, isn't it ? <

How you partition the application logic is orthogonal to the use of 
FDMS. FDMS should be employed when an application needs some or all of 
the following functionality:

- the ability to edit/revert data locally
- submit client changes in batches
- survive network outages, i.e. changes can be made on the client while 
disconnected
- data conflict notification and resolution
- updates need to be replicated on (pushed to) multiple clients
- fail over/clustering











--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

<*> To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: Flex - Database

2006-09-15 Thread jason_williams_mm
--- In flexcoders@yahoogroups.com, Tom Chiverton <[EMAIL PROTECTED]> 
wrote:

> Oh, collery: Using FDS data-sync is a bad idea from this point of 
view, as it  allows the app very fine grained access (i.e. at the 
level of tables) as opposed to a high level business process (create 
a user with these properties). I don't see a way to have FDS managed 
data-sync *and* proper control over what goes in the DB. <


On the contrary the client side code of FDMS only manages changes to 
an object's properties and messages those changes to the server which 
processes them and sends the changes to other subscribed clients.  
This object is your transfer object (TO) which, typically represents 
only a portion of your server side domain model. This TO can contain 
logic or merely values (as in the value object or VO case). But, it 
is an object which typically represents something like a customer, 
user, or some complex object graph not merely a row in a DB table.

It is the server side "assembler" that is responsible for reconciling 
the updates to these objects with the corresponding server model. 
This includes identifying conflicts or other data integrity 
constraints and faulting as appropriate. This "assembler" can contact 
any business process it needs to, typically a data access object 
layer. And it does support the notion of "create a user with these 
properties". The assembler is notified of each request from the 
client through a change object.  This "assembler" is custom code that 
you write to run in a server side container. This gives the developer 
complete control over what is applied to the domain model on the 
server side (which could be persisted to a DB).

A hibernate "assembler" is provided and can perform DB interactions 
directly but, its use is not enforced by FDMS, it is provided as a 
convenience.

Hope that clears things up.
jw





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

<*> To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/