[flexcoders] Re: FDS DataService.commit() doesn't trigger responder result()...?

2007-02-06 Thread simonjpalmer
No answer unfortunately, but I do have two questions...

1) how do you manage to debug your server side jave code?  I am
running under JBoss and using Eclipse as my IDE for both Java and
FlexBuilder and I can't figure out how to set breakpoints in my Java
code or attach a debugger to the server.

2) how do you switch on the FDS logging?

not the response you were hoping for I am sure, but you would be
helping a fella out :-)

SP

--- In flexcoders@yahoogroups.com, "parkerwhirlow" <[EMAIL PROTECTED]>
wrote:
>
> Hi again,
> 
> I've got a simple save case working as far as I can tell (from
> debugging the server java side, everything is OK after leaving the
> HibernateAssembler.java updateItem() method.
> 
> But the result never gets back to the client... I have a responder
> registered to the call like so:
> 
> call = service.commit();
> call.action = "save";
> call.addResponder(responder);
> 
> And my responder has both fault and result methods. I know the
> responder is registered because I was getting faults for a long time,
> and those were firing the fault handler. But now that I think I have
> the save going successfully, I'm not getting anything back.
> 
> I've turned on FDS logging for messages, see the trace below. Seems
> like the "ACK" message is being sent... 
> 
> Any ideas?
> 
> thanks,
> PW
> 
> 
> 02/05 11:01:36 user [Flex] 11:01:36.794 [DEBUG]
> [Message.Data.transacted] After invoke service: data-service
>   reply: Flex Message (flex.messaging.messages.AcknowledgeMessage)
> clientId = null
> correlationId = null
> destination = null
> messageId = 7793A2C0-FA0D-5A78-3641-BB1BA4B4ADB5
> timestamp = 1170702096794
> timeToLive = 0
> body =
> [
> 
> ]
> 
> 02/05 11:01:36 user [Flex] 11:01:36.794 [DEBUG] [Endpoint.RTMP]
> Serializing AMF/RTMP response
> Version: 3
>   (Command method=_result (0) trxId=20)
> (Typed Object #0 'flex.messaging.messages.AcknowledgeMessage')
>   destination = null
>   headers = (Object #1)
>   correlationId = "322C326C-9C96-8513-7EC3-934715E5D887"
>   messageId = "7793A2C0-FA0D-5A78-3641-BB1BA4B4ADB5"
>   timestamp = 1.170702096794E12
>   clientId = "77909013-D108-A13B-EC7E-EDBFA5C3A894"
>   timeToLive = 0.0
>   body = (Array #2)
>




[flexcoders] Re: FDS DataService.commit() doesn't trigger responder result()...?

2007-02-07 Thread simonjpalmer
Thanks Jeff, you're a star.  I'll have a go at this.  

For debugging I have been looking at the Eclipse wtp all-in-one
package which claims to be the dev environment for App Server code.  I
just downloaded it from Eclipse and was planning on rebuilding today.
 If I turn anything useful up I'll let you know.

IOU  :-)

SP

--- In flexcoders@yahoogroups.com, "Jeff Vroom" <[EMAIL PROTECTED]> wrote:
>
> I personally attach to the server after it is started.  It is a pain to
> specify all of the jar files and keep that up to date in my case since
> the jars change a lot (though I have gotten that to work too...).  
> 
>  
> 
> Unfortunately the exact way is dependent on the app server and I am
> still using jrun (yeah, been meaning to switch for a while!)
> 
>  
> 
> For Jrun, I add this to the standard java command line args it uses:
> 
>  
> 
>   -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=2005
> 
>  
> 
> Then my eclipse debug target is created from the "Remote Java
> Application" configuration.  I specify localhost and 2005 for server and
> port.
> 
>  
> 
> Debug logging on the server is in WEB-INF/flex/services-config.xml.
> Search for level=, change that to Debug.  Make sure that "Message.*" and
> DataService.* are in the patterns.  I personally don't like the
> "Endpoint.*" unless I'm debugging serialization problems since it is
> pretty verbose and duplicates a lot of the Message.* stuff.
> 
>  
> 
> On the client, you can use the  in your MXML.  It goes
> to flashlog.txt - same place as the "trace" statement output.
> 
>  
> 
> Jeff
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Monday, February 05, 2007 4:53 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: FDS DataService.commit() doesn't trigger
> responder result()...?
> 
>  
> 
> No answer unfortunately, but I do have two questions...
> 
> 1) how do you manage to debug your server side jave code? I am
> running under JBoss and using Eclipse as my IDE for both Java and
> FlexBuilder and I can't figure out how to set breakpoints in my Java
> code or attach a debugger to the server.
> 
> 2) how do you switch on the FDS logging?
> 
> not the response you were hoping for I am sure, but you would be
> helping a fella out :-)
> 
> SP
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "parkerwhirlow" 
> wrote:
> >
> > Hi again,
> > 
> > I've got a simple save case working as far as I can tell (from
> > debugging the server java side, everything is OK after leaving the
> > HibernateAssembler.java updateItem() method.
> > 
> > But the result never gets back to the client... I have a responder
> > registered to the call like so:
> > 
> > call = service.commit();
> > call.action = "save";
> > call.addResponder(responder);
> > 
> > And my responder has both fault and result methods. I know the
> > responder is registered because I was getting faults for a long time,
> > and those were firing the fault handler. But now that I think I have
> > the save going successfully, I'm not getting anything back.
> > 
> > I've turned on FDS logging for messages, see the trace below. Seems
> > like the "ACK" message is being sent... 
> > 
> > Any ideas?
> > 
> > thanks,
> > PW
> > 
> > 
> > 02/05 11:01:36 user [Flex] 11:01:36.794 [DEBUG]
> > [Message.Data.transacted] After invoke service: data-service
> > reply: Flex Message (flex.messaging.messages.AcknowledgeMessage)
> > clientId = null
> > correlationId = null
> > destination = null
> > messageId = 7793A2C0-FA0D-5A78-3641-BB1BA4B4ADB5
> > timestamp = 1170702096794
> > timeToLive = 0
> > body =
> > [
> > 
> > ]
> > 
> > 02/05 11:01:36 user [Flex] 11:01:36.794 [DEBUG] [Endpoint.RTMP]
> > Serializing AMF/RTMP response
> > Version: 3
> > (Command method=_result (0) trxId=20)
> > (Typed Object #0 'flex.messaging.messages.AcknowledgeMessage')
> > destination = null
> > headers = (Object #1)
> > correlationId = "322C326C-9C96-8513-7EC3-934715E5D887"
> > messageId = "7793A2C0-FA0D-5A78-3641-BB1BA4B4ADB5"
> > timestamp = 1.170702096794E12
> > clientId = "77909013-D108-A13B-EC7E-EDBFA5C3A894"
> > timeToLive = 0.0
> > body = (Array #2)
> >
>




[flexcoders] Building the FDS HibernateManager class in Eclipse

2007-02-07 Thread simonjpalmer
Hi,

I am trying to debug the FDS HibernateAssembler.  I have put the 
HibernateAssembler
HibernateManager
HibernateType
java files into my own package and adjusted dependencies accordingly.  

I am unable to build because of the following problem.  The
HibernateManager.getSession() method contains the following line of code:

if (!syncSession && DataServiceTransaction.getCurrentUserTransaction()
!= null)
syncSession = true;

I get the following two build errors:
1)
The project was not built since its build path is incomplete. Cannot
find the class file for javax.transaction.UserTransaction. Fix the
build path then try building this project
2)
The type javax.transaction.UserTransaction cannot be resolved. It is
indirectly referenced from required .class files

I can't find anything which seems to contain the UserTransaction code
or interface.  Anyone know what I need to do to my Eclipse project
dependencies to have this compile?

SP




[flexcoders] Re: enabling Hibernate logging through log4j with jrun/fds2

2007-02-23 Thread simonjpalmer
PW,

which sample did you use for your log4j.properties?

Thanks
Simon

--- In flexcoders@yahoogroups.com, "parkerwhirlow"
<[EMAIL PROTECTED]> wrote:
>
> I have gotten hibernate logging to work by placing log4j.jar into the
> web-inf/lib directory, and placing a log4j.properties (you can use the
> sample) into the web-inf/classes directory. That was all I needed to do.
> 
> good luck,
> PW
> 
> --- In flexcoders@yahoogroups.com, "thunderstumpgesatwork"
>  wrote:
> >
> > 
> > Does anyone know how to get hibernate logging when using FDS and the
> > HibernateAssembler? From my reading on Hibernate: see
> >
>
http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-logging
> > , they use log4j, and talk about putting a log4j.properties file in
> > the WEB-INF/classes directory, but I have tried this with no luck...
> > 
> > Also, I'm not referring to Flex's Hibernate Assembler log set up by
> > setting "DataService.Hibernate" in the
> > services-config.xml log target... I'm talking about getting internal
> > Hibernate log output.
> > 
> > thanks,
> > Thunder
> >
>




[flexcoders] Re: parent-child hierarchy of data using Flex, FDS and Hibernate

2007-02-23 Thread simonjpalmer
PW,

I did the work to understand log4j and you're right, it is amazingly
powerful.  I added a new appender to my configuration in log4j.xml
because all the literature I found said that the .properties approach
was being deprecated.  However, this has not worked, so I'm going to
try your method from the other post.

This should work...

   
   
   
   
   
  
  
  

  
  

  

  
 
 

 
  
   
   


 

   
 
 
   
   
 
 
   
   
 
 
   



--- In flexcoders@yahoogroups.com, "parkerwhirlow" <[EMAIL PROTECTED]>
wrote:
>
> 
> > All-in-all a very worthwhile exercise and my dev environment is now
> > more under my control.
> 
> Good to hear. was just replying to your previous post in this thread,
> and now I see you got it figured out. Excellent.
> 
> > 
> > I still can't figure out how to turn on debug logging in Hibernate,
> 
> See this other post where I figured out how to turn on the Hibernate
> logging. If you don't know about log4j, I suggest doing a few searches
> on it, and reading up about the log4j.properties file. It's a very
> powerful tool, and Hibernate has a TON of good logging, but its easy
> to get lost in it all if you just turn everything on to debug...
> 
> http://tech.groups.yahoo.com/group/flexcoders/message/59623
> 
> Hibernate has a sample log4j.properties in the Hibernate/etc directory
> 
> 
> 
> > The exception is thrown way down in the bowels of the Hibernate
> > session.save() method which is being called by
> > HibernateAssembler.createItem.  From Jeff's last post he seemed to be
> > suggesting that updateItem was in some way at fault.  I'm not quite
> > seeing how that relates to my problem, although I am clearly no
expert.
> > 
> 
> I'm not exactly sure how the problem would occur from createItem(),
> but take a look at my post here I mention what was causing it for me
> (was a lazy=false setting on the collection association of the object
> being updated)
> 
> http://tech.groups.yahoo.com/group/flexcoders/message/63471
> 
> The issue with the NOT NULL column was that once I had everything
> "working" the behavior it was doing was to null out all the FK values
> for the association, thereby dis-associating the children from the
> parent, then updating all the entries in the collection to point back
> to the parent. Once I made the association nullable, the update
> started working. (at least as far as FDS was concerned.
> 
> 
> > 
> > Jeff, if you have a new version of the Assembler code and want a
> > guinea-pig, send it my way.
> > 
> 
> Likewise!
> 
> cheers,
> PW
>




[flexcoders] Re: FDS/Hibernate Sample of updating hierarchical list of values

2007-02-23 Thread simonjpalmer
PW and Jeff,

PW, you and I seem to be in the same boat.  I am trying to fight off
the people who were flex skeptics to start with.  Not being able to
write data back makes the whole thing look pretty amateur and confirms
people's belief that the technology isn't ready - which given this
experience it clearly isn't.  The baby is definitely at risk of being
thrown out with the bath water.  It stands in our company simply
because I have the final call as Technical Director (CTO if you are in
the US).

I am a huge flex advocate and really doing my best to evangelise on
the topic.  What's more I think that the bridge to operational data is
the most profound leap forward for flash, it takes it out of the world
of gimicks and into the world of real business applications.  

Jeff, you and your and team deserve huge credit for that vision and
excellent execution.

However, much as it pains me to say it, the bottom line is that the
hibernate middle tier provided does not work, as PW and I (and a host
of other people on various forums) have found.  I know that I can
re-write the whole thing myself and will probably have to, but when
introducing new technologies it is unfortunately all about initial
perception.  

I have made a career of doing this sort of thing myself and I have
seen excellent projects fail to fly because of low initial quality,
even though we fixed them immediately, the damage was done because
people's impression was that they were flaky.  I'm sure you know it is
hard to get back from that first impression and the word of mouth that
springs from it.  Once it becomes entrenched that opinion becomes fact
and you are irrevocably lost.  If I were Adobe I would be a little
worried about the tone of the posts I am seeing about integration with
Hibernate.

The Hibernate Assembler is very important and I would really hate to
see that happen to it.  The corollary is very unfortunate.  That
little bit of technology transform the boardroom conversation about
FDS.  Suddenly the cost of the licensing of FDS becomes justifiable
against the dev cost savings because we can just plug into the ORM. 
Having made that justification myself it is very difficult for me now
to go back and say, "by the way I also have to incur the dev costs". 
When asked why? I have to confess that the Adobe code doesn't work and
we don't know when we're getting a fix.  For the Flex/Flash skeptics
in the room that's a god send.

For me it is a complete nightmare.  It is hard for me to separate the
cost of FDS licenses (which is almost prohibitively large) against the
cost of dev.  I would urge Jeff and Co to get the Hibernate Assembler
code watertight and shipping asap.  If I can be of any assistance I
will gladly offer my services.

If either of you would like to contact me, post a reply and I will
happily give you my details.

Simon Palmer
Technical Director
The PMCo
62 St Peters Street
St Albans
HERTS  AL1 3HG
UK

--- In flexcoders@yahoogroups.com, "parkerwhirlow" <[EMAIL PROTECTED]>
wrote:
>
> Thats very unfortunate. I'm getting farther and farther into hot water
> not being able to reliably update our data model using Flex.
> 
> Last it was "just wait for 2.0.1, there's a lot of Hibernate/FDS fixes
> in it" and now we're waiting for another unknown amount of time for
> fixes we can only hope will help our situation.
> 
> I'm apologize, I understand it's not your fault, and I really
> appreciate the insight you provide as to what can be causing our
> problems, I'm just getting up to my neck in unsolved problems.
> 
> If you have any insight as to "roughly" when this next release could
> occur, can you tip me off?
> 
> thanks,
> PW
> 
> --- In flexcoders@yahoogroups.com, "Jeff Vroom"  wrote:
> >
> > I have finished making the changes and the use of the "merge" call
seems
> > to be a) much simpler and b) more robust than the way the current code
> > works.   
> > 
> >  
> > 
> > Unfortunately we've made enough changes to the code surrounding the
> > HibernateAssembler so I can't just send you the updated file and
have it
> > work in FDS2.  It will be in an upcoming public beta but I don't think
> > we've announced the dates on that.  
> > 
> >  
> > 
> > Jeff
> > 
> >  
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
> > Behalf Of parkerwhirlow
> > Sent: Thursday, February 15, 2007 3:29 PM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] Re: FDS/Hibernate Sample of updating
hierarchical
> > list of values
> > 
> >  
> > 
> > Hey Jeff, just curious if you've got any updated HibernateAssembler
> > code with some fixes? Any idea when this would be available?
> > 
> > thanks,
> > PW
> > 
> > --- In flexcoders@yahoogroups.com

> > , "Jeff Vroom"  wrote:
> > >
> > > My apologies - this does look like a bug. I need to do more
testing on
> > > this case myself, but I think one of the big problems here is
that we
> > > are trying to d

[flexcoders] Re: FDS/Hibernate Sample of updating hierarchical list of values

2007-02-23 Thread simonjpalmer
PW, BTW pop over to the FDS forum at Adobe

http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=60&catid=583

take a look at the thread called 

"Parent Child Hierarchy with FDS and Hibernate"

SP

--- In flexcoders@yahoogroups.com, "simonjpalmer" <[EMAIL PROTECTED]>
wrote:
>
> PW and Jeff,
> 
> PW, you and I seem to be in the same boat.  I am trying to fight off
> the people who were flex skeptics to start with.  Not being able to
> write data back makes the whole thing look pretty amateur and confirms
> people's belief that the technology isn't ready - which given this
> experience it clearly isn't.  The baby is definitely at risk of being
> thrown out with the bath water.  It stands in our company simply
> because I have the final call as Technical Director (CTO if you are in
> the US).
> 
> I am a huge flex advocate and really doing my best to evangelise on
> the topic.  What's more I think that the bridge to operational data is
> the most profound leap forward for flash, it takes it out of the world
> of gimicks and into the world of real business applications.  
> 
> Jeff, you and your and team deserve huge credit for that vision and
> excellent execution.
> 
> However, much as it pains me to say it, the bottom line is that the
> hibernate middle tier provided does not work, as PW and I (and a host
> of other people on various forums) have found.  I know that I can
> re-write the whole thing myself and will probably have to, but when
> introducing new technologies it is unfortunately all about initial
> perception.  
> 
> I have made a career of doing this sort of thing myself and I have
> seen excellent projects fail to fly because of low initial quality,
> even though we fixed them immediately, the damage was done because
> people's impression was that they were flaky.  I'm sure you know it is
> hard to get back from that first impression and the word of mouth that
> springs from it.  Once it becomes entrenched that opinion becomes fact
> and you are irrevocably lost.  If I were Adobe I would be a little
> worried about the tone of the posts I am seeing about integration with
> Hibernate.
> 
> The Hibernate Assembler is very important and I would really hate to
> see that happen to it.  The corollary is very unfortunate.  That
> little bit of technology transform the boardroom conversation about
> FDS.  Suddenly the cost of the licensing of FDS becomes justifiable
> against the dev cost savings because we can just plug into the ORM. 
> Having made that justification myself it is very difficult for me now
> to go back and say, "by the way I also have to incur the dev costs". 
> When asked why? I have to confess that the Adobe code doesn't work and
> we don't know when we're getting a fix.  For the Flex/Flash skeptics
> in the room that's a god send.
> 
> For me it is a complete nightmare.  It is hard for me to separate the
> cost of FDS licenses (which is almost prohibitively large) against the
> cost of dev.  I would urge Jeff and Co to get the Hibernate Assembler
> code watertight and shipping asap.  If I can be of any assistance I
> will gladly offer my services.
> 
> If either of you would like to contact me, post a reply and I will
> happily give you my details.
> 
> Simon Palmer
> Technical Director
> The PMCo
> 62 St Peters Street
> St Albans
> HERTS  AL1 3HG
> UK
> 
> --- In flexcoders@yahoogroups.com, "parkerwhirlow" 
> wrote:
> >
> > Thats very unfortunate. I'm getting farther and farther into hot water
> > not being able to reliably update our data model using Flex.
> > 
> > Last it was "just wait for 2.0.1, there's a lot of Hibernate/FDS fixes
> > in it" and now we're waiting for another unknown amount of time for
> > fixes we can only hope will help our situation.
> > 
> > I'm apologize, I understand it's not your fault, and I really
> > appreciate the insight you provide as to what can be causing our
> > problems, I'm just getting up to my neck in unsolved problems.
> > 
> > If you have any insight as to "roughly" when this next release could
> > occur, can you tip me off?
> > 
> > thanks,
> > PW
> > 
> > --- In flexcoders@yahoogroups.com, "Jeff Vroom"  wrote:
> > >
> > > I have finished making the changes and the use of the "merge" call
> seems
> > > to be a) much simpler and b) more robust than the way the
current code
> > > works.   
> > > 
> > >  
> > > 
> > > Unfortunately we've made enough changes to th

[flexcoders] Re: Just curious, A big development team or individual developers

2007-02-23 Thread simonjpalmer
huh, what an interesting question.

INDIVIDUAL

However, have budget for large team...

--- In flexcoders@yahoogroups.com, "boy_trike" <[EMAIL PROTECTED]> wrote:
>
> I wonder how many people are working on TEAM to develop their flex
applications (and how 
> many are 1 or 2 men (whoops I mean PEOPLE) developers.  Please
discount the Graphic 
> artists, HTML coders. et. al.  If you have 3 or more people working
on the same flex 
> application, please answer as a TEAM.  2 or 1, INDIVIDUAL.
> 
> Thanks
> Bruce
>




[flexcoders] Re: [FDS2+Spring/Hibernate] VOs reaching the backend with id=0 ("unsaved-value"

2007-02-23 Thread simonjpalmer
I think there are a lot of people trying it for obvious reasons. 
However all evidence would suggest it doesn't work.  I really hope
Adobe step up to this combination as it is extremely powerful.

I'd be interested to hear from anyone who has a genuine real-world
application running with a full CRUD cycle using FDS/Hibernate and
anything more than a trivial data model.

Maybe I'll start that thread...

 --- In flexcoders@yahoogroups.com, Douglas McCarroll
<[EMAIL PROTECTED]> wrote:
>
> Well, it doesn't seem as though there's a great deal of actual use of 
> the FDMS/Hibernate option...
> 
> I'm struggling with trying to learn it, but there seem to be some
bugs...
> 
> Hey flexcoders, is it possible that no one has attempted to create new 
> entities using FDMS/Hibernate?
> 
> Douglas
> 
> 
> 
> 
> Carlos Rovira wrote:
> >
> > Thanks Douglas,
> >
> > Thanks for the response.
> >
> > In that case, how people deal with the fact that hibernate expect IDs 
> > with null value instead of 0?
> > Or maybe I'm missing something?
> >
> >
> >
> >
> > On 1/19/07, *Douglas McCarroll* 
> > <[EMAIL PROTECTED] 
> > > wrote:
> >
> > Hi Carlos,
> >
> > I can't be of much help but I can tell you...
> >
> > > Or maybe there's a way in FDS2 to configure default value to
null?
> >
> > ... that you can probably forget this option. FDS converts null
> > values
> > to zero when it converts AS objects to Java objects, and the only
> > workaround is to have code on the java side that converts zeros
> > back to
> > nulls. There are discussions about why this is the case in the
> > archive
> > if you want to do some searching...
> >
> > Douglas
> >
> > -
> >
> > Douglas McCarroll
> >
> > CairngormDocs.org Webmaster
> > http://www.CairngormDocs.org 
> >
> > Flex Developer
> > http://www.brightworks.com 
> > 617.459.3840
> >
> > -
> >
> >
> >
> > Carlos Rovira wrote:
> > >
> > > Hi,
> > >
> > > I'm switching from Toplink to Hibernate using JPA/EJB3 and
> > Annotations.
> > > I'm facing a problem with this change due to the fact that
when I
> > try
> > > to persist new entities Hibernate throws a
> > > "PersistenceObjectException: Detached entity passed to persist".
> > > Hibernate expects new entities with ID = NULL and my new
entities
> > > reach the hibernate layer with ID = 0.
> > >
> > > If I were using hibernate xml config files (hbm.xml) I could use
> > > "unsaved-value = 0" (for each entity), but I'm using
Annotations and
> > > there's no "unsaved-value" annotation to use.
> > >
> > > So, anyone reach this problem? How could I change the default
> > > configuration in Hibernate so new entities with ID = 0 will be
> > > considered as the default.
> > >
> > > Or maybe there's a way in FDS2 to configure default value to
null?
> > >
> > > Thanks for any light on this :)
> > >
> > > C.
> > >
> > >
> > >
> > >
> > > --
> > > ::| Carlos Rovira
> > > ::| http://www.carlosrovira.com  <
> > http://www.carlosrovira.com >
> > > ::| http://www.madeinflex.com  <
> > http://www.madeinflex.com >
> > >
> > >
> >
> >
> >
> >
> > -- 
> > ::| Carlos Rovira
> > ::| http://www.carlosrovira.com 
> > ::| http://www.madeinflex.com 
> >
>




[flexcoders] Re: FDS/Hibernate Sample of updating hierarchical list of values

2007-02-24 Thread simonjpalmer
Jeff,

thanks very much for taking the time to reply, I appreciate it.  I
would be very happy to be engaged in the beta process.  Can you give
me some indication of what I might have to do in order to add my name
to the list of beta sites?  

Is it possible for you to give a rough date when we might expect the
beta to start (to which you will not be held)?  The reason I ask is
that I have a pressing and immediate need to have this addressed and
about to undertake an initiative to replace the Hibernate Assembler
(probably a Spring/Hibernate Java Assembler of some kind).  If the
beta is soon I may hold off and put attention elsewhere.  

Any insight you could give would be greatly appreciated.

Kind regards

Simon Palmer


--- In flexcoders@yahoogroups.com, "Jeff Vroom" <[EMAIL PROTECTED]> wrote:
>
> My apologies for the Hibernate problems y'all have been having.  We do
> have a bunch of users happily using this for relatively simple use cases
> but as your domain models grow in complexity, you may run into some
> problems.
> 
>  
> 
> Here are the set of problems I currently know about.  
> 
>  
> 
> 1)   unique object exceptions during "updateItem".  The one case
> where I know this will happen is if you have hibernate associations
> which do not have corresponding FDS associations (i.e. the hierarchical
> values).  This should be supported and it turns out that the fix for the
> problem is to use hibernate's "merge" method instead of trying to do the
> merge by hand as is done in 2.0.1's updateItem method.   The code in
> updateItem that is causing the bulk of this problem is the code which
> fetches the current server version to do conflict detection.  In doing
> that, it creates hibernate instances in the session which may conflict
> with instances that get sent in by the client.  Hibernate's "merge"
> method takes care of all of this for us.
> 
> 2)   Domain objects need id/equals test which is based on the id.
> Some of the code in the hibernate assembler is using the "equals" method
> when it should be comparing the id properties.  You can workaround this
> by having equals and hashCode methods which are based on the id.
> 
> 3)   "Session closed" errors trying to fetch associations when we
> are writing objects to the client.   I'm not sure why the current
> "fetchObjectProperties" method is not fetching these objects for some
> people's domain model but if anyone has a test case which can reproduce
> this I'm interested.   It should be walking down all public properties
> and fetching them - the same way that our serialization code is working
> but somehow I must be missing something in the traversal code.  
> 
>  
> 
> There is a public beta coming out fairly soon which will have 1) and 2)
> fixed.   I haven't had a chance to backport these fixes to a version of
> the hibernate assembler which works in 2.0.1 but if there is enough
> demand (and I can find enough time!) I could probably do that.  Of
> course I'd rather get anyone running into trouble on the beta so we can
> make sure that version is solid.
> 
>  
> 
> Jeff
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Friday, February 23, 2007 2:47 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: FDS/Hibernate Sample of updating hierarchical
> list of values
> 
>  
> 
> PW, BTW pop over to the FDS forum at Adobe
> 
> http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=60&c
> atid=583
> <http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=60&;
> catid=583> 
> 
> take a look at the thread called 
> 
> "Parent Child Hierarchy with FDS and Hibernate"
> 
> SP
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "simonjpalmer" 
> wrote:
> >
> > PW and Jeff,
> > 
> > PW, you and I seem to be in the same boat. I am trying to fight off
> > the people who were flex skeptics to start with. Not being able to
> > write data back makes the whole thing look pretty amateur and confirms
> > people's belief that the technology isn't ready - which given this
> > experience it clearly isn't. The baby is definitely at risk of being
> > thrown out with the bath water. It stands in our company simply
> > because I have the final call as Technical Director (CTO if you are in
> > the US).
> > 
> > I am a huge flex advocate and really doing my best to evangelise on
> > the topic. What's more I t

[flexcoders] Re: FDS/Hibernate - LazyInitializationException when writing AMF output

2007-02-25 Thread simonjpalmer
Eric,

I am also very interested in getting on a beta program too.  I have
sent you an email with contact details for me.

Regards
Simon

--- In flexcoders@yahoogroups.com, "Eric D Anderson" <[EMAIL PROTECTED]> wrote:
>
> Hi PW,
> 
>  
> 
> I'd suggest that we add you to the latest Data Services beta because
> either we have fixed this issue, or we will fix this issue in the next
> release.  Can you contact me off-list and I'll add you to the beat so
> you can test DS with the latest DS and hibernate assembler.
> 
>  
> 
> Thanks
> 
> 
> Eric
> 
>  
> 
> Flex PM
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of parkerwhirlow
> Sent: Friday, February 16, 2007 7:06 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: FDS/Hibernate - LazyInitializationException
> when writing AMF output
> 
>  
> 
> This is happening from FDS... flex.data.assemblers.HibernateAssembler
> uses a function called fetchObjectProperties() that's supposed to load
> them all while the session is open right?
> 
> I've seen in other posts that FDS eager fetches the properties in the
> Assembler, so that they are available during serialization... 
> 
> am I missing something here?
> 
> thanks,
> PW
> 
> --- In flexcoders@yahoogroups.com 
> , Dima Gutzeit  wrote:
> >
> > Hi,
> > 
> > You have to initialize the collections before AMF serializes them. The
> 
> > problem occurs since you closing Hibernate session without first 
> > initializing the arrays, and since you are using lazy initialization
> the 
> > problem arise.
> > 
> > You have two options :
> > 
> > 1. Use lazy=false
> > 2. Better one, is calling
> /Hibernate.initialize(your_array_reference);/ 
> > before you close the Hibernate session.
> > 
> > Regards,
> > Dima Gutzeit.
> > 
> > parkerwhirlow wrote:
> > >
> > > Hi again =)
> > >
> > > I've just started getting this exception inconsistently... sometimes
> > > it happens 3 times in a row, other times I can go all afternoon
> > > without getting it. Once the exception occurs, it will occur every
> > > time the client loads until FDS is restarted.
> > >
> > > Note this occurs on multiple collections. I tried setting the
> > > "offending" collection to lazy=false (in Hibernate), and the
> exception
> > > occurred on a different collection. I can't set every one of my
> > > collections to lazy=false. Especially since at this point, they HAVE
> > > to be lazy for the updateItem via hierarchical values to almost
> work.
> > >
> > > I also noticed that the collection does not necessarily need to have
> > > any items in it. (And possibly is caused specifically by NOT having
> > > any items in it, I can't tell for sure). The collection referenced
> in
> > > the exception below has no values, and there's another collection in
> > > that same class with values that doesn't seem to cause the
> exception.
> > >
> > > See below the hibernate mapping, and exception output when this
> > > occurs. (Note there are no FDS managed associations for this
> collection)
> > >
> > > Thanks for any insight you have as to what is causing this.
> > >
> > > PW
> > > _
> > >
> > > 
> > > 
> > > 
> > > 
> > >  > > inverse="false"
> > > cascade="all-delete-orphan" >
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ...
> > > 
> > >
> > > 10:19:42,093 WARN ProxyWarnLog - Narrowing proxy to class
> > > config.test.Adult - this operation breaks ==
> > > 10:19:44,687 ERROR LazyInitializationException - failed to lazily
> > > initialize a collection of role: config.test.Adult.children, no
> > > session or session was closed
> > > org.hibernate.LazyInitializationException: failed to lazily
> initialize
> > > a collection of role: config.test.Adult.children, no session or
> > > session was closed
> > > at
> > >
> org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializ
> ationException(AbstractPersistentCollection.java:358)
> > > at
> > >
> org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializ
> ationExceptionIfNotConnected(AbstractPersistentCollection.j
> > > ava:350)
> > > at
> > >
> org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractP
> ersistentCollection.java:97)
> > > at
> > > org.hibernate.collection.PersistentSet.size(PersistentSet.java:139)
> > > at java.util.ArrayList.(ArrayList.java:133)
> > > at
> > > flex.messaging.io.ArrayCollection.(ArrayCollection.java:44)
> > > at
> > >
> flex.messaging.io.amf.Amf3Output.writeArrayCollection(Amf3Output.java:40
> 7)
> > > at
> > > flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:147)
> > > at
> > >
> flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:215
> )
> > > at
> > >
> flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:495)
> > > at
> > >
> flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:467)
> > > at
> > > flex.messaging.io.amf.Amf3Output.writeObject(Amf

[flexcoders] Suspending data bindings during (lazy) server read

2007-03-14 Thread simonjpalmer
I am transfering the head of a hierarchy of objects to the client for
them to choose which one they want to see details for.  The list
returned in this initial fetch is bound to a datagrid control, and
some of the data items are displayed in the grid.  The rest of the
data is loaded lazily through a destination via the java assembler. 
Once a request for the rest of the object is received I do return
quite a lot of data and it can take up to 2 seconds for the response
to arrive back at the client.

One immediate question is how I show a progress bar or a wait cursor
while this operation is occurring.  In all honesty I would prefer it
was synchronous but I can't seem to force that to happen.

So, I have a partially loaded object and when the remainder of the
data does finally show up I recalculate some of the fields that I am
displaying in the orginal data grid because they may be stale.  What I
have found is that I get a stack overflow where the data binding
manager is busy watching changes to the members of the class that I am
busy re-calculating.  During recalculation I get an itemPending error
which causes my recalc function to be re-called which touches the
bound data items which causes the data binding manager to kick off
again.  And round and round we go until I either run out of stack
space or the server stuff returns just in time and my data show up.

I have tried to separate out the activities so there is no binding
during loading, but this is causing me some horrible usability issues
and seems to be a bad way of approaching the problem.  What's more the
asynchronous nature of the server interaction is such that I can't
tell when exactly I'm going to receive the data (I have to rely on
trapping itemPending errors) so I don;t really know when it is safe to
re-bind.

What I would like to be able to do is just suspend the data bindings
in the client code while the lazy loading is taking place, and then
re-bind when I know I have all the data.

Any hints or architectural suggestions would be greatly appreciated.

SP



[flexcoders] Re: Component Required

2007-03-24 Thread simonjpalmer
Did you find one?  I'd be interested in one too...

--- In flexcoders@yahoogroups.com, "Kumar" <[EMAIL PROTECTED]> wrote:
>
> Hi All,
> 
>  
> 
> I want some example for stock ticker or component for the same if
some one
> has already created that or 
> 
>  
> 
> have some API through which I can implement stock ticker in flex.
> 
>  
> 
> For refrence (yahoo stock ticker).
> 
>  
> 
> Thanks
> 
> Kumar
>




[flexcoders] Whatever happened to Peter Ent's scrolling text ticker?

2007-03-24 Thread simonjpalmer
Anyone know what became of it?  The markme.com code link on his blog
leads nowhere.  Anyone have the code they could share with me?

http://weblogs.macromedia.com/pent/archives/2004/12/ticker.cfm

Thanks

Simon



[flexcoders] Re: Whatever happened to Peter Ent's scrolling text ticker?

2007-03-26 Thread simonjpalmer
Thanks!  Simple when you see it, but I didn't know about the magic
doLater() function...  sometimes the simplest things are the best.

As a matter of interest has anyone used this approach for handling
lazy loading of data?

--- In flexcoders@yahoogroups.com, Steve Hagenlock <[EMAIL PROTECTED]> wrote:
>
> http://weblogs.macromedia.com/pent/archives/flex/ticker/tickerText.zip
> 
> simonjpalmer wrote:
> > Anyone know what became of it?  The markme.com code link on his blog
> > leads nowhere.  Anyone have the code they could share with me?
> >
> > http://weblogs.macromedia.com/pent/archives/2004/12/ticker.cfm
> >
> > Thanks
> >
> > Simon
> >
> >
> >   
> >

> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date:
3/23/2007 3:27 PM
> >
>




[flexcoders] Re: Two-Way Binding Solutions?

2007-03-26 Thread simonjpalmer
You are right, it is because your model.pendingContact and
model.newContact are object references and not object instances.  When
you do the assignment you are just pointing them to the same object in
memory - 2 references, 1 object.  In your second case you create a
second object, 2 objects, 2 references.  This is a familiar concept if
you have spent any time coding in Java.

I'm willing to bet you won't find a cloning technique that will really
suit your purposes (but then I enjoy a flutter).  From personal
experience I am yet to find a use for cloning that I have stuck with.
 I have used it in Java but every time I have thought it was a
solution it turned out not to be because of some logical constraint in
the data.   Most likely there will be some logic implicit in the
member variables or your object (such as id's etc) that it would not
be safe to simply clone.  If you have a complex object containing an
array what would you expect it to do?  I generally resort to
intelligent copying and a self-impose standard interface across my
code to copy (I used to use overloaded = operators and copy
constructurs in C++ but that's the very distant past).

For the case that you cite you must be binding the individual members
of your VO to form fields to display their values.  One approach is to
trap the  key on those fields and apply the new values back to
the object.  That way you only need a single object and its state is
represented by the fields in your form...


...
private function saveName():void{myVOContact.name=txt_Name.text;}
...

You might wind up with lots of little saveX() functions but that
wouldn't be the end of the world.  

Alternatively you could probably also bind the assignment directly...



Not every control support the enter event but there is normally some
analogue, such as a combo closing or a checkbox state changing or a
radio button being selected that will do just as well.

A third method involves putting a submit button on the page.  When
clicked, manually transfer the data from the form fields to your VO
and post back to the server.

Unless you are measuring the changes in your data I'm not seeing the
value of a second object instance (yippee, no clone).

--- In flexcoders@yahoogroups.com, Kevin <[EMAIL PROTECTED]> wrote:
>
> i think my problem boils down to one of object cloning.  Does anyone  
> have a good solution for deep cloning objects in AS3?  Seems like  
> this would be a pretty useful utility.
> 
> - Kevin
> 
> 
> 
> On Mar 26, 2007, at 1:50 PM, Kevin wrote:
> 
> > I have trying to figure out how best to accomplish the two-way data
> > binding needed for form entry. Here is what I thought would work,
> > but it doesn't seem to:
> >
> > ON MODEL:
> > I created two variables that hold my VO.
> >
> > model.pendingContact
> > model.newContact
> >
> > The user clicks a button to get ContactVO data from the server. In
> > the command class I assign the result (which is a typed PHP
> > ContactVO) to each variable:
> >
> > model.pendingContact = data.result;
> > model.newContact = data.result;
> >
> > I then bind my form fields to "model.pendingContact" so that the
> > existing values from the server show up in the TextInput fields.
> >
> > Lastly, I use the BindingUtil methods to bind the "text" property of
> > the TextInput fields back to "model.newContact" so that I can record
> > any changes and send them back to the server.
> >
> > When the user submits the form, "model.pendingContact" should hold
> > the old values & "model.newContact" should have the new values.
> > Correct??
> >
> > Am I overlooking something. The only way I can get this to work is
> > if I don't assign "model.newContact" to the values from the server
> > and instead create a new instance like this:
> >
> > model.pendingContact = data.result;
> > model.newContact = new ContactVO;
> >
> > However, I can't do this because I need the newContact to start out
> > with the old values from the server. Is there a duplicate or clone
> > object method that I need to use so that both model variables can be
> > assigned to the same object from the server??
> >
> > Thanks for the help.
> >
> > - Kevin
> >
> >
>




[flexcoders] Re: Whatever happened to Peter Ent's scrolling text ticker?

2007-03-27 Thread simonjpalmer
any particular reason why?

--- In flexcoders@yahoogroups.com, "Gordon Smith" <[EMAIL PROTECTED]> wrote:
>
> I recommend using a Timer rather than calling doLater().
>  
> - Gordon
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Monday, March 26, 2007 12:39 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Whatever happened to Peter Ent's scrolling
> text ticker?
> 
> 
> 
> Thanks! Simple when you see it, but I didn't know about the magic
> doLater() function... sometimes the simplest things are the best.
> 
> As a matter of interest has anyone used this approach for handling
> lazy loading of data?
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , Steve Hagenlock  wrote:
> >
> > http://weblogs.macromedia.com/pent/archives/flex/ticker/tickerText.zip
> <http://weblogs.macromedia.com/pent/archives/flex/ticker/tickerText.zip>
> 
> > 
> > simonjpalmer wrote:
> > > Anyone know what became of it? The markme.com code link on his blog
> > > leads nowhere. Anyone have the code they could share with me?
> > >
> > > http://weblogs.macromedia.com/pent/archives/2004/12/ticker.cfm
> <http://weblogs.macromedia.com/pent/archives/2004/12/ticker.cfm> 
> > >
> > > Thanks
> > >
> > > Simon
> > >
> > >
> > > 
> > >
> --
> > >
> > > No virus found in this incoming message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date:
> 3/23/2007 3:27 PM
> > >
> >
>




[flexcoders] Scaling font size with Window size

2007-03-29 Thread simonjpalmer
does anyone know how, or has anyone tried, to scale fonts with the
size of the browser window?  What I am looking for is a method to make
the fonts a constant proportion of the size of the window so that the
whole of my app appears to scale like an image when the window size
changes.

At the moment all my controls compress nicely and in a well-behaved
fashion and there is good control over that from within the properties
of controls, but the font sizes all stay the same and it looks a bit
silly (and causes unnecessary and useless scroll bars to start appearing)

I thought about binding the font size of controls to a function which
itself is bound to the window size, but I'm not exactly sure how I
should go about that, and I'm not completey sure it would survive a
resize.

Anyone have any clues?

SP



[flexcoders] Anyone have a good example of an RSS feed reader?

2007-03-29 Thread simonjpalmer
I have been scratching around and found the as3syndicationlib but I
have seen no decent examples of how to use it and have to confess to
being a bit lost.



[flexcoders] Re: Scaling font size with Window size

2007-03-29 Thread simonjpalmer
hmm, any idea what value it takes by default?

I don't quite see how this helps, but thanks for the tip, I'll go do
some digging.

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Checkout stage.scaleMode
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Thursday, March 29, 2007 6:06 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Scaling font size with Window size
> 
> 
> 
> does anyone know how, or has anyone tried, to scale fonts with the
> size of the browser window? What I am looking for is a method to make
> the fonts a constant proportion of the size of the window so that the
> whole of my app appears to scale like an image when the window size
> changes.
> 
> At the moment all my controls compress nicely and in a well-behaved
> fashion and there is good control over that from within the properties
> of controls, but the font sizes all stay the same and it looks a bit
> silly (and causes unnecessary and useless scroll bars to start
> appearing)
> 
> I thought about binding the font size of controls to a function which
> itself is bound to the window size, but I'm not exactly sure how I
> should go about that, and I'm not completey sure it would survive a
> resize.
> 
> Anyone have any clues?
> 
> SP
>




[flexcoders] Re: Looking for a Wizard custom component

2007-03-31 Thread simonjpalmer
Not quite that sophisticated, but I have a framework which has a prev,
next, cancel and finish button and into which you can drop any
controls.  I'd happily share it with you and you can probably extend
it for your purposes.

Send me an email to simon.palmer @ gmail.com and I'll send you the code.

SP

--- In flexcoders@yahoogroups.com, "tedgcisco" <[EMAIL PROTECTED]> wrote:
>
> Has anyone created a custom component that is a wizard?  In other
> words, has anyone played around with making a Flex component that
> defines a wizard that, for example, supports conditional flow, has an
> index displayed in the left side of how many wizard steps there are,
> the right pane has the content, and the navigation buttons at the
bottom.
> 
> I'm looking for something that looks like JIDESoft's Swing wizard
> component.
> 
> Any advice/help is much appreciated!  I created a quick prototype that
> resembles the JIDESoft's wizard, but I am new to Flex and my prototype
> is not very good :^)
> 
> thanx
> 
> -Ted-
>




[flexcoders] Re: Accessing the parent component properties

2007-04-01 Thread simonjpalmer
I favour events.  I have just spent the weekend switching from a
(solely) central controller model to an event driven model and here's
why.  

Every time anything happened through a user gesture which changed the
state of something in the controller, every binding got updated (as
you would expect).  As my application became more complex this became
an increasing overhead and I found myself more and more susceptible to
timing issues (especially with lazily loaded server side data).  

I may have been doing something wrong but I had a few seconds of
binding update on some changes to central pieces of data.  It was only
getting worse too.

In addition I had liberal sprinklings of casts of parentApplication or
some such back reference throughout my code to bindable variables in
the central controller.
 
It just felt wrong to be hooking up my nicely objectified components
to some artefact of the circumstance in which they are being used. 
This is exactly the opposite way that the Java world is going with the
likes of Spring and once you have reaped the benefits of that approach
it is very hard to go back.  

I suppose I have a philosophical objection to doing that so part of my
re-architecture was to remove a lot of these implementation
dependencies and a nice corollary (which I think justifies my weekend
working) is that I now have less code overall, some re-usable
libraries and a faster app.

I'm not saying that flex/AS in and of itself causes these problems but
it is easy to fall back on a central controller model and it is a bit
like having loads of global variables.  It gets you going in a hurry
but is not really sustainable.

That's my experience so far anyway.  

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Many folks prefer a model/view or model/view/controller architecture and
> use databinding to hook up to a central model or controller.
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of stephen50232
> Sent: Saturday, March 31, 2007 5:08 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Accessing the parent component properties
> 
> 
> 
> Hi,
> 
> I have a system which I'm building using a series of components, all 
> called from within the Main.mxml file. What is the best method for 
> components to access the properties of the Main.mxml file. For example 
> if I change the state or amend the selected section of a viewstack?
> 
> Is it best to use events?
>




[flexcoders] Labelling the bubbles of a bubble chart

2007-04-01 Thread simonjpalmer
I want to put a data value alongside the bubbles on my bubble chart. 
Anyone know how?  Ideally I would have something that was a cross
between a tooltip and the flyout labels on a pie chart.

Any clues?



[flexcoders] question about string equality

2007-04-02 Thread simonjpalmer
take a look at this code snippet...

01 // check one doesn't already exist with this name
02 bFound = false;
03 for (isc = 0; isc < ss.scenarios.length && !bFound; isc++)
04 {
05  sc = Scenario(ss.scenarios.getItemAt(isc));
06  if (sc.name.valueOf() == oc.category.valueOf()) bFound = true;
07 }
08 if (!bFound)
09 {
10  // Make a new scenario
11  sc = PlanPointFactory.makeScenario(uli, null, true, false);
12
13  // add it to the snapshot
14  ss.addScenario(sc);
15
16  // add it to the local array of categories
17  oc.objects.push(sc);
18 }

line 06 is the offending line.

if I have:

06  if (sc.name == oc.category) bFound = true;

the bFound flag never gets set true.  I have to have the valueOf()
function in order for the equality to fire correctly.

This is not what I expected.  I thought that regular equality would
have sufficed here since sc.name and oc.category are both Strings.

Why am I wrong and why do I need valueOf()?





[flexcoders] Re: question about string equality

2007-04-04 Thread simonjpalmer
Good point, I didn't include the declarations.  

They are both strongly typed Strings, I don't use objects anywhere in
my code.

co is a custom AS object of type "Competitor", here's the declaration
of the name member:

public var name:String;

oc is a custom AS object of type "ObjectCategory" and here is the
declaration of the category member:

public var category:String = new String();

The strong typing answers the question about whether they just happen
to contain strings.

Other than the fact that they belong to custom objects I have written,
there is nothing peculiar about either the string variables or their
contents.

I don't think they are in a custom namespace, but to be honest I'm not
exactly sure what that means, so I can't say with certainty that they
aren't.  I think the answer is no.

co.name gets populated by various means, either though a user gesture
in a custom page or by retrieval from a java data adaptor to my
server.  oc.category is populated programmatically during execution of
the code in question.

I appreciate you guys looking at this.  Right now I have it working as
I expect but it is a bit worrying that I need to do the comparison in
this way only in this instance.  That says to me that I don't properly
understand something.

If I want to check equality of the content of two strings should I
always be testing valueOf()?  

What is the overhead of using ===?

--- In flexcoders@yahoogroups.com, "Peter Farland" <[EMAIL PROTECTED]> wrote:
>
> What are the type declarations of the properties sc.name and
> sc.category? Do they just happen to hold String values or are they typed
> to enforce that they hold String values? Is there anything else unique
> about these properties? Are they in a custom namespace? Are they
> read-only? How were they populated in the first place?
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Monday, April 02, 2007 6:14 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] question about string equality
> 
> 
> 
> take a look at this code snippet...
> 
> 01 // check one doesn't already exist with this name
> 02 bFound = false;
> 03 for (isc = 0; isc < ss.scenarios.length && !bFound; isc++)
> 04 {
> 05 sc = Scenario(ss.scenarios.getItemAt(isc));
> 06 if (sc.name.valueOf() == oc.category.valueOf()) bFound = true;
> 07 }
> 08 if (!bFound)
> 09 {
> 10 // Make a new scenario
> 11 sc = PlanPointFactory.makeScenario(uli, null, true, false);
> 12
> 13 // add it to the snapshot
> 14 ss.addScenario(sc);
> 15
> 16 // add it to the local array of categories
> 17 oc.objects.push(sc);
> 18 }
> 
> line 06 is the offending line.
> 
> if I have:
> 
> 06 if (sc.name == oc.category) bFound = true;
> 
> the bFound flag never gets set true. I have to have the valueOf()
> function in order for the equality to fire correctly.
> 
> This is not what I expected. I thought that regular equality would
> have sufficed here since sc.name and oc.category are both Strings.
> 
> Why am I wrong and why do I need valueOf()?
>




[flexcoders] Re: Labelling the bubbles of a bubble chart

2007-04-04 Thread simonjpalmer
Thanks Ely,

for now I think I am stuck with option 1, just because of time.

If I were to embark on 3, which sounds like the right solution, can
you give me some pointers on where to start looking before I dive off
into the jungle and get hopelessly lost.

Thanks
Simon

--- In flexcoders@yahoogroups.com, "Ely Greenfield" <[EMAIL PROTECTED]> wrote:
>
>  
>  
> three ways, in order of difficulty:
>  
> 1) custom bubble renderer.  easy to do, but hard to do anything smart so
> the labels don't overlap.
> 2) custom annotation using the post from my blog.  Easy to do, but not
> the most efficient approach.
> 3) custom bubble series. Requires rolling up your sleves and getting
> into the series code, but most performant, and reusable.
>  
> Ely.
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Sunday, April 01, 2007 3:35 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Labelling the bubbles of a bubble chart
> 
> 
> 
> I want to put a data value alongside the bubbles on my bubble chart. 
> Anyone know how? Ideally I would have something that was a cross
> between a tooltip and the flyout labels on a pie chart.
> 
> Any clues?
>




[flexcoders] "implements", "include", MX and AS...

2007-04-04 Thread simonjpalmer
I have an interface definition and an AS include file which contains a
concrete implementation which I include in various places around my
code.  For all my AS classes this is a very economical programming
model which I have used to great effect.

I just tried to use it for an MX control and I get a compilation
message saying that my MX component has no implementation in spite of
the fact that I am explicitly including it in the script portion of
the code.

Here is a snipped version of what I am doing...

package pmco.interfaces
{
...
public interface IActionsOwner
{
...
function addAction(a:Action):void;
...
}
}

I have an include file in which I have some impementations,
ConcreteActionOwner.as

...
public function addAction(a:Action):void
{
if (actions == null) actions = new ArrayCollection();
actions.addItem(a);
}
...

In regular AS classes I can do this...

public class X implements IActionsOwner
{
include "ConcreteActionOwner.as"
}

and the compiler is happy.  However when I do this...

http://www.adobe.com/2006/mxml"; 
implements="pmco.interfaces.IActionOwner">




I get a compiler error that my class based on Canvas does not contain
an implementation of IActionOwner.

Anyone know whether I can do this and how?




[flexcoders] Re: "implements", "include", MX and AS...

2007-04-04 Thread simonjpalmer
Just tried that, doesn't appear to make any difference.

--- In flexcoders@yahoogroups.com, "Brian Holmes" <[EMAIL PROTECTED]>
wrote:
>
> Add import pmco.interfaces.IActionOwner in  your code block
> 
>  
> 
>  
> 
> b..
> 
>  
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Wednesday, April 04, 2007 1:27 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] "implements", "include", MX and AS...
> 
>  
> 
> I have an interface definition and an AS include file which contains a
> concrete implementation which I include in various places around my
> code. For all my AS classes this is a very economical programming
> model which I have used to great effect.
> 
> I just tried to use it for an MX control and I get a compilation
> message saying that my MX component has no implementation in spite of
> the fact that I am explicitly including it in the script portion of
> the code.
> 
> Here is a snipped version of what I am doing...
> 
> package pmco.interfaces
> {
> ...
> public interface IActionsOwner
> {
> ...
> function addAction(a:Action):void;
> ...
> }
> }
> 
> I have an include file in which I have some impementations,
> ConcreteActionOwner.as
> 
> ...
> public function addAction(a:Action):void
> {
> if (actions == null) actions = new ArrayCollection();
> actions.addItem(a);
> }
> ...
> 
> In regular AS classes I can do this...
> 
> public class X implements IActionsOwner
> {
> include "ConcreteActionOwner.as"
> }
> 
> and the compiler is happy. However when I do this...
> 
>  xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml> " 
> implements="pmco.interfaces.IActionOwner">
> 
> 
> 
> 
> I get a compiler error that my class based on Canvas does not contain
> an implementation of IActionOwner.
> 
> Anyone know whether I can do this and how?
> 
>  
> 
> 
> 
> ***
> The information in this e-mail is confidential and intended solely
for the individual or entity to whom it is addressed.  If you have
received this e-mail in error please notify the sender by return
e-mail delete this e-mail and refrain from any disclosure or action
based on the information.
> ***
>




[flexcoders] Re: Save to database

2007-04-04 Thread simonjpalmer
If you are connecting to a db on the server then you have a couple of
obvious choices.  

1. You can use the built-in capabilities of flex data services which
will manage the modifications for you and only notify your server
components of changes.  
2. You can use an ORM like Hibernate to do the same thing between your
server code and the RDBMS.  
3. You can write all that code yourself.

You can in fact combine any or all of them too.  There are probably
other options too, but one of these ought to do you.

It is generally bad practice for you to be truncating your data before
writing.  Unless you are absolutely sure the data is that transient
you shouldn't do it.

I suggest you do a bit of reading about FDS in the Flex docs.  Also it
is probably worth picking up a book on Hibernate and giving it a
thorough read, especially regarding transactions and commit strategies.

SP.

--- In flexcoders@yahoogroups.com, "nxzone" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> I don't know how I can save a lot of content that can be modified or
not. 
> 
> First, when we load all the content from database for a timeline(main
> object) and transfert all these table to many Objects in flex.
> 
> [Bindable]
> TimelineModelLocator
> dateType
> presentation
> from
> to
> divisions (arraycollection with object)
> autors (arraycollection with object)
> layerData (arraycollection with object)
> categoryData (arraycollection with object)
> entryData (arraycollection with object)
> ...
>  
> The user can modify all content, remove items, add items. When the
> user click "save all", what is the best to do?
> 
> Remove all what was in the database and save the new content in all
> tables.
> 
> Loop in all object and compare a checksum to know what have been
> modify/added/deleted...
> 
> Other idea??
>




[flexcoders] Re: "implements", "include", MX and AS...

2007-04-04 Thread simonjpalmer
good spot Peter.  I inserted a class in my inheritance hierarchy which
does the interface specification and incorporates the concrete
implementations too through include.  This seems to work but it is
pretty inelegant.  Not that I'm complaining about that.

Thanks for the reply.


--- In flexcoders@yahoogroups.com, "Peter Farland" <[EMAIL PROTECTED]> wrote:
>
> Can you avoid using include and perhaps use MXML to extend a custom AS
> base class that implements your interface and still extends Canvas?
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Wednesday, April 04, 2007 4:23 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: "implements", "include", MX and AS...
> 
> 
> 
> Just tried that, doesn't appear to make any difference.
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "Brian Holmes" 
> wrote:
> >
> > Add import pmco.interfaces.IActionOwner in your code block
> > 
> > 
> > 
> > 
> > 
> > b..
> > 
> > 
> > 
> > 
> > 
> > ____
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of simonjpalmer
> > Sent: Wednesday, April 04, 2007 1:27 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] "implements", "include", MX and AS...
> > 
> > 
> > 
> > I have an interface definition and an AS include file which contains a
> > concrete implementation which I include in various places around my
> > code. For all my AS classes this is a very economical programming
> > model which I have used to great effect.
> > 
> > I just tried to use it for an MX control and I get a compilation
> > message saying that my MX component has no implementation in spite of
> > the fact that I am explicitly including it in the script portion of
> > the code.
> > 
> > Here is a snipped version of what I am doing...
> > 
> > package pmco.interfaces
> > {
> > ...
> > public interface IActionsOwner
> > {
> > ...
> > function addAction(a:Action):void;
> > ...
> > }
> > }
> > 
> > I have an include file in which I have some impementations,
> > ConcreteActionOwner.as
> > 
> > ...
> > public function addAction(a:Action):void
> > {
> > if (actions == null) actions = new ArrayCollection();
> > actions.addItem(a);
> > }
> > ...
> > 
> > In regular AS classes I can do this...
> > 
> > public class X implements IActionsOwner
> > {
> > include "ConcreteActionOwner.as"
> > }
> > 
> > and the compiler is happy. However when I do this...
> > 
> >  > xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml> 
> > <http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> > " 
> > implements="pmco.interfaces.IActionOwner">
> > 
> > 
> > 
> > 
> > I get a compiler error that my class based on Canvas does not contain
> > an implementation of IActionOwner.
> > 
> > Anyone know whether I can do this and how?
> > 
> > 
> > 
> > 
> > 
> > ***
> > The information in this e-mail is confidential and intended solely
> for the individual or entity to whom it is addressed. If you have
> received this e-mail in error please notify the sender by return
> e-mail delete this e-mail and refrain from any disclosure or action
> based on the information.
> > ***
> >
>




[flexcoders] Re: question about string equality

2007-04-05 Thread simonjpalmer
huh, thanks again Pete, I am obviously have my Java roots showing. 
This is the sort of thing that it is hard to get to know about AS3
without coding for some time, and I am relatively new to it.

How do I distinguish between types that need initialisation through
new and those that don't?  For instance an ArrayCollection needs a new
whereas a Number (and apparently a String) does not.  I naively
considered them all to be objects and as such need initialising,
although I am clearly not religious about it in my code.

I have also long wondered about primitives in AS3.  What is an int? 
What primitives are there?  What is a Boolean?

Is there a good reference source for this sort of AS3 information?  I
think I have travelled far enough that it is about time I went back to
the beginning.

--- In flexcoders@yahoogroups.com, "Peter Farland" <[EMAIL PROTECTED]> wrote:
>
> I would guess that === is actually faster than == as the latter has to
> check whether it needs to perform any casting before checking equality. 
>  
> Out of curiousity, have you tried to use "" instead of new String() to
> initialize category (it's unconventional to use new String() in AS3)?
>  
> Otherwise, you could send the complete source in a bug for the team to
> take a look.
>  
> Pete
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Wednesday, April 04, 2007 12:42 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: question about string equality
> 
> 
> 
> Good point, I didn't include the declarations. 
> 
> They are both strongly typed Strings, I don't use objects anywhere in
> my code.
> 
> co is a custom AS object of type "Competitor", here's the declaration
> of the name member:
> 
> public var name:String;
> 
> oc is a custom AS object of type "ObjectCategory" and here is the
> declaration of the category member:
> 
> public var category:String = new String();
> 
> The strong typing answers the question about whether they just happen
> to contain strings.
> 
> Other than the fact that they belong to custom objects I have written,
> there is nothing peculiar about either the string variables or their
> contents.
> 
> I don't think they are in a custom namespace, but to be honest I'm not
> exactly sure what that means, so I can't say with certainty that they
> aren't. I think the answer is no.
> 
> co.name gets populated by various means, either though a user gesture
> in a custom page or by retrieval from a java data adaptor to my
> server. oc.category is populated programmatically during execution of
> the code in question.
> 
> I appreciate you guys looking at this. Right now I have it working as
> I expect but it is a bit worrying that I need to do the comparison in
> this way only in this instance. That says to me that I don't properly
> understand something.
> 
> If I want to check equality of the content of two strings should I
> always be testing valueOf()? 
> 
> What is the overhead of using ===?
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "Peter Farland"  wrote:
> >
> > What are the type declarations of the properties sc.name and
> > sc.category? Do they just happen to hold String values or are they
> typed
> > to enforce that they hold String values? Is there anything else unique
> > about these properties? Are they in a custom namespace? Are they
> > read-only? How were they populated in the first place?
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of simonjpalmer
> > Sent: Monday, April 02, 2007 6:14 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] question about string equality
> > 
> > 
> > 
> > take a look at this code snippet...
> > 
> > 01 // check one doesn't already exist with this name
> > 02 bFound = false;
> > 03 for (isc = 0; isc < ss.scenarios.length && !bFound; isc++)
> > 04 {
> > 05 sc = Scenario(ss.scenarios.getItemAt(isc));
> > 06 if (sc.name.valueOf() == oc.category.valueOf()) bFound = true;
> > 07 }
> > 08 if (!bFound)
> > 09 {
> > 10 // Make a new scenario
> > 11 sc = PlanPointFactory.makeScenario(uli, null, true, false);
> > 12
> > 13 // add it to the snapshot
> > 14 ss.addScenario(sc);
> > 15
> > 16 // add it to the local array of categories
> > 17 oc.objects.push(sc);
> > 18 }
> > 
> > line 06 is the offending line.
> > 
> > if I have:
> > 
> > 06 if (sc.name == oc.category) bFound = true;
> > 
> > the bFound flag never gets set true. I have to have the valueOf()
> > function in order for the equality to fire correctly.
> > 
> > This is not what I expected. I thought that regular equality would
> > have sufficed here since sc.name and oc.category are both Strings.
> > 
> > Why am I wrong and why do I need valueOf()?
> >
>




[flexcoders] Re: question about string equality

2007-04-06 Thread simonjpalmer
that's really helpful, thanks for taking the time to reply in such detail

--- In flexcoders@yahoogroups.com, "Gordon Smith" <[EMAIL PROTECTED]> wrote:
>
> > I have also long wondered about primitives in AS3. What is an int? 
> > What primitives are there? What is a Boolean?
>  
> Here are the types where you don't need to (or can't) use the 'new'
> operator because AS3 has literal notation for values of that type:
>  
> int: 32-bit signed integer
>  
> var i:int; // i is 0 by default
> i = -7;
>  
> uint: 32-bit unsigned integer
>  
> var u:uint; // u is 0 by default
> u = 0xFFCC88;
>  
> Number: 64-bit floating-point number
>  
> var n:Number; // n is NaN (not 0) by default
> n = 99.9;
>  
> Boolean: true or false
>  
> var b:Boolean; // b is false by default
> b = true;
>  
> String: null or a sequence of 0 or more Unicode characters
>  
> var s:String; // s is null (not "") by default
> s = "abc";
>  
> Array: null or a reference to an instance of the Array class
>  
> var a:Array; // a is null (not []) by default
> a = [ 1, 2, 3 ];
>  
> Object: null or a reference to an instance of the Object class
>  
> var o:Object; // o is null (not {}) by default
> o = { a: 1, b: 2 };
>  
> Class: null or a reference to a class
>  
> import flash.display.DisplayObject;
> var c:Class; // c is null by default
> c = DisplayObject;
>  
> RegExp: null or a reference to a instance of the RegExp class
>  
> var r:RegExp; // r is null by default
> r = /\w+/; // same as r = new RegExp(\\w+  );
>  
> XML/XMLList: null or a reference to an instance of the XML/XMLList class
>  
> var x:XML; // x is null by default
> x = foo; // same as x = new XML("foo;");
>  
> - Gordon
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Peter Farland
> Sent: Thursday, April 05, 2007 8:37 AM
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] Re: question about string equality
> 
> 
> 
> Oops, I deleted part of a sentence, it should have been:
> 
> "or you're trying to do more and, say, cater for a case where you want
> the empty string and null to be equivalent as uninitialized states in
> your program"?
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> Behalf Of Peter Farland
> Sent: Thursday, April 05, 2007 11:23 AM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: RE: [flexcoders] Re: question about string equality
> 
> For AS3, I think it is fine to use the new operator in general - I was
> clutching-at-straws as to why something might be different in your
> scenario (largely because I know in AS2 there was a difference between
> "" and new String() as there was the concept of primitives and object
> forms of the string type and the object form wouldn't serialize
> correctly in AMF 0, for instance).
> 
> To be honest, I've lost track of the original question in this thread
> and am not sure whether you're just looking for the best way to compare
> strings in AS3 or you're trying to do more and, say, cater for a case
> where you want the empty string being to be equivalent to an
> uninitialized state in your program?
> 
> I know one scenario that can be confusing is this:
> 
> var s1:String = "";
> var s2:String = null;
> 
> if (s1)
> {
> trace("s1 was true"); 
> }
> 
> if (s2)
> {
> trace("s2 was true");
> }
> 
> Neither of these trace statements will execute. I always avoid this
> short-cut syntax because it leads to further confusion that all
> non-zero-length strings evaluate to true, and a string like "false" will
> just be seen as a String of length > 0 and hence true. To be safe, I
> always write the condition I'm trying to test explicitly...
> 
> if (s1 != null && s1 == "true")
> {
> //...
> }
> 
> Pete
> 
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> Behalf Of simonjpalmer
> Sent: Thursday, April 05, 2007 11:02 AM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] R

[flexcoders] Re: Finding / Displaying Values in a combo Box

2007-04-08 Thread simonjpalmer
here are some ideas...

second case first...

you could create a TermsCode object with the fields code and
description and a magic toString() function, something like this...

package blah
{
public class TermsCode
{
public var code:String;
public var description:String;
public function toString():String{return description;}
}
}

and populate it with whatever gets returned from your db call.  how
you do that will depend entirely on your data access tier.  Having
populated the array you can then just bind the dataProvider of your
combo to a collection of these classes and the display will be taken
from toString().  You can then either use selectedItem or
selectedObject on the combo object to manage your selection.

for the first one you have a couple of choices and you'll have to
decide how to go based on extensibility etc. of your app.  

Since there are so few things in your list you could just create a
static array of strings with your descripive text in it and
stick-handle the value of the selected index based on inspection of
the text field, i.e.

if (it = "A")
{
myCombo.selectedIndex = 1;
}
else if (it = "B")
{
myCombo.selectedIndex = 2;
}
etc.

If you wanted to be clever you could probably create an array of
objects indexed by the value of the letter using the somewhat
mysterious object syntax

var x:Object = {}

If you are afraid to tread in those murky waters (as I am) then there
is an interesting possible alternative offered here

http://www.ericfeminella.com/blog/2006/12/05/as3-hashmap-for-flex/

which is a hashmap.

best of luck.

--- In flexcoders@yahoogroups.com, "boy_trike" <[EMAIL PROTECTED]> wrote:
>
> I have an maintenance screen with a couple of combo boxes.  One of
> them has 4 static options, the other one is loaded from a database
> with about 40-50 choices.  Here is my question:
> 
> I want to display the "correct" values in the combo box after I read
> the record to be displayed.  What is the best way to "convert" my data
> from the file to the correct index / item in the combo box?  In the
> first case, I am storing a single character A,B,O or E and I have one
> of 4 strings / labels to be displayed.  In the 2nd case, I have a
> terms code (2 characters) and my query result returns terms code,
> description and I want the description displayed.
> 
> Thanks
> Bruce
>




[flexcoders] Standard approach for itemPendingError handling

2007-04-08 Thread simonjpalmer
does anyone have a standard approach for handling itemPendingError? 
In an asynchronous, lazy data loading app it seems to be a crucial
issue.  I have basically had to re-design my app because I can never
quite tell when the data is going to show up.  

Does anyone have and guidelines to follow or recommendations?  

So far I have just had to keep the code very flat and to have
everything repeatable when the data finally shows up and hope that the
user hasn't got bored or moved on.  Not really satisfactory.  Hope. 
Not a very good strategy...



[flexcoders] Passing an argument to DataService.commit()

2007-04-08 Thread simonjpalmer
Anyone know how I can do the equivalent of passing an argument to
commit()?

I understand that a lot goes on behind the scenes when commit() gets
called, but it would be very handy to be able to provide some sort of
context, such as credentials, which I could anticipate on the server
end of the commit.

What is the standard preocedure for detecting context of a set of
asynchronous server requests such as are fired by commit?

Any clues?  Any good reading material on the subject?  

Jeff, any ideas?

Simon



[flexcoders] Re: Flex Installation\Compilation Guidelines for AIX OS

2007-04-09 Thread simonjpalmer
I should start by saying that I have not done this with flex, but I
have both lead and been involved in many projects where we have had to
retro-fit to IBM.  The experience has been chastening and it is never
a straighforward task.  Have you got your AIX hardware up and running
with the IBM software actually operating yet?  Have you identified any
expertise either internally or externally who has experience in AIX? 
Have you teased out of your client (or whoever is requesting this
step) whether it stops at AIX or whether you need to go to DB2 and
WebSphere?  If not then go and do that first.

I'm not sure why you would need to compile any flex code under AIX. 
The only reason to do that would be if your clients were running their
browsers on AIX.  Is that the case?  The swf and html you generate in
flex is piped across to the client machine and run there inside the
FlashPlayer, not on the server.  So I don't think you need the Flex
Builder anywhere other than Windows (or maybe Mac if you prefer to
work on a Mac) because your clients are probably running IE on Windows.

As for the server, how you should do it and how hard your job will be
will depend upon the language you have implemented your server side
components in, the application server you are using and the features
of your app.  If you have a database my bet is the next question
you'll get asked is to put it on DB2 and WebSphere, it's part of the
IBM religious canon.

If you have a C++ back end then you'll need to get familiar with the
AIX compiler and get ready to have to change all your code.  If you
are C# I have no clue how you would go about it, although I bet there
is a story.  If you are Java you are in better shape, but watch out
for differences in XML parsers and compliance to "standard" interfaces
like SQL/JDBC.  IBM are as bad as Microsoft for implementing their own
versions of standards.

You have done the right thing by downloading the AIX server components
from Adobe.  Now you need to assemble your server in whatever AIX
technology is available.  Get AIX releases of your app server,
database etc. and get it all that stood up and running and delivering
pages of any kind.  You will probably find all sorts of challenges
with that alone if this is your first time with IBM.

Once you have done that, and presuming you have been reasonably well
behaved, then in theory you should be able to recompile your Java code
under AIX and it should run (in theory you should be able to just
deploy the same Java component, but that is very unlikely to work).  I
think you have enough work just to get there.  I suspect your
situation will either change or become clearer once you have got to
that point.

Best of luck
SP

Unrequested editorial comment:  If it wasn't for IBM strong-arming its
partners, AIX/DB2/WebSphere would have been consigned to the dustbin
years ago.  It's not that they are really that bad - although DB2 is a
bit of a nightmare - it's not even because they are very difficult and
subtle and the skills are not widely available - although that is all
true too, the real kicker is that there are better things out there
which are either free or lower cost.  The IBM "blue stack" only exists
because IBM would look very silly taking anything else into its
clients and it forces its partners and customers to comply because of
its size and because it wants license revenue from its software
products which it would otherwise never get.  Eventually this rigging
of the market will have to stop and I thought they had seen sense with
their investment in Linux, but the AIX dinosaur rolls on.

--- In flexcoders@yahoogroups.com, "sanjaypmg" <[EMAIL PROTECTED]> wrote:
>
> Hi All,
> 
> I have developed an application for windows... Its working fine 
> everywhere but now I have to make the whole application running on 
> AIX too... 
> 
> Can anyone tell me, how can I do it?
> 
> I mean What are the steps or some installation guidelines to compile 
> the MXMLs for AIX..
> 
> I have already downloaded "Flex Data Services 2 Express" for AIX 
> from ADOBE.com.
> 
> I have already "Flex Build for Windows", Do I need to download "Flex 
> Builder 2" for MAC or other OS?
> 
> Once I get these sofwares, which steps do I need to follow to make 
> my application working on AIX?
> 
> Please help to do the same.
> 
> Thanks in Advance
> SS
>




[flexcoders] Re: Flex Installation\Compilation Guidelines for AIX OS

2007-04-09 Thread simonjpalmer
I must be missing something obvious because I'm not seeing why you
would fiddle around with compiling mxml files on the server, just put
the binaries there.  I think this step needs looking at:

> 2. Compile MXML using Flex builder on AIX.

Is there a flex builder for AIX?  I doubt it and I don't really see
why you need it.  Flex builder will generate a *.swf file for you. 
That swf file runs in the FlashPlayer running in the browser of the
end user, not on the server.  The target O/S for the swf is Windows
unless your client is a very weird world of the end users having AIX
on their desktop.  If they do, turn the job down, change your phone
numbers and run in the opposite direction very fast :-)

Your application server just delivers the swf file to the end user's
browser.  What you do need is AIX software on the server end to
respond to the requests that the swf will make back to the server. 
That's what you downloaded when you went and got the Adobe fds for AIX.

What you need to do is get all the bits together on the AIX machine in
a WAR file which will run on AIX under the application server in
question.  Once you have done that, then try deploying it.

If you are expected to support this then you'll end up buying AIX
hardware, you'll have no choice.  

--- In flexcoders@yahoogroups.com, "sanjaypmg" <[EMAIL PROTECTED]> wrote:
>
> Hi SP,
> 
> Thanks for your quick response Though AIX hardware is up and 
> running at client end so that wouldn't be an issue.. Here we are 
> using Java components to communicate with the backend.
> 
> Actually this needs to be test at the client end so I need to tell 
> them some instruction to follow. I have made 2 scenarios to do the 
> same, which I have given below:
> 
> First of all you need to figure out whether Server is AIX and 
> Clients are Windows or Server is AIX and Clients are AIX as well.
> If the first scenario is implanted at ING, you need to configure FDS 
> with the swallowtech application on AIX and no need to compile MXML 
> file. If the second scenario is there, you will have to do both the 
> task:
> 
> 1. Configure FDS with SwallowTech application on AIX
> 2. Compile MXML using Flex builder on AIX.
> 
> 
> The steps to compile the file:
> 
> Once you through these steps:
> 
> 1 Make a fresh project using FlexBuilder. 
> 2 Place all the enclosed files in the same project folder.
> 3 Place the "assets" folder also from the existing 
> 4 path "swallowtech.war\jsp\work"
> 5 Open enclosed workFlowmonitor.mxml.
> 
> Since you have much experience in AIX and much expertise in AIX, 
> kindly suggest more scenarios or correct me if I am wrong somewhere.
> 
> It would be a great help from your side.
> 
> Thanks in Advance,
> SS
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "simonjpalmer"  
> wrote:
> >
> > I should start by saying that I have not done this with flex, but I
> > have both lead and been involved in many projects where we have 
> had to
> > retro-fit to IBM.  The experience has been chastening and it is 
> never
> > a straighforward task.  Have you got your AIX hardware up and 
> running
> > with the IBM software actually operating yet?  Have you identified 
> any
> > expertise either internally or externally who has experience in 
> AIX? 
> > Have you teased out of your client (or whoever is requesting this
> > step) whether it stops at AIX or whether you need to go to DB2 and
> > WebSphere?  If not then go and do that first.
> > 
> > I'm not sure why you would need to compile any flex code under 
> AIX. 
> > The only reason to do that would be if your clients were running 
> their
> > browsers on AIX.  Is that the case?  The swf and html you generate 
> in
> > flex is piped across to the client machine and run there inside the
> > FlashPlayer, not on the server.  So I don't think you need the Flex
> > Builder anywhere other than Windows (or maybe Mac if you prefer to
> > work on a Mac) because your clients are probably running IE on 
> Windows.
> > 
> > As for the server, how you should do it and how hard your job will 
> be
> > will depend upon the language you have implemented your server side
> > components in, the application server you are using and the 
> features
> > of your app.  If you have a database my bet is the next question
> > you'll get asked is to put it on DB2 and WebSphere, it's part of 
> the
> > IBM religious canon.
> > 
> > If you have a C++ back end then you'll need to get familiar with 
> the
> > AIX compiler and get ready to have to change all your code.  If you
> >

[flexcoders] Parent Child hierarchy of objects in FDS & Hibernate

2007-01-24 Thread simonjpalmer
I have a hierarchy of objects 

parent
-- child
 grandchild
-- greatgrandchild

they are persisted in separate tables and mapped in hibernate as
bi-directional one-to-many relationships.

In flex I have a destination which retrieves the parent objects and
hibernate takes care of retrieving the graph of objects which form the
parent-child tree.

I have a set of manages AS objects in my flex project corresponding to
a simple set of pojos on the server side.  I have bound the AS objects
to datagrids in my flash application.

If I update a parent object the alterations make it cleanly through to
my DB (HSQLDB instance for testing).  If I alter anything on any of
the subordinate objects I get an identity error thrown by Hibernate
and the update fails.  

I am looking for examples of parent child relationships expressed in
the destination definitions for the HibernatAssembler in FDS.  Anyone
tried this?  

I can't find any fds/hibernate examples out there that aren't
completely trivial.


 



[flexcoders] parent-child hierarchy of data using Flex, FDS and Hibernate

2007-01-29 Thread simonjpalmer
Hi,

I have a 4 level hierarchy of data in my application with a
bi-directional one-to-many relationship between each level as follows:

PlanPoint (parent)
-- UserScenario (child)
 Scenario (grandchild)
-- Competitor (great grandchild)

I have a hibernate back end running under JBoss and I am using FDS to
synchronise the changes from my Flex UI.  My DB will be Oracle, but
for the time being I am just testing with a HSQLDB for convenience.

I have managed to create a destination in FDS which will retrieve the
parent objects.  The hibernate mapping docs specify the further
retrieval of the graph of objects attached to them.  This all works
fine and performs reasonably well, although I have been unable to get
any meaningful lazy loading to work (a problem for another time).

My problem comes in that the user will interact deeply with the graph
of objects during the client session.  This includes adding, removing
and updating objects at all levels.

What I can't seem to get right is the interaction in the Flex layer
which copes with this level of interaction.

For instance if I want to add a new Competitor to a Scenario do I 
(i) create all new objects on the client and then synchronise the
server, or 
(ii) initiate creation of a new object on the server and then modify
it on the client?

I seem to have problems in both directions and the same isue for
delete and to a certain extent modify.

I only have a single FDS destination defined, so any alterations
appear to go through the PlanPoint Object at the root of the tree and
as a result much more data gets passed back and forth than I would like.  

I'm not sure if I am just a little simplistic in my design and need
more sophistication in my relationship between the client and server,
or whether I just need a bit more code in my client to manage the
object state.  

Any guidance would be greatly appreciated as I'm beginning to swim in
circles.  



[flexcoders] Documentation of FDS estination tag

2007-01-29 Thread simonjpalmer
Does anyone have any reference material on the  tag in an
FDS destination?  It is alluded to in the User Guide with some
intriguing possibilities, but I can find no firm documentation or use
cases.

Any information gratefully received

Thanks



[flexcoders] Difference in player behaviour between IE and Firefox with SSL?

2007-09-12 Thread simonjpalmer
I have just implemented ssl in my application and I am getting some
strange results.  I use both IE and Firefox for my testing.  

I have a JBoss server and use RemoteObject's to pass data back and
forth between my Flex client and my server code via amf channels.  I
have reconfigured my channels to use https and have reset my project
settings to refer to my new https port and recompiled and re-deployed
my app.

In Firefox, everything works exactly the same as before I implemented
the SSL layer, just via an http URL, but on IE I get asked if I want
to accept the certificate, the swf installs itself and then everything
goes silent.  I get no traffic bewteen my swf and the server at all
and nothing in any logs.  Just total silence.

The really weird thing is that if I run IE as the default browser in a
debug session it works fine.  It only seems to be when I connect to my
server directly from IE that it doesn't work.  I have tried several
other machines connecting to the same server instance and I get the
same thing, Firefox is fine, IE doesn't work.

Anyone encountered behaviour like this?  Could there be some stupid IE
security issue stopping the swf from talking to the amf channels?

As much as I hate to say it, life stops without IE...

Any ideas?

Simon



[flexcoders] datagrid selection issues when bound to a ListCollectionView

2007-09-13 Thread simonjpalmer
I have a UI which has a collection of filter definitions via lists, an
ArrayCollection of objects to be filtered, a ListCollectionView bound
to the ArrayCollection and a filter function which consumes the lists
and applies the appropriate filter to the objects.  I then have a
datagrid which displays the filtered list of objects by binding to the
ListCollectionView.

The filtering works fine and as expected, and the ListCollectionView
and filter funciton is a very neat way to provide the filtered list
with arbitrarily complex filter criteria.

However, once the list is filtered I get very strange behaviour in the
selection of items in the datagrid.  I have multiple selection enabled
on my datagrid and double-click so I can hop to a dialog to edit the
object.

Often when I click a completely different row gets selected.  Just as
often the very last row in the grid is selected.  Quite often nothing
at all gets selected.  The clicks and double-clicks get fired but
there is nothing in the selectedItem variable on the grid.

I'm not doing the object selection myself, I am leaving it up to the
datagrid to handle it, so I cannot blame bad indexing on my end, it
just doesn't seem to work properly.

I'm using FlexBuilder 2.

Anyone encountered anything like this?  I am hoping it is not a bug.



[flexcoders] Re: datagrid selection issues when bound to a ListCollectionView

2007-09-13 Thread simonjpalmer
The objects in the base ArrayCollection are custom objects in my
project.  I create them with the new operator.  Is that what you mean?

I do not explcitly handle the uid on these objects and they are not
Managed.

There is a subclass hierarchy in the objects, here are the class
declarations...

public class SuperAssumption extends SuperNote

public class SuperNote

The SuperNote holds a reference to an object in my domain model and
the internals of the SuperAssumption and SuperNote are hidden behind
getters which pick properties off the domain object.  Neither of the
super* object has an explicitly declared uid, but the domain object
does.  

The creation code looks like this...

sass = new SuperAssumption(domainObject);

and is added to the ArrayCollection like this...

_assumptions.addItem(sass); 

I do this elsewhere but the objects in question are managed and I use
the uids.

Does this make it clearer what I am doing?

Simon

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> This usually implies that there are objects in there that have the same
> UID.  What do the objects look like and how are they generated and
> updated.
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Thursday, September 13, 2007 8:11 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] datagrid selection issues when bound to a
> ListCollectionView
> 
>  
> 
> I have a UI which has a collection of filter definitions via lists, an
> ArrayCollection of objects to be filtered, a ListCollectionView bound
> to the ArrayCollection and a filter function which consumes the lists
> and applies the appropriate filter to the objects. I then have a
> datagrid which displays the filtered list of objects by binding to the
> ListCollectionView.
> 
> The filtering works fine and as expected, and the ListCollectionView
> and filter funciton is a very neat way to provide the filtered list
> with arbitrarily complex filter criteria.
> 
> However, once the list is filtered I get very strange behaviour in the
> selection of items in the datagrid. I have multiple selection enabled
> on my datagrid and double-click so I can hop to a dialog to edit the
> object.
> 
> Often when I click a completely different row gets selected. Just as
> often the very last row in the grid is selected. Quite often nothing
> at all gets selected. The clicks and double-clicks get fired but
> there is nothing in the selectedItem variable on the grid.
> 
> I'm not doing the object selection myself, I am leaving it up to the
> datagrid to handle it, so I cannot blame bad indexing on my end, it
> just doesn't seem to work properly.
> 
> I'm using FlexBuilder 2.
> 
> Anyone encountered anything like this? I am hoping it is not a bug.
>




[flexcoders] Re: datagrid selection issues when bound to a ListCollectionView

2007-09-13 Thread simonjpalmer
Sorry for the confusion, I meant I use the same filtering technique
elsewhere but on Managed objects, which I explicitly refer to via
their uid fields.

Are you suggesting I cycle through the objects in the
ListCollectionView or the ArrayCollection?

I can try what you suggested on both, but I can be pretty certain that
I am not adding duplicate objects to the base ArrayCollection on which
the ListCollectionView operates because every one of them is created
with the new operator.

Is a uid assigned to objects in the background by the framework?

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> You confused me with this statements:
> 
>  
> 
> "I do this elsewhere but the objects in question are managed and I use
> the uids."
> 
>  
> 
> I thought you were wrapping the managed objects, but now I'm not sure.
> I guess the simplest test for you is, when you have selection problems,
> to walk the collection and dump the results of UIDUtil.getUID() on each
> object.  If two are the same, you'll definitely have selection problems
> and then we need to figure out why that happened.
> 
>  
> 
> ____
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Thursday, September 13, 2007 8:54 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: datagrid selection issues when bound to a
> ListCollectionView
> 
>  
> 
> The objects in the base ArrayCollection are custom objects in my
> project. I create them with the new operator. Is that what you mean?
> 
> I do not explcitly handle the uid on these objects and they are not
> Managed.
> 
> There is a subclass hierarchy in the objects, here are the class
> declarations...
> 
> public class SuperAssumption extends SuperNote
> 
> public class SuperNote
> 
> The SuperNote holds a reference to an object in my domain model and
> the internals of the SuperAssumption and SuperNote are hidden behind
> getters which pick properties off the domain object. Neither of the
> super* object has an explicitly declared uid, but the domain object
> does. 
> 
> The creation code looks like this...
> 
> sass = new SuperAssumption(domainObject);
> 
> and is added to the ArrayCollection like this...
> 
> _assumptions.addItem(sass); 
> 
> I do this elsewhere but the objects in question are managed and I use
> the uids.
> 
> Does this make it clearer what I am doing?
> 
> Simon
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui"  wrote:
> >
> > This usually implies that there are objects in there that have the
> same
> > UID. What do the objects look like and how are they generated and
> > updated.
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of simonjpalmer
> > Sent: Thursday, September 13, 2007 8:11 AM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] datagrid selection issues when bound to a
> > ListCollectionView
> > 
> > 
> > 
> > I have a UI which has a collection of filter definitions via lists, an
> > ArrayCollection of objects to be filtered, a ListCollectionView bound
> > to the ArrayCollection and a filter function which consumes the lists
> > and applies the appropriate filter to the objects. I then have a
> > datagrid which displays the filtered list of objects by binding to the
> > ListCollectionView.
> > 
> > The filtering works fine and as expected, and the ListCollectionView
> > and filter funciton is a very neat way to provide the filtered list
> > with arbitrarily complex filter criteria.
> > 
> > However, once the list is filtered I get very strange behaviour in the
> > selection of items in the datagrid. I have multiple selection enabled
> > on my datagrid and double-click so I can hop to a dialog to edit the
> > object.
> > 
> > Often when I click a completely different row gets selected. Just as
> > often the very last row in the grid is selected. Quite often nothing
> > at all gets selected. The clicks and double-clicks get fired but
> > there is nothing in the selectedItem variable on the grid.
> > 
> > I'm not doing the object selection myself, I am leaving it up to the
> > datagrid to handle it, so I cannot blame bad indexing on my end, it
> > just doesn't seem to work properly.
> > 
> > I'm using FlexBuilder 2.
> > 
> > Anyone encountered anything like this? I am hoping it is not a bug.
> >
>




[flexcoders] Re: Difference in player behaviour between IE and Firefox with SSL?

2007-09-13 Thread simonjpalmer
I think I have solved this (with much pain and a m oment of exhileration).

There is a difference in the browsers, but not in the player.  IE
requires that the add-no-cache-headers property is set in the AMF
channel definition, Firefox doesn't care:

false

Here is what mine looke like...


https://{server.name}:8443/{context.root}/messagebroker/amf";
class="flex.messaging.endpoints.SecureAMFEndpoint"/>

false
false



Suddenly both IE and FF work just fine over https.  

I'm posting in the hope that some other poor soul won't spend 4 days
staring at this issue and might just bump into this post.

Other keywords for the search engine:
HTTP 500
HTTPS
IE
MSIE
Internet Explorer
SSL
JBOSS

SP

--- In flexcoders@yahoogroups.com, "simonjpalmer" <[EMAIL PROTECTED]>
wrote:
>
> I have just implemented ssl in my application and I am getting some
> strange results.  I use both IE and Firefox for my testing.  
> 
> I have a JBoss server and use RemoteObject's to pass data back and
> forth between my Flex client and my server code via amf channels.  I
> have reconfigured my channels to use https and have reset my project
> settings to refer to my new https port and recompiled and re-deployed
> my app.
> 
> In Firefox, everything works exactly the same as before I implemented
> the SSL layer, just via an http URL, but on IE I get asked if I want
> to accept the certificate, the swf installs itself and then everything
> goes silent.  I get no traffic bewteen my swf and the server at all
> and nothing in any logs.  Just total silence.
> 
> The really weird thing is that if I run IE as the default browser in a
> debug session it works fine.  It only seems to be when I connect to my
> server directly from IE that it doesn't work.  I have tried several
> other machines connecting to the same server instance and I get the
> same thing, Firefox is fine, IE doesn't work.
> 
> Anyone encountered behaviour like this?  Could there be some stupid IE
> security issue stopping the swf from talking to the amf channels?
> 
> As much as I hate to say it, life stops without IE...
> 
> Any ideas?
> 
> Simon
>




[flexcoders] Re: datagrid selection issues when bound to a ListCollectionView

2007-09-17 Thread simonjpalmer
OK, middle of a release, so struggling to get round to this.

What I did was add code under a click even which cycles through the
dataProvider on the DataGrid in question and traces out the uids.  I
put 4 known objects in the underlying list as a test and here is what
my console trace looked like...

7AC40327-B485-456C-CD39-044764F845FA
35E82259-FC56-9C3D-B623-04478EF6F548
DACEC13C-60C2-3D71-2468-0447BB55495A
D842C13C-5EB8-CA8F-7BAE-0447E255ED73

As you can see they are unique.  The selection problem persists.

Something very weird is happening.  If I bind to the underlying
ArrayCollection the selection problem goes away, but of course I lose
my filtering.

I'm at a bit of a loss.  I was hoping that I could report that there
was some duplication of UIDs, but there isn't.  I'm having to release
with this as a known bug because I cannot delay, which is pretty bad
for me.

I'd really appreciate any insights yo might have and I can hapily
share the rest of my code if it might help.

Simon

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> If the objects do not implement IUID and are not Managed, they get a UID
> generated for them.  Non-unique UIDs is the number 1 reason for
> selection problems.  Everything you are doing looks fine, but we need to
> eliminate or identify that possibility.  Walk datagrid.dataProvider.
> That ensures you are examining the same set of objects the dg is.
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Thursday, September 13, 2007 9:12 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: datagrid selection issues when bound to a
> ListCollectionView
> 
>  
> 
> Sorry for the confusion, I meant I use the same filtering technique
> elsewhere but on Managed objects, which I explicitly refer to via
> their uid fields.
> 
> Are you suggesting I cycle through the objects in the
> ListCollectionView or the ArrayCollection?
> 
> I can try what you suggested on both, but I can be pretty certain that
> I am not adding duplicate objects to the base ArrayCollection on which
> the ListCollectionView operates because every one of them is created
> with the new operator.
> 
> Is a uid assigned to objects in the background by the framework?
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui"  wrote:
> >
> > You confused me with this statements:
> > 
> > 
> > 
> > "I do this elsewhere but the objects in question are managed and I use
> > the uids."
> > 
> > 
> > 
> > I thought you were wrapping the managed objects, but now I'm not sure.
> > I guess the simplest test for you is, when you have selection
> problems,
> > to walk the collection and dump the results of UIDUtil.getUID() on
> each
> > object. If two are the same, you'll definitely have selection problems
> > and then we need to figure out why that happened.
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of simonjpalmer
> > Sent: Thursday, September 13, 2007 8:54 AM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Re: datagrid selection issues when bound to a
> > ListCollectionView
> > 
> > 
> > 
> > The objects in the base ArrayCollection are custom objects in my
> > project. I create them with the new operator. Is that what you mean?
> > 
> > I do not explcitly handle the uid on these objects and they are not
> > Managed.
> > 
> > There is a subclass hierarchy in the objects, here are the class
> > declarations...
> > 
> > public class SuperAssumption extends SuperNote
> > 
> > public class SuperNote
> > 
> > The SuperNote holds a reference to an object in my domain model and
> > the internals of the SuperAssumption and SuperNote are hidden behind
> > getters which pick properties off the domain object. Neither of the
> > super* object has an explicitly declared uid, but the domain object
> > does. 
> > 
> > The creation code looks like this...
> > 
> > sass = new SuperAssumption(domainObject);
> > 
> > and is added to the ArrayCollection like this...
> > 
> > _assumptions.addItem(sass); 
> > 
> > I do this elsewhere but the objects in question are managed and I use
> > the uids.

[flexcoders] Re: Overriding ValueObjects class

2007-09-17 Thread simonjpalmer
My first question is what are you trying to achieve by duplicating the
title variable in the subclass, it would on the face of it seem a
little pointless?   If you need to titles use an array or call them
different things so as to disambiguate them.

However, have you tried writing a setter or getter on the subclass

> package com.xyz
> {
>   [Bindable]
>   public class Bar extends Foo
>   {
> public var description:String;
> public function set title(s:String):void{}
> public function get title():String{}
>   }
> }

I think there is also an override keyword you could investigate.

Best solution is to design your objects in such a way that avoids
these sorts of clashes.

hope that helps
SP

--- In flexcoders@yahoogroups.com, nhid <[EMAIL PROTECTED]> wrote:
>
> Hello,
> 
> Lets say I have a VO class Bar.as to be extended from Foo.as VO
class.  I
> get this error at variable "title" (see code below):
> 
> Overriding a function that is not marked for override.
> 
> How do I resolve this?  I saw Adobe's link saying I should remove
[Bindable]
> from base class, I did but that did not resolve the problem.  Any
suggestion
> is appreciated.
> 
> thank you.
> 
> **
> // Foo.as
> package com.xyz
> {
>   [Bindable]
>   public class Foo
>   {
> public var title:String;
>   }
> }
> 
> // Bar.as
> package com.xyz
> {
>   [Bindable]
>   public class Bar extends Foo
>   {
> public var description:String;
> public var title:String;
>   }
> }
>




[flexcoders] Re: Math.cos...?

2007-09-17 Thread simonjpalmer
Therein lies the entire problem.  Discontinuities are an artefact of a
flawed model and do not truly appear in nature.  

The whole problem would go away if we counted in base pi and went back
to having no zero.  

--- In flexcoders@yahoogroups.com, "Gordon Smith" <[EMAIL PROTECTED]> wrote:
>
> That would be a bad idea because it would lead to discontinuities. The
> function should be smooth at pi/2, pi, etc.
>  
> - Gordon
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Guido
> Sent: Monday, September 17, 2007 1:46 PM
> To: flexcoders@yahoogroups.com
> Subject: Re: [flexcoders] Math.cos...?
> 
> 
> 
> Math.cos() (and every other trig function) should check the argument
> being PI (or any other of its own constants) before calculating, since
> it would better reflect the mathematical function and maybe even save up
> on some performance. 
> 
> 
> On 9/17/07, Gordon Smith <[EMAIL PROTECTED]  >
> wrote: 
> 
>   
> 
>   In addition to Math.PI not being able to store the exact value
> of pi, the computation of trig functions involves approximations. For
> example, one definition of a cosine is in terms of an infinite series,
> and a computer can't calculate an infinite number of terms. Even if the
> argument passed to Math.cos() is exact, the result generally won't be.
>
>   - Gordon
> 
> 
> 
>   From: flexcoders@yahoogroups.com
> [mailto:flexcoders@yahoogroups.com  ] On Behalf
> Of Jon Bradley
>   Sent: Sunday, September 16, 2007 2:49 PM
>   To: flexcoders@yahoogroups.com
>   Subject: Re: [flexcoders] Math.cos...?
>   
>   
>   That's pretty much it. 
> 
> 
>   To a computer Math.cos(Math.PI/2) is not 0. It's really close to
> 0, because PI is an infinite sequence and a computer can "only" store it
> as a double precision floating point number (ie, a fixed value).
> 
>   What you get back from this calculation is the error bound of
> the computer basically, which you can then use for  numerical
> calculations, ie, MathLib.ERROR_BOUND = Math.cos(Math.PI/2). Then you
> can feasibly use if you need numerical accuracy.
> 
>   IE, if result == MathLib.ERROR_BOUND, result = 0.
> 
>   Numerical accuracy in AS2 is not equivalent to that of AS3. I
> ran into this while porting the Mersenne Twister algorithm to AS2 - I
> couldn't even store 2^32 as a hex value in AS2 (0x1, which
> equals 4294967296).
> 
>   At least we can be somewhat numerically accurate now...
> 
>   good luck,
> 
>   jon
> 
> 
>   On Sep 16, 2007, at 5:15 PM, Troy Gilbert wrote:
> 
> 
>   > Why does Math.cos(Math.PI/2) not return zero?
>   
>   Round-off error in the Math libs? It does return a value
> very close to
>   0 (1.7xe-17).
>   
>   Troy.
>




[flexcoders] Anybody Out there Please! Re: Flex Builder/Webapp/Flex

2007-09-18 Thread simonjpalmer
I have exactly this set up with a J2EE servlet project using the WTP
Eclipse plug-in and a Flex Builder project in the wame Eclipse workspace.

It is best to start from the server project and create a Dynamic Web
Project first.  Get your servlet compiling and deploying into your app
server even if it is empty.  Create a Java package for your domain
model if you feel you need to start from having code.

Next create a Flex Builder project and use the server project you just
created as the context root.  I deploy my swf's into a folder at the
same level as WEB-INF which has the name of my app, therefore my URL
is of the form...

https://server:port/servletname/appname/projectname.html

e.g.

https://localhost:8443/pmco-spring-server/spm/spm.html in my case

pmco-spring-server is my WAR/EAR deployment name, spm is my app's
generic name and the name of the Flex project and spm is also the name
of my SWF root Application, so I have spm.html which embeds my spm.swf.

My folders look like this...

in the Java project...
C:\development\coral\eclipse\pmco-spring-server\src
C:\development\coral\eclipse\pmco-spring-server\src\pmco\pojos (my
domain model)
C:\development\coral\eclipse\pmco-spring-server\WebContent\spm this is
the output folder of my Flex project
C:\development\coral\eclipse\pmco-spring-server\WebContent\WEB-INF

on the flex side...

C:\development\coral\eclipse\spm this is my root app folder
C:\development\coral\eclipse\spm\pmco\pojos this is my domain model

"coral" is the release branch we are currently working on.

The steps to build and deploy (which we automate in production builds
using ANT) are to build the Flex project which has the output folder
set to the spm folder under WebContent in the Java project, and
therefore puts the swf's, html's etc into the deployment domain of the
Java app, and then to export the whole of the app from the Java side
as a WAR file.  That then gets copied into the deploy folder of the
servlet container, in our case JBoss, and the servlet is visible
through the web server.

You can actually start from flex or Java, it is just simpler to
configure the Flex project once you already have a server environment
set up and a server to talk to.

We have completely separate folders for each of the projects, Java and
Flex and the only link is that the code lived in the same SVN
repository and the Flex project builds into the Java project folder
for ease of deployment.

This has worked well for us and we are a multi-developer, multi-site
team.  We don't strictly partition responsibilities between server and
client code, but expertise tends to divide naturally along those lines.

I know it is a pain to get started and I hope this helps.  You'll
probably find a variant of this which will work for you and the
situation may be different for different app servers, but the J2EE
deployment model makes the structures similar in any case and don;t
worry, as long as you keep your code safe, restructuring when you
realise you have a better way of organising your activity is not the
end of the world.

Best of luck
Simon
--- In flexcoders@yahoogroups.com, "Leif Wells" <[EMAIL PROTECTED]> wrote:
>
> Matt,
> 
> At my workplace, we normally have a team working on the front-end and
> another working on the Java back-end.
> 
> Although we share the same Subversion repository, we place our code in
> separate folders. The front-end team uses the root of the "flex"
folder as
> the base of our Flex Builder project.
> 
> For compiling, assembling and deploying we use Ant. Seriously, Ant is
> awesome. Check out the Flex Ant Tasks found on Adobe Labs (
> http://labs.adobe.com/wiki/index.php/Flex_Ant_Tasks) for some
examples of
> the tasks.
> 
> To generally describe this to you, we have two build.xml files, one
in the
> Java folder and one in the Flex folder. The Java file will call to
the Flex
> build file, compile the Flex files and assemble them, then compile
the Java,
> move the Flex files into the Java deploy folder and then create the War
> file. When I come in to the office in the morning, I update my
Subversion
> repository, run the build process, start Tomcat and load up Flex
Builder.
> 
> I can't share the Ant files with you today, but they honestly are fairly
> easy to put together. That is one of the great things about Ant --- it's
> fairly easy to use.
> 
> I hope this helps you.
> 
> Leif
> 
> 
> On 9/18/07, mattmadhavan <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > mattmadhavan wrote:
> > >
> > > Hi,
> > > I would like the have the best practice to set up a webapp in my
> > Eclipse.
> > > What are the recommended directory structure for java/flex source
> > folders?
> > > Do I first create a webproject in eclipse, then place my flex binary
> > > folders in the webroot/WEB-INF folder? Do I keep my flex src
code under
> > > webroot or at the project folder?
> > >
> > > If some one can give me a step by step instruction on doing this
I would
> > > appreciate it. I need to work with both Java(se

[flexcoders] Flash player on iPhone

2007-10-24 Thread simonjpalmer
Tangential, but not completely off topic, anyone here have any inside
track on whether Apple are likely to support the Flash Player in their
mini Safari browser on the iPhone?




[flexcoders] iterating across an object

2007-10-26 Thread simonjpalmer
In the absence of a formal Map I am using an object as a key/value
pair map as follows:

var map:Object = new Object();
map["A"] = some_object_A;
map["B"] = some_object_B;
map["C"] = some_object_C;

and then looking up by the key

var object_A:Object = map["A"];

etc.

This works really well for random lookup by the key, but what I also
need is a way to iterate through the objects I have put on the map
object.  

Is there a for each(* in map) construct I can use?  

Does anyone know if there are any plans to support HashMaps in AS3 or
flash?  Is there anything synonymous to a HashMap already that I am
clearly not aware of?

Thanks
Simon



[flexcoders] Re: iterating across an object

2007-10-26 Thread simonjpalmer
thanks, sorry to be dim, but what exactly do I put as the iterator in
these loops?

for each ( in map)

Can I use...

var o:Object;
for each (o in map)?

Incidentally I don't think a Dictionary works in my particular
instance because it uses the strict equality === operator which means
that I can only retrieve items if I have the exact same object that I
used as the key.

In my case I am using a String UID value as the key so I can look up
objects from the map from lots of different places.  I can guarantee
that I will *not* have the same instance of the key object when I look
up the right hand side of the map, instead I have a String which
contains the same characters as the original key.  

So == will work, but === will not, which unfortunately makes the
Dictionary object useless for my purposes.

Simon

--- In flexcoders@yahoogroups.com, "ben.clinkinbeard"
<[EMAIL PROTECTED]> wrote:
>
> for...in and for...each will both work on Object but what you're
> really looking for is Dictionary. Dictionary supports those loops as
well.
> 
> HTH,
> Ben
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "simonjpalmer" 
> wrote:
> >
> > In the absence of a formal Map I am using an object as a key/value
> > pair map as follows:
> > 
> > var map:Object = new Object();
> > map["A"] = some_object_A;
> > map["B"] = some_object_B;
> > map["C"] = some_object_C;
> > 
> > and then looking up by the key
> > 
> > var object_A:Object = map["A"];
> > 
> > etc.
> > 
> > This works really well for random lookup by the key, but what I also
> > need is a way to iterate through the objects I have put on the map
> > object.  
> > 
> > Is there a for each(* in map) construct I can use?  
> > 
> > Does anyone know if there are any plans to support HashMaps in AS3 or
> > flash?  Is there anything synonymous to a HashMap already that I am
> > clearly not aware of?
> > 
> > Thanks
> > Simon
> >
>




[flexcoders] "transient" properties of an object using RemoteClass

2007-10-26 Thread simonjpalmer
I have a situation where I have a deliberate mismatch between my AS3
and Java objects.

I have a Java object

package com.java
class X
{
private String name;
public String getName(){return name;}
public void setName(String name){this.name=name;}
}

and an ActionScript object

package com.as3
{
[Managed]
[RemoteClass(alias="com.java.X")]
public class X
{
private var name:String;
private var age:Number;
}
}

this all works great and my X.name gets transported back and forth
reliably, however when data is transmitted from client to server I get
a warning message from the framework on the server which says...

"Ignoring set property age for type com.as3.X as a setter could not be
found."

This means that the age property was transmitted unnecessarily.  Not a
problem for a primitive like a Number, but a real problem if age
contained an array of objects.

What I think I need is something like the "transient" keyword in Java
object persistence which causes a property not to be considered for
persistence, or in this case transmission.  

Does any such thing exist, or is there another way of doing this?  

Thanks



[flexcoders] Re: iterating across an object

2007-10-27 Thread simonjpalmer
Thanks for your replies, I think I can probably use either Object or
Dictionary as I know my keys are always Strings.

However this raises another question, namely what do these iterators
iterate through, the keys or the objects?

In old Java speak I have a Map map;

if I say 

for each (* in map)

am I iterating through the Strings or Dogs?

Thanks for your patience.  Given that Dictionary and Object seem to
support Map style operations, any idea why there is no formal Map
object in AS3 which would make this less obfuscated?

Simon

--- In flexcoders@yahoogroups.com, "ben.clinkinbeard"
<[EMAIL PROTECTED]> wrote:
>
> > Why a Dictionary?
> Because he was asking about HashMaps.
> 
> > As for his question about HashMaps/HashTables, Object is really the 
> > nearest equivialent.
> I would disagree, considering Dictionary supports Object keys and
> Object does not.
> 
> Ben
> 
> 
> --- In flexcoders@yahoogroups.com, "reflexactions" 
> wrote:
> >
> > Why a Dictionary?
> > 
> > A Dictionary was designed for Object keys not realy String keys.
> > 
> > A plain old fashioned Object will surely do just fine for him, ie 
> > exactly as he had it in the first place the only thing he was missing 
> > was how to loop over the keys, which would just be:
> > 
> > for(key:String in map)map[key]
> > 
> > As for his question about HashMaps/HashTables, Object is really the 
> > nearest equivialent.
> > 
> > Dictionary should be used where you keys are themselves Objects, like 
> > a Dictionary with data rows as keys and the value being a component 
> > 
> > 
> > 
> > 
> > 
> > 
> > --- In flexcoders@yahoogroups.com, "ben.clinkinbeard" 
> >  wrote:
> > >
> > > Hi Simon,
> > > 
> > > Dictionary will work for you. Strings are passed by value, so it
> > > doesn't matter if you have the same key var or not. Run this code to
> > > see an example.
> > > 
> > > var d:Dictionary = new Dictionary();
> > > var s1:String = "foo";
> > > var s2:String = "foo";
> > > d[s1] = "bar";
> > > trace(d[s2]);
> > > 
> > > As for what to use as the iterator, that depends on what your
> > > collection is holding. If you don't know, or it holds more than one
> > > type of object, Object or * would be the type of your iterator. If 
> > you
> > > know you have a collection of Dog instances, use a Dog iterator.
> > > 
> > > HTH,
> > > Ben
> > > 
> > > 
> > > --- In flexcoders@yahoogroups.com, "simonjpalmer" 
> > > wrote:
> > > >
> > > > thanks, sorry to be dim, but what exactly do I put as the 
> > iterator in
> > > > these loops?
> > > > 
> > > > for each ( in map)
> > > > 
> > > > Can I use...
> > > > 
> > > > var o:Object;
> > > > for each (o in map)?
> > > > 
> > > > Incidentally I don't think a Dictionary works in my particular
> > > > instance because it uses the strict equality === operator which 
> > means
> > > > that I can only retrieve items if I have the exact same object 
> > that I
> > > > used as the key.
> > > > 
> > > > In my case I am using a String UID value as the key so I can look 
> > up
> > > > objects from the map from lots of different places.  I can 
> > guarantee
> > > > that I will *not* have the same instance of the key object when I 
> > look
> > > > up the right hand side of the map, instead I have a String which
> > > > contains the same characters as the original key.  
> > > > 
> > > > So == will work, but === will not, which unfortunately makes the
> > > > Dictionary object useless for my purposes.
> > > > 
> > > > Simon
> > > > 
> > > > --- In flexcoders@yahoogroups.com, "ben.clinkinbeard"
> > > >  wrote:
> > > > >
> > > > > for...in and for...each will both work on Object but what you're
> > > > > really looking for is Dictionary. Dictionary supports those 
> > loops as
> > > > well.
> > > > > 
> > > > > HTH,
> > > > > Ben
> > > > > 
> > > > > 
> > > > > 
> > > > > --- In flexcoders@yahoogroups.com, "simonjpalmer" 
> > 
> > > > > wrote:
> > > > > >
> > > > > > In the absence of a formal Map I am using an object as a 
> > key/value
> > > > > > pair map as follows:
> > > > > > 
> > > > > > var map:Object = new Object();
> > > > > > map["A"] = some_object_A;
> > > > > > map["B"] = some_object_B;
> > > > > > map["C"] = some_object_C;
> > > > > > 
> > > > > > and then looking up by the key
> > > > > > 
> > > > > > var object_A:Object = map["A"];
> > > > > > 
> > > > > > etc.
> > > > > > 
> > > > > > This works really well for random lookup by the key, but what 
> > I also
> > > > > > need is a way to iterate through the objects I have put on 
> > the map
> > > > > > object.  
> > > > > > 
> > > > > > Is there a for each(* in map) construct I can use?  
> > > > > > 
> > > > > > Does anyone know if there are any plans to support HashMaps in
> > > AS3 or
> > > > > > flash?  Is there anything synonymous to a HashMap already 
> > that I am
> > > > > > clearly not aware of?
> > > > > > 
> > > > > > Thanks
> > > > > > Simon
> > > > > >
> > > > >
> > > >
> > >
> >
>




[flexcoders] Re: numeric formatters - a small gripe

2007-10-27 Thread simonjpalmer
Even odder is the default setting of the rounding to be "none" on
NumberFormatter which effectively truncates the number when it applies
the precision.  

I know of no world where that make sense over "nearest".  

Quite bizarre.

--- In flexcoders@yahoogroups.com, "Paul Andrews" <[EMAIL PROTECTED]> wrote:
>
> OK, I can always get around this stuff by writing my own formatter or 
> extending an existing one, but I naively expect the number and currency 
> formatters (say precision 2), to format "0.23" as "0.23" rather than
".23". 
> Similarly I expect "-0.23" to be formatted as "-0.23" and not return
"-.23".
> 
> I know there's ways round this, but I find this formatting default
odd. Even 
> if it were popular in some quarters (is it?), I'd at least expect the 
> classes supplied by Adobe to allow the choice of having the formatter 
> generate that leading 0 or not.
> 
> Is it just me that finds this odd? Am I right to expect that zero in
front 
> of the decimal point?
> 
> Paul
>




[flexcoders] Re: "transient" properties of an object using RemoteClass

2007-10-29 Thread simonjpalmer
Wait... this is 3, I am on 2...

I can't find a reference to this in Flex 2, is it a new feature of 3?

--- In flexcoders@yahoogroups.com, "ben.clinkinbeard"
<[EMAIL PROTECTED]> wrote:
>
>
http://livedocs.adobe.com/labs/flex/3/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=metadata_066_15.html
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "simonjpalmer" 
> wrote:
> >
> > I have a situation where I have a deliberate mismatch between my AS3
> > and Java objects.
> > 
> > I have a Java object
> > 
> > package com.java
> > class X
> > {
> > private String name;
> > public String getName(){return name;}
> > public void setName(String name){this.name=name;}
> > }
> > 
> > and an ActionScript object
> > 
> > package com.as3
> > {
> > [Managed]
> > [RemoteClass(alias="com.java.X")]
> > public class X
> > {
> > private var name:String;
> > private var age:Number;
> > }
> > }
> > 
> > this all works great and my X.name gets transported back and forth
> > reliably, however when data is transmitted from client to server I get
> > a warning message from the framework on the server which says...
> > 
> > "Ignoring set property age for type com.as3.X as a setter could not be
> > found."
> > 
> > This means that the age property was transmitted unnecessarily.  Not a
> > problem for a primitive like a Number, but a real problem if age
> > contained an array of objects.
> > 
> > What I think I need is something like the "transient" keyword in Java
> > object persistence which causes a property not to be considered for
> > persistence, or in this case transmission.  
> > 
> > Does any such thing exist, or is there another way of doing this?  
> > 
> > Thanks
> >
>




[flexcoders] Flex 3 release date

2007-10-29 Thread simonjpalmer
What is the latest statement of intent from Adobe regarding the full
Flex 3 release date?



[flexcoders] Re: "transient" properties of an object using RemoteClass

2007-10-29 Thread simonjpalmer
Thanks!  

--- In flexcoders@yahoogroups.com, "ben.clinkinbeard"
<[EMAIL PROTECTED]> wrote:
>
>
http://livedocs.adobe.com/labs/flex/3/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=metadata_066_15.html
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "simonjpalmer" 
> wrote:
> >
> > I have a situation where I have a deliberate mismatch between my AS3
> > and Java objects.
> > 
> > I have a Java object
> > 
> > package com.java
> > class X
> > {
> > private String name;
> > public String getName(){return name;}
> > public void setName(String name){this.name=name;}
> > }
> > 
> > and an ActionScript object
> > 
> > package com.as3
> > {
> > [Managed]
> > [RemoteClass(alias="com.java.X")]
> > public class X
> > {
> > private var name:String;
> > private var age:Number;
> > }
> > }
> > 
> > this all works great and my X.name gets transported back and forth
> > reliably, however when data is transmitted from client to server I get
> > a warning message from the framework on the server which says...
> > 
> > "Ignoring set property age for type com.as3.X as a setter could not be
> > found."
> > 
> > This means that the age property was transmitted unnecessarily.  Not a
> > problem for a primitive like a Number, but a real problem if age
> > contained an array of objects.
> > 
> > What I think I need is something like the "transient" keyword in Java
> > object persistence which causes a property not to be considered for
> > persistence, or in this case transmission.  
> > 
> > Does any such thing exist, or is there another way of doing this?  
> > 
> > Thanks
> >
>




[flexcoders] Re: Flex 3 release date

2007-10-29 Thread simonjpalmer
Thanks Matt.  What are the likely license implications for developers
like myself who will be looking at upgrading?

--- In flexcoders@yahoogroups.com, "Matt Chotin" <[EMAIL PROTECTED]> wrote:
>
> Early 2008.  Where January is considered "very early" and April would be
> considered closer to "mid."
> 
>  
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Monday, October 29, 2007 10:57 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Flex 3 release date
> 
>  
> 
> What is the latest statement of intent from Adobe regarding the full
> Flex 3 release date?
>




[flexcoders] Re: "transient" properties of an object using RemoteClass

2007-10-29 Thread simonjpalmer
The FB2 syntax hilighter ignores it, but I can confirm that it exists
and works in Flex 2.  Makes you wonder why it wasn't in the docs...

Thanks for your help.  This just cut my packet size by about 75% and
simplified my client code significantly.  

I'm a very happy man.

--- In flexcoders@yahoogroups.com, "ben.clinkinbeard"
<[EMAIL PROTECTED]> wrote:
>
> Nah, looks like it was just undocumented in 2:
> 
> http://nondocs.blogspot.com/2007/04/metadatatransient.html
> http://www.darronschall.com/weblog/archives/000271.cfm
> 
> HTH,
> Ben
> 
> 
> --- In flexcoders@yahoogroups.com, "simonjpalmer" 
> wrote:
> >
> > Wait... this is 3, I am on 2...
> > 
> > I can't find a reference to this in Flex 2, is it a new feature of 3?
> > 
> > --- In flexcoders@yahoogroups.com, "ben.clinkinbeard"
> >  wrote:
> > >
> > >
> >
>
http://livedocs.adobe.com/labs/flex/3/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=metadata_066_15.html
> > > 
> > > 
> > > 
> > > --- In flexcoders@yahoogroups.com, "simonjpalmer" 
> > > wrote:
> > > >
> > > > I have a situation where I have a deliberate mismatch between
my AS3
> > > > and Java objects.
> > > > 
> > > > I have a Java object
> > > > 
> > > > package com.java
> > > > class X
> > > > {
> > > > private String name;
> > > > public String getName(){return name;}
> > > > public void setName(String name){this.name=name;}
> > > > }
> > > > 
> > > > and an ActionScript object
> > > > 
> > > > package com.as3
> > > > {
> > > > [Managed]
> > > > [RemoteClass(alias="com.java.X")]
> > > > public class X
> > > > {
> > > > private var name:String;
> > > > private var age:Number;
> > > > }
> > > > }
> > > > 
> > > > this all works great and my X.name gets transported back and forth
> > > > reliably, however when data is transmitted from client to server
> I get
> > > > a warning message from the framework on the server which says...
> > > > 
> > > > "Ignoring set property age for type com.as3.X as a setter could
> not be
> > > > found."
> > > > 
> > > > This means that the age property was transmitted unnecessarily.
>  Not a
> > > > problem for a primitive like a Number, but a real problem if age
> > > > contained an array of objects.
> > > > 
> > > > What I think I need is something like the "transient" keyword in
> Java
> > > > object persistence which causes a property not to be
considered for
> > > > persistence, or in this case transmission.  
> > > > 
> > > > Does any such thing exist, or is there another way of doing
this?  
> > > > 
> > > > Thanks
> > > >
> > >
> >
>




[flexcoders] Re: Flex 3 release date

2007-11-01 Thread simonjpalmer
OK, so I have FB2 + Charting I bet most people do.

Here's how I read that site...

If I want to go to the same set of capabilities after your current
release I have two options:
1) buy FB3Pro = US$699
2) buy maintenance on my FB2 + Charts = US$299 after Nov 1 (i.e.
today) and get a free upgrade to FB3Pro when it ships.

So my minimum outlay for upgrade seems to be US$299.

Am I right?

If yes, given that you don't have a final ship date yet, what is the
latest I can buy the maintenance and get my "free" upgrade to FB3Pro?

Simon

--- In flexcoders@yahoogroups.com, "Matt Chotin" <[EMAIL PROTECTED]> wrote:
>
> http://www.onflex.org/ted/2007/10/flex-3-beta-2-lower-price-flex-builder
> .php
> 
>  
> 
> See question 4 and you can imagine similar upgrade pricing.
> 
>  
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Monday, October 29, 2007 7:01 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Flex 3 release date
> 
>  
> 
> Thanks Matt. What are the likely license implications for developers
> like myself who will be looking at upgrading?
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "Matt Chotin"  wrote:
> >
> > Early 2008. Where January is considered "very early" and April would
> be
> > considered closer to "mid."
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of simonjpalmer
> > Sent: Monday, October 29, 2007 10:57 AM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Flex 3 release date
> > 
> > 
> > 
> > What is the latest statement of intent from Adobe regarding the full
> > Flex 3 release date?
> >
>




[flexcoders] Re: 2d dynamic grid

2007-11-01 Thread simonjpalmer
Rather than subclass DataGrid I wrapped it in a class and have my own
addColumn() methods.  Here's the relevant code in my
TotalDataGrid.addColumn() method.

public function addColumn(name:String, dataField:String,
labelFunction:Function=null):void
{
var dgcd:DataGridColumn = new DataGridColumn(name);
dgcd.dataField = dataField;
if (labelFunction != null) dgcd.labelFunction = labelFunction;

// add the column to the datagrid.
// this has to be done in this weird way because of how the datagrid works
// the getter for the columns returns a new array so you cannot
operate on 
// the internal array of columns held by the datagrid.  You have to get a 
// copy, add one to it, and then give the array back via a setter.

var a:Array;
a = dg_Data.columns;
a.push(dgcd);
dg_Data.columns = a;

}

I also do a bit more because I have specialised formatters and a total
row in my custom component, but the basics are in that code.

There is probably a way of doing this which is purely data driven,
i.e. you don't have to inspect the incoming data tables for its
columns, but I'd have to think a bit more about that and my app
doesn't need it.  Maybe some bright spark will have an answer for that.

HTH
Simon

--- In flexcoders@yahoogroups.com, "Richard Rodseth" <[EMAIL PROTECTED]> wrote:
>
> Any suggestions for the best way to do a datagrid-like object  with a
> variable data-driven number of rows *and* columns? I see that the the
> columns array can be set.
>




[flexcoders] Repeaters and ListCollectionViews

2007-11-02 Thread simonjpalmer
Is it possible to use a ListCollectionView as the dataProvider for a
Repeater?

I think the answer is no because I can't get it to work, but I wanted
to make sure that it is not just me writing buggy code.

Thanks
Simon



[flexcoders] Re: Repeaters and ListCollectionViews

2007-11-03 Thread simonjpalmer
Yup, got it working, however it seemed to need me to explicitly bind a
property of the Repeater to the control being repeated before it
started working.  





it wasn't until I added 

activePlanPoint="{pp_repeater.currentItem}" 

that it started working.  I originally was overriding the set data()
method on the control expecting to be given the appropriate object
from the data array so I could initialise my control and had no
reference from the drop taregte control and the repeater.

If I get rid of the explicit references to the repeater it stops working.

Simon

--- In flexcoders@yahoogroups.com, "simonjpalmer" <[EMAIL PROTECTED]>
wrote:
>
> Is it possible to use a ListCollectionView as the dataProvider for a
> Repeater?
> 
> I think the answer is no because I can't get it to work, but I wanted
> to make sure that it is not just me writing buggy code.
> 
> Thanks
> Simon
>




[flexcoders] Re: remove a item in ArrayCollection

2007-11-03 Thread simonjpalmer
how about 

myData.removeItemAt(0)?

--- In flexcoders@yahoogroups.com, "flexawesome" <[EMAIL PROTECTED]> wrote:
>
> 
> 
> Hey there,
> 
> I have a problem to remove the first *object* in myData, any suggestion?
> 
> Thank you 
> 
> === 
> 
> 
> [Bindable]
> private var myData:ArrayCollection;
> 
> myData.removeItemAt(myData.getItemAt(0));
>




[flexcoders] Re: remove a item in ArrayCollection

2007-11-03 Thread simonjpalmer
I think you need to show a bit more of your code.

ArrayCollection is an index based array, so as long as you are using
0(zero) as the index and not o (the letter o) then removeItemAt()
should work.  

If the error you get is a compiler error, then you aren't strongly
typing the object being referred to or you are assigning the value of
a stringly typed object to an object of type Object - that's what your
error message means.

You would get that if, for instance, you did this...

var obj:Object = ;
var myData:ArrayCollection;

then this line would throw that compiler error...
myData = obj;

if you know that obj is an ArrayCollection then you can safely cast it
to that type during the assignment, e.g.

if (obj is ArrayCollection)
{
myData = ArrayCollection(obj);
}

or...

myData = obj as ArrayCollection;

I think you would benefit from reading the Flex developers guide on
how to use the collection objects and interfaces.

HTH

--- In flexcoders@yahoogroups.com, "flexawesome" <[EMAIL PROTECTED]> wrote:
>
> hummm
> 
> 
> I got this error msg:
> 
> ===
> 
> Severity and Description  PathResourceLocation
> Creation Time   Id
> 1118: Implicit coercion of a value with static type Object to a
> possibly unrelated type mx.collections:ArrayCollection.   test.mxml
> line 69   1194139654331   151789
> 
> 
> --- In flexcoders@yahoogroups.com, "simonjpalmer" 
> wrote:
> >
> > how about 
> > 
> > myData.removeItemAt(0)?
> > 
> > --- In flexcoders@yahoogroups.com, "flexawesome"  wrote:
> > >
> > > 
> > > 
> > > Hey there,
> > > 
> > > I have a problem to remove the first *object* in myData, any
> suggestion?
> > > 
> > > Thank you 
> > > 
> > > === 
> > > 
> > > 
> > > [Bindable]
> > > private var myData:ArrayCollection;
> > > 
> > > myData.removeItemAt(myData.getItemAt(0));
> > >
> >
>




[flexcoders] Re: remove a item in ArrayCollection

2007-11-03 Thread simonjpalmer
you are assigning event.result.sites.site to myData which you have
declared as an ArrayCollection.

What makes you think event.result.sites.site is an ArrayCollection?

Have you inspected event.result.sites.site in the debugger?

--- In flexcoders@yahoogroups.com, "flexawesome" <[EMAIL PROTECTED]> wrote:
>
> 
> here is my completed code... I am going to remove the first site of
> *adobe* in xml
> 
> this seems doesn't in this case, any suggestion? Thanks
> 
> myData.removeItemAt(myData.getItemAt(0));
> 
> == need to remove this part out from ArrayCollection ==
> 
> ADOBE
> 500
> www.adobe.com
> 
> ===
> 
> Code from here..
> 
>  Main MXML File 
> 
> 
> http://www.adobe.com/2006/mxml";
> layout="absolute" 
>   creationComplete="dataServices.send()">
> 
> 
> 
> 
> 
>  resultFormat="object" 
>   result="resultHandler(event)"/>
>  
> 
> 
> 
> 
>  myXML.xml =
> 
>
> 
>   
>   ADOBE
>   500
>   www.adobe.com
>   
> 
>   
>   GOOGLE
>   300
>   www.google.com
>   
> 
> 
> ===
> 
> --- In flexcoders@yahoogroups.com, "Paul Andrews"  wrote:
> >
> > There shouldn't be a problem with Simons suggestion.
> > 
> > Post your code. The message seems to suggest you didn't declare
> myData as an 
> > ArrayCollection, but your original code did.
> > 
> > Hmm..
> > 
> > Paul
> > - Original Message - 
> > From: "flexawesome" 
> > To: 
> > Sent: Sunday, November 04, 2007 1:29 AM
> > Subject: [flexcoders] Re: remove a item in ArrayCollection
> > 
> > 
> > > hummm
> > >
> > >
> > > I got this error msg:
> > >
> > > ===
> > >
> > > Severity and Description Path Resource Location Creation Time Id
> > > 1118: Implicit coercion of a value with static type Object to a
> > > possibly unrelated type mx.collections:ArrayCollection. test.mxml
> > > line 69 1194139654331 151789
> > >
> > >
> > > --- In flexcoders@yahoogroups.com, "simonjpalmer" 
> > > wrote:
> > >>
> > >> how about
> > >>
> > >> myData.removeItemAt(0)?
> > >>
> > >> --- In flexcoders@yahoogroups.com, "flexawesome" 
> wrote:
> > >> >
> > >> >
> > >> >
> > >> > Hey there,
> > >> >
> > >> > I have a problem to remove the first *object* in myData, any
> > > suggestion?
> > >> >
> > >> > Thank you
> > >> >
> > >> > ===
> > >> >
> > >> >
> > >> > [Bindable]
> > >> > private var myData:ArrayCollection;
> > >> >
> > >> > myData.removeItemAt(myData.getItemAt(0));
> > >> >
> > >>
> > >
> > >
> > >
> > >
> > > --
> > > 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
> > >
> > >
> > >
> > >
> >
>




[flexcoders] Re: Where to do heavy lifting in a Flex app? (no threading?)

2007-11-09 Thread simonjpalmer
This is a really good question and something I too grapple with.  I
found this helpful as it explains some of the internals of the player.
 Take a look at doLater(), you never know, it may help.

http://weblogs.macromedia.com/pent/archives/2005/05/dolater_vs_seti.cfm

The reality is that the single threaded nature of the player means
that you cannot have asynchronous processing.  I too was surprised at
how the dispatchEvent processing occurs, but once you start thinking
in flash terms it makes sense.  It isn't particularly suited to your
problem, but it makes sense.

I got round my issues eventually by altering the architecture of my
entire application.  First I broke the processing into smaller pieces
by reducing the size of the transaction with my server, i.e. dealing
with the data at a lower level of granularity - this was probably a
good thing to do in any case.  Second I put processing behind a
progress dialog so at least the user was amused while they were
waiting.  Third I postponed the really heavy work until I had a
suitable moment triggered by a user action that carried the
expectation of a wait (in my case a synchronise action with the server).

Using a single threaded player I found it beneficial to think more
procedurally when structuring my code - back to the good old days of C.

HTH
Simon

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Only one thread in flex/flash actionscript.  Asynch i/o is funneled into
> that thread on each frame.  If you can, break heavy lifting into
> segments per frame or on demand
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of danielggold
> Sent: Friday, November 09, 2007 2:49 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Where to do heavy lifting in a Flex app? (no
> threading?)
> 
>  
> 
> I've got a few data processing functions in a Flex app I'm developing
> that have to do some heavy lifting and require some time to finish
> executing. I'm using cairngorm in this app, and the work is done on
> the result handler of the command. I was surprised to see that this
> function completely stalled the application until it finished
> executing. For some reason since this was done on the result of an
> event, I thought it would be executed in some background thread. I
> really don't care how long it takes to process, I just want the UI to
> be usable while it does its work.
> 
> I did some more tinkering and I discovered that event handling in Flex
> was not working the way I believed. When I call dispatchEvent in a
> function, any functions registered as listeners to this event run to
> completion before the next line of code is executed. I thought the
> "event flow" in Flex would be handled in a different thread some how
> so that dispatchEvent would return to the calling function immediately
> and you could go on with your work, all the listeners would be
> executed at some later time.
> 
> Does anyone have any good insight about where "heavy lifting" should
> be done in Flex? If everything happens serially like this it seems
> like structuring a fairly large application would be tough to do. You
> almost always need a place to do "background work" that is not time
> critical.
> 
> Any responses are appreciated
>




[flexcoders] Re: Where to do heavy lifting in a Flex app? (no threading?)

2007-11-10 Thread simonjpalmer
Funnily enough part of the reason I chose Flash was to offload a whack
of work from the server on to the server-spec processors that every
client machine now possesses (I'm currently using my dual processor
2GHz 4GbRAM laptop to type text into a web form!).  Compared to the
old page based days of html web apps I get 100 times the performance
and scalability on my server just by handing data to the client and
letting it do a lot of what was traditionally server processing.  This
is why I love Flash and I thought that was the point of a RIA.  That
and the fact that our RIA apps feel like the desktop rather than the web.

So while I agree that there should be an appropriate transaction size
and handshake with the server I can also see a very good argument to
say that the client should be more powerful.  Imagine if the player
was multi-threaded... Why not use the processing power on the client
to lighten the server load?  What's so special about the server that
all the processing has to happen there?  It could then be purely a
persistence tier with almost no business logic.  In some apps that
would be highly desirable and in all cases would lead to more scalable
servers.

Agree with the onions, never been close enough to an ogre to
understand them completely, but I'm sure they are complex people too.
 Conventional wisdom is certainly with you on the apps.

--- In flexcoders@yahoogroups.com, "barry.beattie" <[EMAIL PROTECTED]>
wrote:
>
> 
> > People have been begging for some kind of threading for  a long time,
> > but the Flash Player team seems pretty adamant that this won't happen
> > any time soon.
> 
> and, IMHO, fair enough too. The SWF is just the UI, it's not the whole
> application**. There's async calls to the server and Java (and ow
> CF)have threading as well. Just how much of the layers of an
> application do people want the UI to do?
> 
> And it's quite possible that it won't just be the CF/PHP/Java code
> that does the heavy lifting either (well, maybe not in this case...) -
> it could very well be the database doing hundreds of lines of SQL
> munging to get data to run some charts (eg: it doesn't make sence to
> pull raw data into the SWF - then  do a ton of processing on a single
> thread - just to run some charts).
> 
> Onions - they have layers. Ogres - they have layers. Applications -
> they have layers too.
> 
> 
> ** OK, so there are some grey areas where applications are ALL UI and
> very little else. Still..
>




[flexcoders] Interfaces and Implements

2007-11-21 Thread simonjpalmer
Hi, I am having a problem with defining and using interfaces on my AS3
classes.  Here's my scenario...

class A implements IA{}
class B implements IB{}

class Wrapper implements IWrapper
{
public var a:A;
public var b:B;
}

interface IWrapper
{
function get a():IA;
function get b():IB;
}

When I compile this I get an error:

"Interface method get a in namespace IWrapper is implemented with an
incompatible signature in class Wrapper"

A implements IA and get a() returns an instance of class A, so why the
error?  

This is making it a bit hard to code against interfaces rather than
concrete classes.

Any ideas?



[flexcoders] Re: Interfaces and Implements

2007-11-21 Thread simonjpalmer
I thought about the bindable route and in fact the Wrapper class is
[Managed] so I believe the properties are all bindable and therefore
getters and setter will exist.

As a matter of interest if I did this...

[Managed]
[RemoteClass(alias="com.simon.Wrapper")]
class Wrapper implements IWrapper
{
public var a:IA;
public var b:IB;
}

and on the Java server

package com.simon;
class Wrapper
{
public A a;
public B b;
}

and presuming A and B were also managed objects, what would happen to
Wrapper.a and Wrapper.b when I retrieve Wrapper via a RemoteObject?

Would it find and populate a and b?

Simon

--- In flexcoders@yahoogroups.com, "Peter Hall" <[EMAIL PROTECTED]> wrote:
>
> Alternatively, you can make those properties bindable. This will cause
> the compiler to automatically generate the corresponding getter and
> setter and the interface will be implemented.
> 
> However, your example will never work as it is. AS3 currently does not
> allow implementation signatures to differ at all from the interface,
> even if they are compatible. I'm hoping that will be "fixed" in a
> future release.
> 
> Peter
> 
> On Nov 21, 2007 5:25 PM, Gordon Smith <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > You can't use a var to implement a getter... you have to write a
getter. And
> > it has to have exactly the same signature.
> >
> > - Gordon
> >
> >  
> >  From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
> > Behalf Of simonjpalmer
> > Sent: Wednesday, November 21, 2007 2:21 PM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] Interfaces and Implements
> >
> >
> >
> >
> >
> > Hi, I am having a problem with defining and using interfaces on my AS3
> > classes. Here's my scenario...
> >
> > class A implements IA{}
> > class B implements IB{}
> >
> > class Wrapper implements IWrapper
> > {
> > public var a:A;
> > public var b:B;
> > }
> >
> > interface IWrapper
> > {
> > function get a():IA;
> > function get b():IB;
> > }
> >
> > When I compile this I get an error:
> >
> > "Interface method get a in namespace IWrapper is implemented with an
> > incompatible signature in class Wrapper"
> >
> > A implements IA and get a() returns an instance of class A, so why the
> > error?
> >
> > This is making it a bit hard to code against interfaces rather than
> > concrete classes.
> >
> > Any ideas?
> >
> >
>




[flexcoders] irregular x-axis intervals on a line chart

2007-11-21 Thread simonjpalmer
I have a situation where I am plotting time on the x-axis of a line
chart and a continuous numeric quantity on the y-axis.  The events
which form the data series do not happen at regular intervals, so the
gap between them on the x-axis is irregular.  I have several series of
data that exhibit this, each captured on its own irregular schedule.  

If I put this on a line chart and make the x-axis interval regular it
skews the slope of the line between points and misrepresents the data.
 Worse I end up lining up events which did not happen simultaneously
and I cannot label the x-axis at all.

If I was doing this in Excel I would create a 2-D scatter plot with
lines joining the dots.  Anyone seen a good example of how to do this
kind of chart in Flex?



[flexcoders] Re: Interfaces and Implements

2007-11-21 Thread simonjpalmer
I haven't tried it yet, I'll let you know how I get on.

--- In flexcoders@yahoogroups.com, "Peter Hall" <[EMAIL PROTECTED]> wrote:
>
> Looks like it should work. Did you try it and have problems?
> 
> Peter
> 
> 
> On Nov 22, 2007 12:54 AM, simonjpalmer <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> >
> > I thought about the bindable route and in fact the Wrapper class is
> >  [Managed] so I believe the properties are all bindable and therefore
> >  getters and setter will exist.
> >
> >  As a matter of interest if I did this...
> >
> >  [Managed]
> >  [RemoteClass(alias="com.simon.Wrapper")]
> >  class Wrapper implements IWrapper
> >  {
> >  public var a:IA;
> >  public var b:IB;
> >  }
> >
> >  and on the Java server
> >
> >  package com.simon;
> >  class Wrapper
> >  {
> >  public A a;
> >  public B b;
> >  }
> >
> >  and presuming A and B were also managed objects, what would happen to
> >  Wrapper.a and Wrapper.b when I retrieve Wrapper via a RemoteObject?
> >
> >  Would it find and populate a and b?
> >
> >  Simon
> >
> >
> >  --- In flexcoders@yahoogroups.com, "Peter Hall"  wrote:
> >  >
> >  > Alternatively, you can make those properties bindable. This
will cause
> >  > the compiler to automatically generate the corresponding getter and
> >  > setter and the interface will be implemented.
> >  >
> >  > However, your example will never work as it is. AS3 currently
does not
> >  > allow implementation signatures to differ at all from the
interface,
> >  > even if they are compatible. I'm hoping that will be "fixed" in a
> >  > future release.
> >  >
> >  > Peter
> >  >
> >
> >  > On Nov 21, 2007 5:25 PM, Gordon Smith  wrote:
> >  > >
> >  > >
> >  > >
> >  > >
> >  > >
> >  > >
> >  > >
> >  > > You can't use a var to implement a getter... you have to write a
> >  getter. And
> >  > > it has to have exactly the same signature.
> >  > >
> >  > > - Gordon
> >  > >
> >  > > 
> >  > > From: flexcoders@yahoogroups.com
> >  [mailto:[EMAIL PROTECTED] On
> >  > > Behalf Of simonjpalmer
> >  > > Sent: Wednesday, November 21, 2007 2:21 PM
> >  > > To: flexcoders@yahoogroups.com
> >  > > Subject: [flexcoders] Interfaces and Implements
> >  > >
> >  > >
> >  > >
> >  > >
> >  > >
> >  > > Hi, I am having a problem with defining and using interfaces
on my AS3
> >  > > classes. Here's my scenario...
> >  > >
> >  > > class A implements IA{}
> >  > > class B implements IB{}
> >  > >
> >  > > class Wrapper implements IWrapper
> >  > > {
> >  > > public var a:A;
> >  > > public var b:B;
> >  > > }
> >  > >
> >  > > interface IWrapper
> >  > > {
> >  > > function get a():IA;
> >  > > function get b():IB;
> >  > > }
> >  > >
> >  > > When I compile this I get an error:
> >  > >
> >  > > "Interface method get a in namespace IWrapper is implemented
with an
> >  > > incompatible signature in class Wrapper"
> >  > >
> >  > > A implements IA and get a() returns an instance of class A,
so why the
> >  > > error?
> >  > >
> >  > > This is making it a bit hard to code against interfaces
rather than
> >  > > concrete classes.
> >  > >
> >  > > Any ideas?
> >  > >
> >  > >
> >  >
> >
> >
> >
> >
>




[flexcoders] Re: irregular x-axis intervals on a line chart

2007-11-22 Thread simonjpalmer
dumb question, but how do I post screenshots to flexcoders?

--- In flexcoders@yahoogroups.com, "Sunil Bannur" <[EMAIL PROTECTED]> wrote:
>
> Can you post a screenshot, it would be easier to understand.
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Thursday, November 22, 2007 7:27 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] irregular x-axis intervals on a line chart
> 
>  
> 
> I have a situation where I am plotting time on the x-axis of a line
> chart and a continuous numeric quantity on the y-axis. The events
> which form the data series do not happen at regular intervals, so the
> gap between them on the x-axis is irregular. I have several series of
> data that exhibit this, each captured on its own irregular schedule. 
> 
> If I put this on a line chart and make the x-axis interval regular it
> skews the slope of the line between points and misrepresents the data.
> Worse I end up lining up events which did not happen simultaneously
> and I cannot label the x-axis at all.
> 
> If I was doing this in Excel I would create a 2-D scatter plot with
> lines joining the dots. Anyone seen a good example of how to do this
> kind of chart in Flex?
>




[flexcoders] Re: How to change application background color dynamically

2007-11-22 Thread simonjpalmer
You can also use states on the app...










then set the app state once you know what type of user you are dealing
with...

app.currentState = "Manager";

--- In flexcoders@yahoogroups.com, "Kenneth Sutherland"
<[EMAIL PROTECTED]> wrote:
>
> You want to create a separate css style sheet for each type of user.
> Then have a look at the following
> http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhel
> p.htm?context=LiveDocs_Book_Parts&file=styles_069_26.html
> 
>  
> 
> This will let you change the styling of the app at runtime.  So if you
> know that the user that just logged in is the manager and your CSS file
> for the manager is called 'manager' then you'd do the following - 
> 
> StyleManager.loadStyleDeclarations( manager.swf, true );
> 
>  
> 
>  
> 
> Take note that you need to compile the css into a swf. Just right click
> the css file in flexbuilder and tick the option 'compile css to swf'
> 
>  
> 
> Kenneth.
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of girish_ok
> Sent: 22 November 2007 07:51
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] How to change application background color
> dynamically
> 
>  
> 
> Hi All,
> 
> In my project I am loading mxml components based on User Roles and 
> Rights. For each mxml component i have used different colors and 
> displaying the component in centered screen.
> 
> like
> If the user= Manager [background color = blue ] I am loading manager 
> related component,
> If the user= Seller [backgound color = green ] I am loading Seller 
> related component and etc.,
> 
> My main.mxml application is background is different [default color]
> When i load component it should reflect the color [change the 
> background color] in main.mxml application. how can i achieve this
>




[flexcoders] Dynamically Setting width of a TextInput control

2007-11-22 Thread simonjpalmer
I am using a TextInput control as an item renderer and I want to set
the width of the control to reflect the size of the text within it. 
The text comes from a property of the data associated with the item
renderer.  I am overriding the set data method in order to set the
text and some stle properties, but I can't figure out how to set the
width of the control.

Any ideas?



[flexcoders] has anyone written an arrowhead edge renderer for the springggraph?

2007-11-22 Thread simonjpalmer
I want some of my edges to be directional.

Anyone have a UI component which draws an arrow that they would't mind
sharing?



[flexcoders] Re: Dynamically Setting width of a TextInput control

2007-11-24 Thread simonjpalmer
this is not in a datagrid it is just a dynamically created control on
a canvas

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> The renderer's width is fixed to the size of the column
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Thursday, November 22, 2007 11:49 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Dynamically Setting width of a TextInput control
> 
>  
> 
> I am using a TextInput control as an item renderer and I want to set
> the width of the control to reflect the size of the text within it. 
> The text comes from a property of the data associated with the item
> renderer. I am overriding the set data method in order to set the
> text and some stle properties, but I can't figure out how to set the
> width of the control.
> 
> Any ideas?
>




[flexcoders] Re: Dynamically Setting width of a TextInput control

2007-11-28 Thread simonjpalmer
I think I have been speaking forked tongue a little.  It is an
itemRenderer but not for a DataGrid, it's for the springgraph.  I was
tracing through that code and it appears to create its item renderers
as free standing controls on a canvas, hence my remark.  In my case I
want the nodes in the springgraph just to be text, hence the use of a
TextInput control which gives me nice control over some of the styling.

This means I also do not explicitly control the sequence in which the
text of the control gets set.  I override the set data() method so I
can also change some other properties of the control at the same time.
 That's when I want to set the control width.

Simon

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Hmm, you explicitly mentioned "item renderer".
> 
>  
> 
> Anyway, if you set the .text early enough, the TextInput should pick it
> up.
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Saturday, November 24, 2007 7:05 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Dynamically Setting width of a TextInput
> control
> 
>  
> 
> this is not in a datagrid it is just a dynamically created control on
> a canvas
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui"  wrote:
> >
> > The renderer's width is fixed to the size of the column
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of simonjpalmer
> > Sent: Thursday, November 22, 2007 11:49 AM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Dynamically Setting width of a TextInput control
> > 
> > 
> > 
> > I am using a TextInput control as an item renderer and I want to set
> > the width of the control to reflect the size of the text within it. 
> > The text comes from a property of the data associated with the item
> > renderer. I am overriding the set data method in order to set the
> > text and some stle properties, but I can't figure out how to set the
> > width of the control.
> > 
> > Any ideas?
> >
>




[flexcoders] Re: Tracing HTTPService Data?

2007-11-28 Thread simonjpalmer
You can get at the contents of the messages using  on
the client, which will spit a whole load of stuff to your console in
debug mode.  

I don't use an http service, but I know that on the server you can
alter the level of logging by adjusting the contents of the logging
tag in services-config.xml.

hth
Simon 

--- In flexcoders@yahoogroups.com, "flexnubslice" <[EMAIL PROTECTED]> wrote:
>
> Hi there,
> 
>   Thanks in advance for your help.  I'm a newcomer to Flex, but am
> definitely not new to Eclipse being a Java programmer by trade.
> 
>   I've set up a basic HTTPService as introductory project, and quickly
> found that I can add breakpoints into fault and result events.  What I
> cannot find though, is how to trace the data that the HTTP portal is
> feeding the Flex app.  Is there a means to debug the actual request
data?
> 
> Thanks.
> Alex
>




[flexcoders] RemoteObject silently throwing #1009 null object error

2007-12-10 Thread simonjpalmer
Hi,

FB2 + FDS.

I have a RemoteObject silently throwing the following error when I
call a remote method:

TypeError: Error #1009: Cannot access a property or method of a null
object reference.

Does anyone know of a way I can track down what exactly is causing the
error to be thrown?  I have been using TraceTarget in my app to try
and see what is going on but no message ever gets created (I guess
this error is thrown while the message is being created).  Ideally I
want to be able to step through the framework code in the debugger so
I can examine my value object graph at the point the error gets thrown.

It is clearly data related because some objects succeed via the same
method and others do not.  There is nothing obvious in my data or code
that would cause a null to occur and I have spent days looking for
possible culprits and found and fixed quite a few with no effect.

What I really need is to be able to see what the framework is
objecting to.

Anyone else come across this?  Anyone have any suggestions?

tia
Simon



[flexcoders] Re: RemoteObject silently throwing #1009 null object error

2007-12-11 Thread simonjpalmer
Jeff,

thanks for the reply.  Couple of questions:

1) I tried stepping into the remote object call but I can't figure out
the source path for the following which is where the first step takes me

mx.rpc::AbstractService/http://www.adobe.com/2006/actionscript/flash/proxy::callProperty

2) If my error is happening as the message gets created is that not
AMF serialization rather than de-serialization?  Do I have that the
wrong way up?

I don't see why a set method would be called when serializing, but I
can understand if it were deserializing.  Either way this is an
interesting new line of investigation, I'll check all my setters.

Simon


--- In flexcoders@yahoogroups.com, "Jeff Vroom" <[EMAIL PROTECTED]> wrote:
>
> I've seen this before when an error occurs in a "set" method being
> invoked during AMF deserialization.  In FB, you should be able to stop
> in those methods and/or add your own trace statements to find the
> problem.   This all happens before the FDS code is executed which is why
> TraceTarget is showing anything.  
> 
>  
> 
> Jeff
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Monday, December 10, 2007 11:53 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] RemoteObject silently throwing #1009 null object
> error
> 
>  
> 
> Hi,
> 
> FB2 + FDS.
> 
> I have a RemoteObject silently throwing the following error when I
> call a remote method:
> 
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
> 
> Does anyone know of a way I can track down what exactly is causing the
> error to be thrown? I have been using TraceTarget in my app to try
> and see what is going on but no message ever gets created (I guess
> this error is thrown while the message is being created). Ideally I
> want to be able to step through the framework code in the debugger so
> I can examine my value object graph at the point the error gets thrown.
> 
> It is clearly data related because some objects succeed via the same
> method and others do not. There is nothing obvious in my data or code
> that would cause a null to occur and I have spent days looking for
> possible culprits and found and fixed quite a few with no effect.
> 
> What I really need is to be able to see what the framework is
> objecting to.
> 
> Anyone else come across this? Anyone have any suggestions?
> 
> tia
> Simon
>




[flexcoders] Re: Managed Value Object error

2007-12-15 Thread simonjpalmer
I don't have an answer for you, but a couple of questions as thought
starters.  Are you building a library or an application?  Is your
project one which includes data services?  I wonder whether you have
to create a certain kind of project in order to have these libraries
incorporated by default.

Hope you figure it out.

--- In flexcoders@yahoogroups.com, "arieljake" <[EMAIL PROTECTED]> wrote:
>
> I have added [Managed] to a VO class and now, compiling produces these
> errors:
> 
> Error: Definition mx.data:IManaged could not be found.
> Error: Definition mx.data.utils:Managed could not be found.
> 
> I can't find anything on Google or this group's archives about this.
> Can someone help me get rid of this error?
> 
> Thanks.
>




[flexcoders] Re: DataServices destinations design dilemma...

2007-12-15 Thread simonjpalmer
I had the exact same problem, I think the issue is not really
inheritance but the graph of objects being arbitrarily complex and deep.  

I got round it by ditching the managed associations completely and
going for RPC calls to my Java classes using RemoteObjects.  I found
myself too tangled by the destinations and weird and undesirable
behaviour of the framework that I had no control over.  

In my case a close examination of the reality of the usage of my
object model showed that I rarely had a true cyclic graph and in fact
towards the edges it was much more like a directed acyclic graph, so I
constrained the application to enforce that and altered the server
transaction to lift the graph in little hierarchies rather than as
individual components.  I think it is always a good idea to make sure
your model fits exactly what you are doing rather than some potential
fringe use cases at the cost of complexity.  You have probably done
that already.

The suggested solution of separating the objects and the relationships
is a great idea as well, and you can reconstitute it quite easily on
the client side if you need to.  This is probably my next major
architectural overhaul.  On the client the use of a Dictionary or
Object as a proxy for a hash map offers some interesting architectural
opportunities.

As an aside I also found that very deep hierarchies of objects caused
Hibernate to create a lot of joins and or inefficient sub-queries and
it was impractical for my purposes from a performance standpoint.  I
found iBatis a much better fit because 1) I have SQL expertise and 2)
I don't have the issue of having to make sure my persistence tier
works on all known rdbms's so I could take advantage of some db
specific features.

--- In flexcoders@yahoogroups.com, "Josh VanderBerg" <[EMAIL PROTECTED]> wrote:
>
> I tend to eschew implementing inheritance in data model that needs to
> be persisted to a database - preferring (in this example) instead to
> overload PetVO with all of the possible pet properties and give it a
> petType property.  Regardless of whether or not you implement
> inheritance, the PetVO must have a property:
> 
>   public var friends : ArrayCollection;
> 
> In the database you will have to have a table something like the
following
> 
> PetRelationship
> 
>relationship_id   INT (Autonumber) - surrogate key
>pet_id  INT - FK Pet table
>friend_id   INT - FK Pet table
> 
> And use it to do your data services mapping, and map it appropriately
> in Hibernate as well (if that's what you are using).  You could
> optionally expose this object as an endpoint itself, so it would be
> the home of the "friends" lists.  In this case the PetVO would just
> have a property:
> 
> public var relationship : PetRelationship;
> 
> And your mapped PetRelationShipVO would store the ArrayCollection of
> friends.
> 
> Now, the application of either would be relatively obvious in the case
> where you don't implement inheritance in the datamodel.  I am sure
> there is a way to do it with inheritance - I've just never done it -
> but the approach would be similar, you really need a many-to-many
> mapping table at the PetVO level.
> 
> __
> Josh Vanderberg - vanderblog.typepad.com
> 
> --- In flexcoders@yahoogroups.com, Kevin  wrote:
> >
> > DataServices experts,
> > 
> > We are currently stumped on how to configure our data-management  
> > config to address a very specific data model that we have.  I would  
> > love to get some ideas/feedback on how to solve this dilemma.  Here  
> > is our problem (as simplified as possible).
> > 
> > We have a number of objects that extend a root object like so:
> > 
> > PetsVO(root object)
> > extended by:
> > - DogVO
> > - CatVO
> > - BirdVO
> > - FishVO
> > - RatVO
> > 
> > Here is the problem.  Each object can hold a collection of pet's  
> > objects.  So in a social networking way, each pet can be linked to  
> > its pet friends.
> > DogVO
> > - holds collection of PetVO's
> > CatVO
> > - holds collection of PetVO's
> > BirdVO
> > - holds collection of PetVO's
> > ... you get the idea.
> > 
> > So, how do with deal with this in our destinations??
> > 
> > Option 1) Hierarchical management.
> > - This works conceptually of course since no association tags are  
> > required to link the destinations together.  However, we then have  
> > major scaling issues & no way to throttle individual destinations,  
> > etc... Not really a working solution unless your model was truly as  
> > simple as the one I am describing.
> > 
> > Option 2) Use destinations to manage relationships.
> > 
> > We set up destinations for each of these sub classes:
> > dogs
> > cats
> > birds
> > fish
> > rats
> > 
> > However, how do we associate the PetVO collection in each?
> > 
> > 
> > 
> > THOUGHT 1: If we have a pets destination and set up a "many-to-many"  
> > tag from "dogs" to "pets" then we create the problem where we are  
> > managing the same object in two different place

[flexcoders] Re: Bind to Checkbox and ComboBox

2007-12-16 Thread simonjpalmer
It depends on what flexibility you want out of these lists of values.
 If you think the list is likely to grow or you might want them in
different languages, or altered for different customers, then put them
all in a domain values table and map to them with ints.  Then lift the
entire contents of that table across to the client.  

That's the classic data warehousing approach to this problem and means
that the persistence tier is responsible for the model and mappings,
and the metadata and domain values are stored only once.  It also
means that report writers can get at everything they need from the
database - if you have the requirement to report directly against your
data.  

This is intellectualy the best approach, but it is also the most
complicated.  In my experience, unless you have a firm set of
requirements for reporting it will introduce unnecessary complexity
and performance overhead to your persistence tier to code for that
theorietical eventuality, so you should only do it if your customer
has stated it as a necessity.

Alternatively, if they are genuinley just a few values which are
fixed, then I would still store int proxies for them in my data model,
but there's no need for an additional table, just use static text
variables in your client code so the values are consistents and
managed in a single place.  Make an AS class called, say, "Constants"
 and have something like this...

class Constants
{
public static var FREQUENCY_MONTHLY:int = 0;
public static var FREQUENCY_YEARLY:int = 1;
public static var FREQUENCY_MANUAL:int = 2;
public static var FREQUENCY_TEXT:ArrayCollection = new
ArrayCollection(["monthly", "yearly", "manual"])
}

then in your controls you can use these for binding (you'll get a
silly compiler warning) e.g.



private function loadSelectionOntoValueObject():void
{
my_value_object.frequency_field = X.selectedIndex;
}

Both ways are valid, both have pros and cons, both store only an int
in your value object, it is just a question of where the management of
the list of values resides, client or database.  You'll probably have
a good feel for which is best for your application.

hth
Simon

--- In flexcoders@yahoogroups.com, "Dan Tavelli" <[EMAIL PROTECTED]> wrote:
>
> This is sort of a database design question, but I am interested what
> the best practice is to store the following information and bind that
> data to controls in flex.
> 
> Basically there is a form to show which reports a company is
> submitting, and if they are submitting at what frequency.
> 
> In flex the UI would be:
> A checkbox that indicates whether they are submitting for that report.
> A combobox that indicates the frequency that report is being submitted.
> 
> In MySQL:
> I was orginally thinking of using enum('true','false') for the
report_name
> 
> and enum('monthly','yearly','manual') for report frequency.
> 
> This didn't seem like it was the best solution, especially since there
> is more than one report and it didn't seem like a good design to have
> the same enum('montly','yearly'..) repeated for each report.
> 
> Then I thought have one field with the report name with field type of
> INT.  And if it was 0 that would indicate they were not submitting.  1
> would mean manually, 2 monthly..etc. Seems smarter but isn't very
> descriptive on the database side?
> 
> I'm sure this is common scenario, what is the best practice for this?
> 
> Dan
>




[flexcoders] Re: Add a custom shortcut to our application

2007-12-16 Thread simonjpalmer
add an event handler to your app to trap a key down event and then
check for the combinations you support as shortcuts and perform the
your functions accordingly.

here's a fragment from my own code which traps ctrl+shift+D and shows
some debug messages...

in my app's initialisation routine...

addEventListener(KeyboardEvent.KEY_DOWN, watchKey);

private function watchKey(e:KeyboardEvent):void
{
if (e.ctrlKey && e.shiftKey)
{
if(e.keyCode == 68)
{
toggleDebug();
}
}
}

this is all in the docs...
Simon
--- In flexcoders@yahoogroups.com, "Alejandro Narancio"
<[EMAIL PROTECTED]> wrote:
>
> Hi all!
> 
> I am trying to add a shortcut to my application (for example when
the user
> press Ctrl+P open a print dialog), it is possible to catch this? I
mean to
> make custom shortcuts for my application?
> 
> I will appreciate any suggestion or guideline.
> 
> thanks!
> Alejandro
>




[flexcoders] Re: Add a custom shortcut to our application

2007-12-17 Thread simonjpalmer
one thing to check is whether your app has focus in the browser window
- some browsers do not give the player focus by default.  If you click
somewhere on your app running in the browser then press a key do you
get a message?  

Another route would be to add a control to your app which definitely
accepts focus (like a button) and move the event handling code in
there - just to test how to get your app responding to keyboard events.

This code does work for me, but my app's front page is somewhat more
complex than the app you describe below.

--- In flexcoders@yahoogroups.com, "Alejandro Narancio"
<[EMAIL PROTECTED]> wrote:
>
> Hi I already try that but is not working for me, using your example
I also
> tested this (first calling init() from the initialize and after from the
> applicationComplete):
> 
> 
> http://www.adobe.com/2006/mxml";
layout="absolute"
> initialize="init()">
> 
> 
> 
> 
> 
> 
> 
> This is not working for me when I press a key I am not receiving any
popup
> window.
> 
> Thanks,
> Alejandro
> 
> 
> On Dec 16, 2007 5:41 PM, simonjpalmer <[EMAIL PROTECTED]> wrote:
> 
> >   add an event handler to your app to trap a key down event and then
> > check for the combinations you support as shortcuts and perform the
> > your functions accordingly.
> >
> > here's a fragment from my own code which traps ctrl+shift+D and shows
> > some debug messages...
> >
> > in my app's initialisation routine...
> >
> > addEventListener(KeyboardEvent.KEY_DOWN, watchKey);
> >
> > private function watchKey(e:KeyboardEvent):void
> > {
> > if (e.ctrlKey && e.shiftKey)
> > {
> > if(e.keyCode == 68)
> > {
> > toggleDebug();
> > }
> > }
> > }
> >
> > this is all in the docs...
> > Simon
> > --- In flexcoders@yahoogroups.com ,
> > "Alejandro Narancio"
> >
> >  wrote:
> > >
> > > Hi all!
> > >
> > > I am trying to add a shortcut to my application (for example when
> > the user
> > > press Ctrl+P open a print dialog), it is possible to catch this? I
> > mean to
> > > make custom shortcuts for my application?
> > >
> > > I will appreciate any suggestion or guideline.
> > >
> > > thanks!
> > > Alejandro
> > >
> >
> >  
> >
>




[flexcoders] Re: DataServices destinations design dilemma...

2007-12-17 Thread simonjpalmer
to  
> > write your own assembler for that OR is there one publicly available  
> > to integrate with DataServices?
> > 
> > As far as inheritance issue, ironically, the overloaded PetVO with  
> > the pet type property is how I have dealt with this in the past  
> > (..but I have also always written my own db queries).  I find it a  
> > little messy on the client since you end up having to keep track of  
> > what properties go with what, but it works and was very efficient.   
> > On this project I decided to try my hand at programming everything  
> > from a more strict Object perspective and seeing if Hibernate could  
> > handle the rest... Hibernate seems to be doing ok (remains to be  
> > seen), but I am running into some limitations with DataServices.
> > 
> > I'll keep poking at this and see if I can apply some of your  
> > suggestions without completely abandoning out data model.
> > 
> > Thanks, Kevin
> > 
> > 
> > 
> > On Dec 15, 2007, at 6:33 PM, simonjpalmer wrote:
> > 
> > > I had the exact same problem, I think the issue is not really
> > > inheritance but the graph of objects being arbitrarily complex and  
> > > deep.
> > >
> > > I got round it by ditching the managed associations completely and
> > > going for RPC calls to my Java classes using RemoteObjects. I found
> > > myself too tangled by the destinations and weird and undesirable
> > > behaviour of the framework that I had no control over.
> > >
> > > In my case a close examination of the reality of the usage of my
> > > object model showed that I rarely had a true cyclic graph and in
fact
> > > towards the edges it was much more like a directed acyclic
graph, so I
> > > constrained the application to enforce that and altered the server
> > > transaction to lift the graph in little hierarchies rather than as
> > > individual components. I think it is always a good idea to make sure
> > > your model fits exactly what you are doing rather than some
potential
> > > fringe use cases at the cost of complexity. You have probably done
> > > that already.
> > >
> > > The suggested solution of separating the objects and the
relationships
> > > is a great idea as well, and you can reconstitute it quite easily on
> > > the client side if you need to. This is probably my next major
> > > architectural overhaul. On the client the use of a Dictionary or
> > > Object as a proxy for a hash map offers some interesting
architectural
> > > opportunities.
> > >
> > > As an aside I also found that very deep hierarchies of objects
caused
> > > Hibernate to create a lot of joins and or inefficient
sub-queries and
> > > it was impractical for my purposes from a performance standpoint. I
> > > found iBatis a much better fit because 1) I have SQL expertise
and 2)
> > > I don't have the issue of having to make sure my persistence tier
> > > works on all known rdbms's so I could take advantage of some db
> > > specific features.
> > >
> > > --- In flexcoders@yahoogroups.com, "Josh VanderBerg"   
> > > wrote:
> > > >
> > > > I tend to eschew implementing inheritance in data model that  
> > > needs to
> > > > be persisted to a database - preferring (in this example)
instead to
> > > > overload PetVO with all of the possible pet properties and
give it a
> > > > petType property. Regardless of whether or not you implement
> > > > inheritance, the PetVO must have a property:
> > > >
> > > > public var friends : ArrayCollection;
> > > >
> > > > In the database you will have to have a table something like the
> > > following
> > > >
> > > > PetRelationship
> > > >
> > > > relationship_id INT (Autonumber) - surrogate key
> > > > pet_id INT - FK Pet table
> > > > friend_id INT - FK Pet table
> > > >
> > > > And use it to do your data services mapping, and map it  
> > > appropriately
> > > > in Hibernate as well (if that's what you are using). You could
> > > > optionally expose this object as an endpoint itself, so it
would be
> > > > the home of the "friends" lists. In this case the PetVO would just
> > > > have a property:
> > > >
> > > > public var relationship : PetRelationship;
> > > >
> > > > And your mapped PetRelationShipVO would st

[flexcoders] Re: how to pass varible between screens?

2007-12-21 Thread simonjpalmer
Can't you do this...

put your ViewStack in a control and put a bindable variable in that
control and each of the FormXView controls as well

e.g...

and in each of the ViewXControls script blocks...

[Bindable] public var my_var_ref:String;

and in the enclosing control...





  
  
  
...


Operate on my_var_ref in each of the views and binding will make sure
the value is transferred to the my_var_ref control variables.

If you want to take it a step further and have a genuine app wide
singleton you can put my_var on your app and either add a public
static getInstance() method to your app or refer to it through
myApp(Application.application).my_var;

hth
Simon

--- In flexcoders@yahoogroups.com, "markflex2007" <[EMAIL PROTECTED]>
wrote:
>
> Hi,
> 
> I have some screens under ViewStack like this
>   
>  
>
> 
> 
>   
>   
> 
> I have a variable in Form1View  but how I can get the variable in 
> Form2View.
> 
> backend language have session variables,I am not sure if Flex also 
> have the same function like session variable.
> 
> Please help me out.Thanks
> 
> Thanks
> 
> Mark
>




[flexcoders] Re: Solutions for provide a secure access to a Web-Service using Flex

2007-12-21 Thread simonjpalmer
if that's all your doing, then could you not expose an API specfic to
the purpose and use a different protocol, for instance AMF via RPC for
access from your flash client?  If you are really only showing a form
and presenting some choices this sounds like it could be a pretty
trivial re-factoring of existing server code.

--- In flexcoders@yahoogroups.com, João <[EMAIL PROTECTED]> wrote:
>
> First of all, thank you for you suggestions. This module doesn't imply
> a user login. It's a tool available to everyone that let's the visitor
> fill a form, and at the end the module will offer a list of services
> depending on the data provided. 
> You could easily ask: "so, if the module is publicly accessible, why
> wouldn't the web-service be also available if both provide the same
> data?". The question here is that, among other things, the client
> doesn't want other providers to use it's service. 
> 
> Having the key hard-coded on the client application, even if
> encrypted, wouldn't solve nothing since with a man on the middle
> attack it would be possible to get the key and replicate it. 
> I will read some documentation about public key infrastructures, and i
> guess i will find easily a teorical solution from what i recall from
> what i've learned on university. But what i need to know is if Adobe
> Flex has tools (on the SDK, or others available as open-source) to
> help us solve this kind of problems. And also, if there is some
> documentation or examples available on the internet around this
> subject for the flash platform.
> 
> Thanks, 
> 
> João Saleiro
> 
> http://.riapt.pt
> http://www.webfuel.pt
>




[flexcoders] as3salesforce.swc

2007-12-23 Thread simonjpalmer
is anyone successfully using the as3salesforce.swc library and
examples to connect to salesforce.com?

I can't get past this error on login in the example code...

faultDetail = "Error: [IOErrorEvent type="ioError" bubbles=false
cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL:
https://www.salesforce.com/services/Soap/u/11.0";]. URL:
https://www.salesforce.com/services/Soap/u/11.0";
faultString = "HTTP request error"
message = "faultCode:Server.Error.Request faultString:'HTTP request
error' faultDetail:'Error: [IOErrorEvent type="ioError" bubbles=false
cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL:
https://www.salesforce.com/services/Soap/u/11.0";]. URL:
https://www.salesforce.com/services/Soap/u/11.0'"

Have tried a million things, time for a cup of tea and a mince pie.

Happy Christmas



[flexcoders] Re: Can anyone help me get this amazing fire effect work ...

2007-12-23 Thread simonjpalmer
I got it working...

couple of things:

1) Buttons are not movie clips, they are sprites and don't have a
timeline, so you have to create a movie clip and add your text to it.
2) You have to add the clips to the application's stage, not the
application itself.

if you hack around a little you should be able to get it to work.  If
you are really stuck I'll post my mods.

The effect is a bit underwhelming...

--- In flexcoders@yahoogroups.com, "Corey Smaller" <[EMAIL PROTECTED]>
wrote:
>
> -
> http://flexlib.googlecode.com/svn/trunk/docs/flexlib/controls/Fire.html
> 
> is this the same code?  should work
> 
> 
> 
> -- In flexcoders@yahoogroups.com, "helihobby"  wrote:
> >
> > I got this Effect from a friend and its written in Flash but all in
> > Actionscript 3 so it should work for Flex as well ... right ?
> > 
> > The code is posted...
> > 
> > Can anyone help get this to work.
> > Its an amazing fire effect.
> > 
> > Here is the code. ( PS in Flash CS3 it works great !!! )
> > 
> > 
> > 
> > 
> > 
> > http://www.adobe.com/2006/mxml";
> > layout="absolute" creationComplete="init()">
> > 
> > 
> > 
> > 
> > 
> >  > click="{setFire(this as MovieClip)}"/>
> > 
> > 
> > 
> >
>




[flexcoders] Re: Can anyone help me get this amazing fire effect work ...

2007-12-24 Thread simonjpalmer
merry christmas...


http://www.adobe.com/2006/mxml";
layout="absolute" creationComplete="init()"
backgroundGradientColors="[#ff, #00]">












[flexcoders] Re: Application Structure

2007-12-24 Thread simonjpalmer
Ask your users and if their ideal solution is a bit annoying for you
to code, then suck it up.  If you are really mimicking email systems
then there are lots of precedents out there, all of which have had
millions of dollars of UI design invested in them.  

If you can't ask your users it may be smart to borrow some ideas from
Outlook/gmail/yahoo/hotmail.  Pretty much all of them have different
grids for different message lists in one form or another - especially
for spam.

--- In flexcoders@yahoogroups.com, Max Frigge <[EMAIL PROTECTED]> wrote:
>
> Thanks for your reply. That's the approach I did. Data structure is the 
> same all the time. It's just sometimes a bit annoying because you 
> always have to call functions to get the ArrayCollection that is used
> at the moment when you want to edit it. But I will keep on going that 
> way, since you reckon that it's appropriate as well. 
> 
> Cheers, Max
> 
> - Original Message 
> From: rueter007 <[EMAIL PROTECTED]>
> To: flexcoders@yahoogroups.com
> Sent: Monday, December 24, 2007 6:48:25 AM
> Subject: [flexcoders] Re: Application Structure
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>   
> 
> 
> 
> One grid should work. you anyway have multiple sets of
data. dont need
> 
> to repeat the grid if the display structure of the data is the same.
> 
> 
> 
> - venkat
> 
> http://www.venkatj. com
> 
> 
> 
> --- In [EMAIL PROTECTED] ups.com, "m.frigge"  wrote:
> 
> >
> 
> > What would you recommend when you need several sets of data for a
> 
> > dataGrid, like inbox trash junk in an email application. Would you
> 
> > rather use one dataGrid and then change the dataProvider or would you
> 
> > create a viewStack that contains a dataGrid for each set of data?
> 
> > 
> 
> > Max
> 
> >
> 
> 
> 
> 
> 
> 
>   
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  

> Never miss a thing.  Make Yahoo your home page. 
> http://www.yahoo.com/r/hs
>




[flexcoders] Re: Sorting nested collections in Value Objects? (DataServices or RemoteObject f

2007-12-26 Thread simonjpalmer
Not sure I have understood all the subtleties of being managed
objects, but as a personal preference, I would avoid the server all
together - but that's just me.  If you really have to use the server
then I would make the sorting a property of the persistence tier (i.e.
the database select queries) rather than mushed in with any business
logic.

If you really need them to be held in a sorted order in memory, don't
want to use the server and you have nested collections, implying a
parent-child hierarchy, then your best bet is probably to make the
sort order a property of the child collections.

I have this exact problem myself (6-level deep parent-child hierarchy)
and rather than insist that they are stored or carried around in a
sorted order I just made sure that they were sorted wherever the user
needed to see them sorted.  This shifts the problem from one of
persistence and/or data architecture to one of display and the
solution for me was more obvious.  However I have resisted the
temptation to show the data in a tree - there's always a better way. 
In my world the users don't care about the domain model so I don't
show it to them.

For procedural (aggregation style) operations I make sure I don't rely
on the order in which the data is held.  I have found maps on the
client via the mysterious Object object are very useful in these
circumstances.

Best of luck. Simon

--- In flexcoders@yahoogroups.com, Kevin <[EMAIL PROTECTED]> wrote:
>
> I am wondering what the best practice is for sorting nesting  
> collections in data managed or remote objects?
> 
> Sort on the server?  It is not hard for us to create SortedSet's (via  
> Java) on the server objects and then send those back.  The only  
> problem we have run into with this is that it seems that the sort  
> order is not updated when new objects are persisted via Flex.  For  
> example, the initial fill comes in sorted, however when we then use  
> addItem to a data managed, nested collection, the object is persisted  
> in the database, but the full set is not returned to flex and thus  
> the new sort order is not updated.  It seems that because of this  
> there is no reason to do any sorting on the server except for objects  
> that are not data managed.  Does this make sense?
> 
> Sort on the client?  It is easy enough to add sorts to  
> ListCollections. however when the ListCollections are nested inside  
> other objects where is the best place to add these sorts?  In the  
> constructor of the value object?  In the view which binds it? In some  
> collection listener?  With the simplicity of data binding it seems  
> that there is no great place to add a default sort to a collection.   
> Am I missing something obvious?
> 
> Sort in the destination config?  Is there a way to add a default sort  
> to a data-management-config destination?  It seems like this might be  
> an appropriate place to add a default sort declaration...
> 
> I would love to hear how others have addressed this situation?
> 
> Happy Holidays, Kevin
>




[flexcoders] Re: Sorting nested collections in Value Objects? (DataServices or RemoteObject f

2007-12-26 Thread simonjpalmer
As ever there's a thousand different ways of doing anything and no
real right or wrong, so there's nothing intrinsically wrong with your
approach.  If you dislike having singleton wrapper classes for your
sorts, then you could just have a map/collection of singleton sort
objects on your application and refer to them where you need them. 
Put them in a singleton map and refer to them by constants to keep
reasonably tidy.

If you feel the idea of singletons is not clean (and I sympathise with
that feeling) then another approach would be to create a
ListCollectionView in your control code, set its source to be your
managed collection, then applying a display specific sort to the
ListCollectionView.

In the control displaying your collections...

private var myViewSpecificNameSort = new Sort();
myViewSpecificNameSort.fields = [new SortField("firstName"),new
SortField("lastName")];

lcv_People.refresh();





...and the same for the other collections.

This feels cleaner to me and suits my particular predelictions for
separating the display, persistence and the model.

I still haven't seen a compelling reason why you would insist your
data is persisted/handled in sorted order.  It appears that your users
want to see the objects sorted, so sort them when you show them.

Another way of rationalising this is to ask what exactly is your
requirement?  Is it for sorted data or data sorted in the display? 
The former implies a lot about persistence the latter just means you
have to sort the data before displaying it.

--- In flexcoders@yahoogroups.com, Kevin <[EMAIL PROTECTED]> wrote:
>
> Thank you for your thoughts about this.  Through trial and error and  
> a little bit of frustration I am coming to the conclusion that  
> sorting the data in the specific view is perhaps the only way to do  
> it with "Managed" data.  Sorting on the server seems like a waste  
> unless the data never needs to be manipulated on the client.  So with  
> that in mind, here is the specific problem that I have encountered  
> and I am wondering if there is a more elegant solution for.
> 
> Let's say I have an object MyParty which holds the following  
> collections:
> 
> MyParty
> - people (collection of people at the party)
> - events (things that are happening)
> - supplies (..you get the idea)
> 
> I would like to bind these nested collections to components
> 
> 
> 
> 
> 
> So where to apply the sort? Temporarily we have created static  
> utility classes that hold the sort for each collection and return the  
> collection so that the sort can be applied via this method
> 
> 
> 
> The people sort class is structured like this
> 
> public class PeopleSort
> {
>   public static function byName(collection: ArrayCollection) :  
> ArrayCollection {
>   collection.sort = new Sort();
>   collection.sort.fields = [new 
> SortField("firstName"),new SortField 
> ("lastName")]
>   collection.refresh();
>   return collection;
> }
> 
> Somehow this does not seem like the most elegant method, but we can't  
> seem to figure out a better way to do it.
> 
> - Kevin
> 
> 
> 
> 
> On Dec 26, 2007, at 5:12 AM, simonjpalmer wrote:
> 
> >  This shifts the problem from one of
> > persistence and/or data architecture to one of display and the
> > solution for me was more obvious.
>




[flexcoders] Re: Sorting nested collections in Value Objects? (DataServices or RemoteObject f

2007-12-26 Thread simonjpalmer
Glad I could help, that's what is great about this group!

--- In flexcoders@yahoogroups.com, Kevin <[EMAIL PROTECTED]> wrote:
>
> 
> >  > sort={myViewSpecificNameSort}/>
> >
> > 
> 
> Ah!!!  mxml, of course!  It's so funny how I had been thinking in  
> terms of doing everything in actionscript, that I missed this most  
> obvious solution.  Not to say this couldn't be done in actionscript,  
> but it does seem much cleaner to do it in mxml and take advantage of  
> the automatic binding and events.  Thanks for this example, it seems  
> to reflect my intentions better which is to create a 'view' into my  
> data, sort that data for the user and then bind that 'view' to some  
> display object.  The two lines above say that much more clearly to me.
> 
> > I still haven't seen a compelling reason why you would insist your
> > data is persisted/handled in sorted order. It appears that your users
> > want to see the objects sorted, so sort them when you show them.
> 
> Absolutely.  I agree.  The data only needs to be sorted for the  
> user's convenience therefor it makes sense to associate this sorting  
> only to the specific view.
> 
> Thanks for talking this out with me.  Having someone else's insight  
> always helps to clarify my own.
> 
> All the best,
> 
> Kevin
>




[flexcoders] Bubbling and event from a popup

2007-12-26 Thread simonjpalmer
I have a custom control in my app which pops up a dialog in which the
user can alter some data in the underlying domain model.  

I have a custom event SetDirtyEvent(o:Object) which gets dispatched
and a listener in the main app which then keeps a singleton list of
objects which have been changed so I have a minimal server
synchronisation transaction.

When I call dispatchEvent(new SetDirtyEvent(myDirtyObject)) from
anywhere else across my application (and I do that a lot) the listener
in the Application fires and it works as expected.

When I call this from any popup window the app event handler never
fires.  I have bubbles set to true.

What am I doing wrong?

Do I have to explicitly set some sort of parentage of the popup window
in order for the custom event to bubble up to the app?

Thanks
Simon



[flexcoders] Re: Sugestion for ComboBox component

2007-12-29 Thread simonjpalmer
have you tried using myCombo.selectedItem = aTextValue?

I don't know if that works, I'm just suggesting it is worth a try.

Painful experience of a change of the textual value from one string to
another has led me to encapsulating domain values like these into a
separate list and only storing their ordinals rather than their values.  

If you do that it has the added advantage that you can just use the
ordinal value in the combo rather than having to loop.

There was a similar thread recently...
http://tech.groups.yahoo.com/group/flexcoders/message/96528

--- In flexcoders@yahoogroups.com, "danielvlopes" <[EMAIL PROTECTED]>
wrote:
>
> Hello everybody, i want make a sugestion for Adobe Flex Team, and i
> know some members of Flex team participate here, in my projects when i
> use combobox to recover data from database and selected item of this
> combo must be set to the data recorded in database i do loops in
> entire dataprovider to find the value and your index to use
> selectedIndex to receive this index.
> 
> This is very common when you use combo to add and edit data in
> database and i think everybody need this, why adobe don't incorpore
> some new method in next release for do this? Something like
> setSelectedLabe(label:String) ...
>




[flexcoders] Re: Setting default "cursor" position when the flex web-application loads

2007-12-30 Thread simonjpalmer
if your login box is html you are posting on the wrong forum

if it is flex...
http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=0676.html

--- In flexcoders@yahoogroups.com, "flex.fusion" <[EMAIL PROTECTED]> wrote:
>
> Hi Guys,
> 
> My previous posts never got replied, but we shall not leave the 
> hope :) :) so here is one more :)
> 
> Problem statement: 
> When my web application is loaded, login box popsup by default. 
> Setting focus to the "username" field does not set the "cursor" to 
> the field. Please guide me how can we resolve such issues. 
> 
> I was not able to unserstand the "index.template.html" properly, if 
> there is any reference: about 'working with "index.template.html" ', 
> I would love to go through that :) Handling and Using "id" 
> and "name" properties and playing with  and  are 
> mainly the things, I am looking for. 
> 
> btw: I had gone through some of the previous posts but still am not 
> able to resolve the issue. So please share your experience to 
> resolve such things.
> 
> Thanks & Regards,
> Savan
>




  1   2   3   >