Re: WOUnit testing with partial entities

2014-02-19 Thread Paul Hoadley
On 03/02/2014, at 2:30 PM, Paul Hoadley pa...@logicsquad.net wrote: [1]https://dl.dropboxusercontent.com/u/9599580/wounit-1.3-SNAPSHOT-3.jar I'm having some ongoing minor issues testing partial entities with WOUnit. Before I jump in and describe the problem in depth, is that snapshot above

Re: WOUnit testing with partial entities

2014-02-19 Thread Henrique Prange
Hi Paul, I have to push some changes to GitHub (including the partials solution). I’m trying to find some time this week. I’ll let you know as soon as the changes are in the WOUnit repository. Cheers, Henrique On 19/02/2014, at 05:40, Paul Hoadley pa...@logicsquad.net wrote: On 03/02/2014,

Re: WOUnit testing with partial entities

2014-02-19 Thread Paul Hoadley
On 20/02/2014, at 3:56 AM, Henrique Prange hpra...@gmail.com wrote: I have to push some changes to GitHub (including the partials solution). I’m trying to find some time this week. I’ll let you know as soon as the changes are in the WOUnit repository. Thanks Henrique. -- Paul Hoadley

Calling AjaxModalDialog programmatically

2014-02-19 Thread Roger Perryman
Hi. What is the correct way to open an AjaxModalDialog programmatically after evaluating some criteria? I know that I can call it via Javascript using openAMD_ID(). But that isn't exactly what I'm looking for. Since I need to evaluate what they have done first, I guess I would need to update

Re: Calling AjaxModalDialog programmatically

2014-02-19 Thread Chuck Hill
One of these from Java: /** * Call this method to have a JavaScript response returned that opens the modal dialog. * The title of the dialog will be what it was when rendered. * * @param context the current WOContext * @param id the HTML ID of the AjaxModalDialog to open */ public static

Opinions on static create…() methods for EOs

2014-02-19 Thread Paul Hoadley
Hello, Say I have an entity Foo. Often I will override the static createFoo() method declared in _Foo.java, perhaps several times with different signatures for different uses. Say Foo has a to-one relationship to Bar, and I supply bar as an argument. I'm a bit inconsistent as to whether I

Re: Opinions on static createŠ() methods for EOs

2014-02-19 Thread Chuck Hill
Hi Paul, It is always safe to call localInstance. My personal preference is to force the caller to do that so that they are aware if they have cross EC references. I can also see the argument for “just do what is safest”. Chuck On 2/19/2014, 8:36 PM, Paul Hoadley wrote: Hello, Say I have

Re: Opinions on static createŠ() methods for EOs

2014-02-19 Thread Paul Hoadley
Hi Chuck, On 20/02/2014, at 3:10 PM, Chuck Hill ch...@global-village.net wrote: It is always safe to call localInstance. My personal preference is to force the caller to do that so that they are aware if they have cross EC references. Ah OK. I can also see the argument for “just do what

Re: Opinions on static createŠ() methods for EOs

2014-02-19 Thread Chuck Hill
On 2/19/2014, 8:36 PM, Paul Hoadley wrote: Hello, Say I have an entity Foo. Often I will override the static createFoo() method declared in _Foo.java, perhaps several times with different signatures for different uses. Say Foo has a to-one relationship to Bar, and I supply bar as an

Re: Opinions on static createŠ() methods for EOs

2014-02-19 Thread Dev WO
Someone will correct me if I'm wrong, but I think localInstanceIn is working only on an existing object in the datastore. That means that if you create bar into ec2 and you try to do setBarRelationship(bar.localInstanceIn(ec1)) you will get a NullPointerException which could be difficult to

Re: Opinions on static createŠ() methods for EOs

2014-02-19 Thread Paul Hoadley
On 20/02/2014, at 4:55 PM, Dev WO webobje...@anazys.com wrote: Someone will correct me if I'm wrong, but I think localInstanceIn is working only on an existing object in the datastore. That means that if you create bar into ec2 and you try to do setBarRelationship(bar.localInstanceIn(ec1))