Re: changed objects

2011-03-29 Thread Theodore Petrosky
I find that i have a boolean that is bound to the 'checked' of my WOCheckBox:

wo:WOCheckBox checked = $theGridItem.globalUpdate /

Originally I thought it was because I had an AjaxObserveField to watch the 
checkbox, so I deleted it. No Joy. so as long as the WOCheckBox is there, I 
have this issue. theEC.updatedObjects() believes that all the entities have 
been updated.

The globalUpdate attribute is a boolean (intBoolean) in my postgresql backend.

Am I screwing this up?

Ted

--- On Mon, 3/28/11, David Avendasora webobje...@avendasora.com wrote:

 From: David Avendasora webobje...@avendasora.com
 Subject: Re: changed objects
 To: Chuck Hill ch...@global-village.net
 Cc: Theodore Petrosky tedp...@yahoo.com, webobjects-dev@lists.apple.com
 Date: Monday, March 28, 2011, 4:31 PM
 Or, I believe, an MS SQL Server DB
 with Date columns as locking attributes...
 
 Dave
 
 On Mar 28, 2011, at 2:26 PM, Chuck Hill wrote:
 
  If all the objects are in that list, then all have
 been changed.  You might have a floating point value
 that is getting altered due to a formatter (e.g. the scale
 is different).
  
  Chuck
  
  
  On Mar 28, 2011, at 11:16 AM, Theodore Petrosky
 wrote:
  
  OK I thought I did this before but I can not think
 of how I did it.
  
  I have an EC made with:  theEC =
 ERXEC.newEditingContext();
  
  I then get a list and use a displayGroup to
 display it in a table. I want to make a few edits, then ask
 the EC for the changed objects.
  
  NSLog.out.appendln(checkAltered
 ==    + theEC.updatedObjects());
  
  updatedOjbects returns all the objects in the
 array. I just want the ones that were altered. Is there a
 way?
  
  Ted
  
  -- 
  Chuck Hill         
    Senior Consultant / VP Development
  
  Practical WebObjects - for developers who want to
 increase their overall knowledge of WebObjects or who are
 trying to solve specific problems.    
  http://www.global-village.net/products/practical_webobjects
  
  
  
  
  
  
  
  ___
  Do not post admin requests to the list. They will be
 ignored.
  Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
  Help/Unsubscribe/Update your Subscription:
  http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com
  
  This email sent to webobje...@avendasora.com
 

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: changed objects

2011-03-29 Thread Chuck Hill

On Mar 29, 2011, at 5:49 AM, Theodore Petrosky wrote:

 I find that i have a boolean that is bound to the 'checked' of my WOCheckBox:
 
 wo:WOCheckBox checked = $theGridItem.globalUpdate /
 
 Originally I thought it was because I had an AjaxObserveField to watch the 
 checkbox, so I deleted it. No Joy. so as long as the WOCheckBox is there, I 
 have this issue. theEC.updatedObjects() believes that all the entities have 
 been updated.
 
 The globalUpdate attribute is a boolean (intBoolean) in my postgresql backend.
 
 Am I screwing this up?

Probably.  :-)  You could override the setter and log out the original and new 
value and see if that shows anything.  An object being in the updated list just 
indicates that it _may_ have changed. So either the value is getting changed, 
or WOCheckBox is needlessly setting the Boolean to the exact same value.


Chuck


 --- On Mon, 3/28/11, David Avendasora webobje...@avendasora.com wrote:
 
 From: David Avendasora webobje...@avendasora.com
 Subject: Re: changed objects
 To: Chuck Hill ch...@global-village.net
 Cc: Theodore Petrosky tedp...@yahoo.com, webobjects-dev@lists.apple.com
 Date: Monday, March 28, 2011, 4:31 PM
 Or, I believe, an MS SQL Server DB
 with Date columns as locking attributes...
 
 Dave
 
 On Mar 28, 2011, at 2:26 PM, Chuck Hill wrote:
 
 If all the objects are in that list, then all have
 been changed.  You might have a floating point value
 that is getting altered due to a formatter (e.g. the scale
 is different).
 
 Chuck
 
 
 On Mar 28, 2011, at 11:16 AM, Theodore Petrosky
 wrote:
 
 OK I thought I did this before but I can not think
 of how I did it.
 
 I have an EC made with:  theEC =
 ERXEC.newEditingContext();
 
 I then get a list and use a displayGroup to
 display it in a table. I want to make a few edits, then ask
 the EC for the changed objects.
 
 NSLog.out.appendln(checkAltered
 ==+ theEC.updatedObjects());
 
 updatedOjbects returns all the objects in the
 array. I just want the ones that were altered. Is there a
 way?
 
 Ted
 
 -- 
 Chuck Hill 
Senior Consultant / VP Development
 
 Practical WebObjects - for developers who want to
 increase their overall knowledge of WebObjects or who are
 trying to solve specific problems.
 http://www.global-village.net/products/practical_webobjects
 
 
 
 
 
 
 
 ___
 Do not post admin requests to the list. They will be
 ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com
 
 This email sent to webobje...@avendasora.com
 
 

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects









smime.p7s
Description: S/MIME cryptographic signature
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: changed objects

2011-03-29 Thread Theodore Petrosky
okay, let me tell you what I want to accomplish.

I have a table of 100 rows. I want the user to select an arbitrary group of 
rows and change the background color.

So I thought I would add a boolean setter and getter to the entity:

public void setIsSelectedForEdit(boolean _isSelectedForEdit) {
NSLog.out.appendln(setIsSelectedForEdit in the object =  + 
_isSelectedForEdit);
this._isSelectedForEdit = _isSelectedForEdit;
}

public boolean isSelectedForEdit() {
return _isSelectedForEdit;
}

then if the users checks the checkbox in an arbitrary group I could know which 
are selected and update the CSS. (I also have an AjaxObserveField watching the 
checkBox and the whole thing is wrapped in an updateContainer)

it works, sort of. the attribute _isSelectedForEdit is getting set but the 
Entity doesn't know it was changed. I don't care about saving this boolean 
value, I just need to know which rows to color (I will save THIS value).

That's when I decided to try a 'Real' attribute. 

td
wo:WOCheckBox checked = $theGridItem.globalUpdate id = 
$session.rowID/webobject name = SelectedForEditObserveField/
/td

globalUpdate is a real boolean attribute of my Grid object.

if I bind this attribute to the checkBox, all the objects are marked as updated.

so on a lark (or maybe it was a bluejay) I switched back to my original setter 
with a nod to the real attribute:

public void setIsSelectedForEdit(boolean _isSelectedForEdit) {
NSLog.out.appendln(setIsSelectedForEdit in the object =  + 
_isSelectedForEdit);
this._isSelectedForEdit = _isSelectedForEdit;

/* let the value be false
* as I don't really care about this value
*/

this.takeValueForKey(false, _Grid.GLOBAL_UPDATE);
}

This works as I want. the row get marked to update, the real value never 
changes (I can throw it away) and 

NSLog.out.appendln(checkAlteredAction ==+ theEC.updatedObjects()); 

only lists the rows that are selected (checked) as altered.

I don't want to say that there must be a better way. But if it works and 
doesn't blow up then it is good, right?

There is just too much to learn for one lifetime.

Ted





--- On Tue, 3/29/11, Chuck Hill ch...@global-village.net wrote:

 From: Chuck Hill ch...@global-village.net
 Subject: Re: changed objects
 To: Theodore Petrosky tedp...@yahoo.com
 Cc: David Avendasora webobje...@avendasora.com, 
 webobjects-dev@lists.apple.com
 Date: Tuesday, March 29, 2011, 11:23 AM
 
 On Mar 29, 2011, at 5:49 AM, Theodore Petrosky wrote:
 
  I find that i have a boolean that is bound to the
 'checked' of my WOCheckBox:
  
  wo:WOCheckBox checked = $theGridItem.globalUpdate /
  
  Originally I thought it was because I had an
 AjaxObserveField to watch the checkbox, so I deleted it. No
 Joy. so as long as the WOCheckBox is there, I have this
 issue. theEC.updatedObjects() believes that all the entities
 have been updated.
  
  The globalUpdate attribute is a boolean (intBoolean)
 in my postgresql backend.
  
  Am I screwing this up?
 
 Probably.  :-)  You could override the setter and
 log out the original and new value and see if that shows
 anything.  An object being in the updated list just
 indicates that it _may_ have changed. So either the value is
 getting changed, or WOCheckBox is needlessly setting the
 Boolean to the exact same value.
 
 
 Chuck
 
 
  --- On Mon, 3/28/11, David Avendasora webobje...@avendasora.com
 wrote:
  
  From: David Avendasora webobje...@avendasora.com
  Subject: Re: changed objects
  To: Chuck Hill ch...@global-village.net
  Cc: Theodore Petrosky tedp...@yahoo.com,
 webobjects-dev@lists.apple.com
  Date: Monday, March 28, 2011, 4:31 PM
  Or, I believe, an MS SQL Server DB
  with Date columns as locking attributes...
  
  Dave
  
  On Mar 28, 2011, at 2:26 PM, Chuck Hill wrote:
  
  If all the objects are in that list, then all
 have
  been changed.  You might have a floating
 point value
  that is getting altered due to a formatter (e.g.
 the scale
  is different).
  
  Chuck
  
  
  On Mar 28, 2011, at 11:16 AM, Theodore
 Petrosky
  wrote:
  
  OK I thought I did this before but I can
 not think
  of how I did it.
  
  I have an EC made with:  theEC =
  ERXEC.newEditingContext();
  
  I then get a list and use a displayGroup
 to
  display it in a table. I want to make a few edits,
 then ask
  the EC for the changed objects.
  
  NSLog.out.appendln(checkAltered
  ==    + theEC.updatedObjects());
  
  updatedOjbects returns all the objects in
 the
  array. I just want the ones that were altered. Is
 there a
  way?
  
  Ted
  
  -- 
  Chuck Hill     
    
     Senior Consultant / VP Development
  
  Practical WebObjects - for developers who want
 to
  increase their overall knowledge of WebObjects or
 who are
  trying to solve specific problems.    
  http://www.global-village.net/products/practical_webobjects
  
  
  
  
  
  
  
 
 ___
  Do not post admin requests

Re: changed objects

2011-03-29 Thread Chuck Hill

On Mar 29, 2011, at 9:09 AM, Theodore Petrosky wrote:

 okay, let me tell you what I want to accomplish.
 
 I have a table of 100 rows. I want the user to select an arbitrary group of 
 rows and change the background color.
 
 So I thought I would add a boolean setter and getter to the entity:

The entity?  This is a UI function, this belongs in the UI code.


 public void setIsSelectedForEdit(boolean _isSelectedForEdit) {
   NSLog.out.appendln(setIsSelectedForEdit in the object =  + 
 _isSelectedForEdit);
   this._isSelectedForEdit = _isSelectedForEdit;
 }
 
 public boolean isSelectedForEdit() {
   return _isSelectedForEdit;
 }
 
 then if the users checks the checkbox in an arbitrary group I could know 
 which are selected and update the CSS. (I also have an AjaxObserveField 
 watching the checkBox and the whole thing is wrapped in an updateContainer)
 
 it works, sort of. the attribute _isSelectedForEdit is getting set but the 
 Entity doesn't know it was changed. I don't care about saving this boolean 
 value, I just need to know which rows to color (I will save THIS value).

What is the difference?


 That's when I decided to try a 'Real' attribute. 
 
 td
 wo:WOCheckBox checked = $theGridItem.globalUpdate id = 
 $session.rowID/webobject name = SelectedForEditObserveField/
 /td
 
 globalUpdate is a real boolean attribute of my Grid object.

On the Grid?  Why?  This is to select rows, it should be on a row not the whole 
grid.


 if I bind this attribute to the checkBox, all the objects are marked as 
 updated.
 
 so on a lark (or maybe it was a bluejay) I switched back to my original 
 setter with a nod to the real attribute:
 
 public void setIsSelectedForEdit(boolean _isSelectedForEdit) {
   NSLog.out.appendln(setIsSelectedForEdit in the object =  + 
 _isSelectedForEdit);
   this._isSelectedForEdit = _isSelectedForEdit;
 
   /* let the value be false
   * as I don't really care about this value
   */
 
   this.takeValueForKey(false, _Grid.GLOBAL_UPDATE);
 }
 
 This works as I want. the row get marked to update, the real value never 
 changes (I can throw it away) and 
 
 NSLog.out.appendln(checkAlteredAction ==+ theEC.updatedObjects()); 
 
 only lists the rows that are selected (checked) as altered.
 
 I don't want to say that there must be a better way. But if it works and 
 doesn't blow up then it is good, right?

Well, it is better than not working at all I suppose.  :-)


Chuck


 
 There is just too much to learn for one lifetime.
 
 Ted
 
 
 
 
 
 --- On Tue, 3/29/11, Chuck Hill ch...@global-village.net wrote:
 
 From: Chuck Hill ch...@global-village.net
 Subject: Re: changed objects
 To: Theodore Petrosky tedp...@yahoo.com
 Cc: David Avendasora webobje...@avendasora.com, 
 webobjects-dev@lists.apple.com
 Date: Tuesday, March 29, 2011, 11:23 AM
 
 On Mar 29, 2011, at 5:49 AM, Theodore Petrosky wrote:
 
 I find that i have a boolean that is bound to the
 'checked' of my WOCheckBox:
 
 wo:WOCheckBox checked = $theGridItem.globalUpdate /
 
 Originally I thought it was because I had an
 AjaxObserveField to watch the checkbox, so I deleted it. No
 Joy. so as long as the WOCheckBox is there, I have this
 issue. theEC.updatedObjects() believes that all the entities
 have been updated.
 
 The globalUpdate attribute is a boolean (intBoolean)
 in my postgresql backend.
 
 Am I screwing this up?
 
 Probably.  :-)  You could override the setter and
 log out the original and new value and see if that shows
 anything.  An object being in the updated list just
 indicates that it _may_ have changed. So either the value is
 getting changed, or WOCheckBox is needlessly setting the
 Boolean to the exact same value.
 
 
 Chuck
 
 
 --- On Mon, 3/28/11, David Avendasora webobje...@avendasora.com
 wrote:
 
 From: David Avendasora webobje...@avendasora.com
 Subject: Re: changed objects
 To: Chuck Hill ch...@global-village.net
 Cc: Theodore Petrosky tedp...@yahoo.com,
 webobjects-dev@lists.apple.com
 Date: Monday, March 28, 2011, 4:31 PM
 Or, I believe, an MS SQL Server DB
 with Date columns as locking attributes...
 
 Dave
 
 On Mar 28, 2011, at 2:26 PM, Chuck Hill wrote:
 
 If all the objects are in that list, then all
 have
 been changed.  You might have a floating
 point value
 that is getting altered due to a formatter (e.g.
 the scale
 is different).
 
 Chuck
 
 
 On Mar 28, 2011, at 11:16 AM, Theodore
 Petrosky
 wrote:
 
 OK I thought I did this before but I can
 not think
 of how I did it.
 
 I have an EC made with:  theEC =
 ERXEC.newEditingContext();
 
 I then get a list and use a displayGroup
 to
 display it in a table. I want to make a few edits,
 then ask
 the EC for the changed objects.
 
 NSLog.out.appendln(checkAltered
 ==+ theEC.updatedObjects());
 
 updatedOjbects returns all the objects in
 the
 array. I just want the ones that were altered. Is
 there a
 way?
 
 Ted
 
 -- 
 Chuck Hill 

 Senior Consultant / VP Development
 
 Practical

Re: changed objects

2011-03-29 Thread Mark Wardle
Urrghh

Why not keep an array of selected rows in your UI component and then
use that to decide re: CSS

Mark

-- 
Dr. Mark Wardle
Specialist registrar, Neurology
(Sent from my mobile)


On 29 Mar 2011, at 17:09, Theodore Petrosky tedp...@yahoo.com wrote:

 okay, let me tell you what I want to accomplish.

 I have a table of 100 rows. I want the user to select an arbitrary group of 
 rows and change the background color.

 So I thought I would add a boolean setter and getter to the entity:

 public void setIsSelectedForEdit(boolean _isSelectedForEdit) {
NSLog.out.appendln(setIsSelectedForEdit in the object =  + 
 _isSelectedForEdit);
this._isSelectedForEdit = _isSelectedForEdit;
 }

 public boolean isSelectedForEdit() {
return _isSelectedForEdit;
 }

 then if the users checks the checkbox in an arbitrary group I could know 
 which are selected and update the CSS. (I also have an AjaxObserveField 
 watching the checkBox and the whole thing is wrapped in an updateContainer)

 it works, sort of. the attribute _isSelectedForEdit is getting set but the 
 Entity doesn't know it was changed. I don't care about saving this boolean 
 value, I just need to know which rows to color (I will save THIS value).

 That's when I decided to try a 'Real' attribute.

 td
 wo:WOCheckBox checked = $theGridItem.globalUpdate id = 
 $session.rowID/webobject name = SelectedForEditObserveField/
 /td

 globalUpdate is a real boolean attribute of my Grid object.

 if I bind this attribute to the checkBox, all the objects are marked as 
 updated.

 so on a lark (or maybe it was a bluejay) I switched back to my original 
 setter with a nod to the real attribute:

 public void setIsSelectedForEdit(boolean _isSelectedForEdit) {
NSLog.out.appendln(setIsSelectedForEdit in the object =  + 
 _isSelectedForEdit);
this._isSelectedForEdit = _isSelectedForEdit;

/* let the value be false
* as I don't really care about this value
*/

this.takeValueForKey(false, _Grid.GLOBAL_UPDATE);
 }

 This works as I want. the row get marked to update, the real value never 
 changes (I can throw it away) and

 NSLog.out.appendln(checkAlteredAction ==+ theEC.updatedObjects());

 only lists the rows that are selected (checked) as altered.

 I don't want to say that there must be a better way. But if it works and 
 doesn't blow up then it is good, right?

 There is just too much to learn for one lifetime.

 Ted





 --- On Tue, 3/29/11, Chuck Hill ch...@global-village.net wrote:

 From: Chuck Hill ch...@global-village.net
 Subject: Re: changed objects
 To: Theodore Petrosky tedp...@yahoo.com
 Cc: David Avendasora webobje...@avendasora.com, 
 webobjects-dev@lists.apple.com
 Date: Tuesday, March 29, 2011, 11:23 AM

 On Mar 29, 2011, at 5:49 AM, Theodore Petrosky wrote:

 I find that i have a boolean that is bound to the
 'checked' of my WOCheckBox:

 wo:WOCheckBox checked = $theGridItem.globalUpdate /

 Originally I thought it was because I had an
 AjaxObserveField to watch the checkbox, so I deleted it. No
 Joy. so as long as the WOCheckBox is there, I have this
 issue. theEC.updatedObjects() believes that all the entities
 have been updated.

 The globalUpdate attribute is a boolean (intBoolean)
 in my postgresql backend.

 Am I screwing this up?

 Probably.  :-)  You could override the setter and
 log out the original and new value and see if that shows
 anything.  An object being in the updated list just
 indicates that it _may_ have changed. So either the value is
 getting changed, or WOCheckBox is needlessly setting the
 Boolean to the exact same value.


 Chuck


 --- On Mon, 3/28/11, David Avendasora webobje...@avendasora.com
 wrote:

 From: David Avendasora webobje...@avendasora.com
 Subject: Re: changed objects
 To: Chuck Hill ch...@global-village.net
 Cc: Theodore Petrosky tedp...@yahoo.com,
 webobjects-dev@lists.apple.com
 Date: Monday, March 28, 2011, 4:31 PM
 Or, I believe, an MS SQL Server DB
 with Date columns as locking attributes...

 Dave

 On Mar 28, 2011, at 2:26 PM, Chuck Hill wrote:

 If all the objects are in that list, then all
 have
 been changed.  You might have a floating
 point value
 that is getting altered due to a formatter (e.g.
 the scale
 is different).

 Chuck


 On Mar 28, 2011, at 11:16 AM, Theodore
 Petrosky
 wrote:

 OK I thought I did this before but I can
 not think
 of how I did it.

 I have an EC made with:  theEC =
 ERXEC.newEditingContext();

 I then get a list and use a displayGroup
 to
 display it in a table. I want to make a few edits,
 then ask
 the EC for the changed objects.

 NSLog.out.appendln(checkAltered
 ==+ theEC.updatedObjects());

 updatedOjbects returns all the objects in
 the
 array. I just want the ones that were altered. Is
 there a
 way?

 Ted

 --
 Chuck Hill

 Senior Consultant / VP Development

 Practical WebObjects - for developers who want
 to
 increase their overall knowledge of WebObjects or
 who are
 trying to solve specific problems.
 http

Re: changed objects

2011-03-29 Thread Chuck Hill
And if it does not need to  be persistent, then AjaxGrid already does all of 
this and more!  And making it persistent is probably not hard if you really 
need that.


On Mar 29, 2011, at 2:09 PM, Mark Wardle wrote:

 Urrghh
 
 Why not keep an array of selected rows in your UI component and then
 use that to decide re: CSS
 
 Mark
 
 -- 
 Dr. Mark Wardle
 Specialist registrar, Neurology
 (Sent from my mobile)
 
 
 On 29 Mar 2011, at 17:09, Theodore Petrosky tedp...@yahoo.com wrote:
 
 okay, let me tell you what I want to accomplish.
 
 I have a table of 100 rows. I want the user to select an arbitrary group of 
 rows and change the background color.
 
 So I thought I would add a boolean setter and getter to the entity:
 
 public void setIsSelectedForEdit(boolean _isSelectedForEdit) {
   NSLog.out.appendln(setIsSelectedForEdit in the object =  + 
 _isSelectedForEdit);
   this._isSelectedForEdit = _isSelectedForEdit;
 }
 
 public boolean isSelectedForEdit() {
   return _isSelectedForEdit;
 }
 
 then if the users checks the checkbox in an arbitrary group I could know 
 which are selected and update the CSS. (I also have an AjaxObserveField 
 watching the checkBox and the whole thing is wrapped in an updateContainer)
 
 it works, sort of. the attribute _isSelectedForEdit is getting set but the 
 Entity doesn't know it was changed. I don't care about saving this boolean 
 value, I just need to know which rows to color (I will save THIS value).
 
 That's when I decided to try a 'Real' attribute.
 
 td
 wo:WOCheckBox checked = $theGridItem.globalUpdate id = 
 $session.rowID/webobject name = SelectedForEditObserveField/
 /td
 
 globalUpdate is a real boolean attribute of my Grid object.
 
 if I bind this attribute to the checkBox, all the objects are marked as 
 updated.
 
 so on a lark (or maybe it was a bluejay) I switched back to my original 
 setter with a nod to the real attribute:
 
 public void setIsSelectedForEdit(boolean _isSelectedForEdit) {
   NSLog.out.appendln(setIsSelectedForEdit in the object =  + 
 _isSelectedForEdit);
   this._isSelectedForEdit = _isSelectedForEdit;
 
   /* let the value be false
   * as I don't really care about this value
   */
 
   this.takeValueForKey(false, _Grid.GLOBAL_UPDATE);
 }
 
 This works as I want. the row get marked to update, the real value never 
 changes (I can throw it away) and
 
 NSLog.out.appendln(checkAlteredAction ==+ theEC.updatedObjects());
 
 only lists the rows that are selected (checked) as altered.
 
 I don't want to say that there must be a better way. But if it works and 
 doesn't blow up then it is good, right?
 
 There is just too much to learn for one lifetime.
 
 Ted
 
 
 
 
 
 --- On Tue, 3/29/11, Chuck Hill ch...@global-village.net wrote:
 
 From: Chuck Hill ch...@global-village.net
 Subject: Re: changed objects
 To: Theodore Petrosky tedp...@yahoo.com
 Cc: David Avendasora webobje...@avendasora.com, 
 webobjects-dev@lists.apple.com
 Date: Tuesday, March 29, 2011, 11:23 AM
 
 On Mar 29, 2011, at 5:49 AM, Theodore Petrosky wrote:
 
 I find that i have a boolean that is bound to the
 'checked' of my WOCheckBox:
 
 wo:WOCheckBox checked = $theGridItem.globalUpdate /
 
 Originally I thought it was because I had an
 AjaxObserveField to watch the checkbox, so I deleted it. No
 Joy. so as long as the WOCheckBox is there, I have this
 issue. theEC.updatedObjects() believes that all the entities
 have been updated.
 
 The globalUpdate attribute is a boolean (intBoolean)
 in my postgresql backend.
 
 Am I screwing this up?
 
 Probably.  :-)  You could override the setter and
 log out the original and new value and see if that shows
 anything.  An object being in the updated list just
 indicates that it _may_ have changed. So either the value is
 getting changed, or WOCheckBox is needlessly setting the
 Boolean to the exact same value.
 
 
 Chuck
 
 
 --- On Mon, 3/28/11, David Avendasora webobje...@avendasora.com
 wrote:
 
 From: David Avendasora webobje...@avendasora.com
 Subject: Re: changed objects
 To: Chuck Hill ch...@global-village.net
 Cc: Theodore Petrosky tedp...@yahoo.com,
 webobjects-dev@lists.apple.com
 Date: Monday, March 28, 2011, 4:31 PM
 Or, I believe, an MS SQL Server DB
 with Date columns as locking attributes...
 
 Dave
 
 On Mar 28, 2011, at 2:26 PM, Chuck Hill wrote:
 
 If all the objects are in that list, then all
 have
 been changed.  You might have a floating
 point value
 that is getting altered due to a formatter (e.g.
 the scale
 is different).
 
 Chuck
 
 
 On Mar 28, 2011, at 11:16 AM, Theodore
 Petrosky
 wrote:
 
 OK I thought I did this before but I can
 not think
 of how I did it.
 
 I have an EC made with:  theEC =
 ERXEC.newEditingContext();
 
 I then get a list and use a displayGroup
 to
 display it in a table. I want to make a few edits,
 then ask
 the EC for the changed objects.
 
 NSLog.out.appendln(checkAltered
 ==+ theEC.updatedObjects());
 
 updatedOjbects returns all the objects in
 the
 array. I just

Re: changed objects

2011-03-29 Thread Theodore Petrosky
AjaxGrid looks interesting. I will read over the docs and the example on my 
train ride home.

thanks, you guys are great

Ted

--- On Tue, 3/29/11, Chuck Hill ch...@global-village.net wrote:

 From: Chuck Hill ch...@global-village.net
 Subject: Re: changed objects
 To: Theodore Petrosky tedp...@yahoo.com
 Cc: Development WebObjects webobjects-dev@lists.apple.com
 Date: Tuesday, March 29, 2011, 5:11 PM
 And if it does not need to  be
 persistent, then AjaxGrid already does all of this and
 more!  And making it persistent is probably not hard if
 you really need that.
 
 
 On Mar 29, 2011, at 2:09 PM, Mark Wardle wrote:
 
  Urrghh
  
  Why not keep an array of selected rows in your UI
 component and then
  use that to decide re: CSS
  
  Mark
  
  -- 
  Dr. Mark Wardle
  Specialist registrar, Neurology
  (Sent from my mobile)
  
  
  On 29 Mar 2011, at 17:09, Theodore Petrosky tedp...@yahoo.com
 wrote:
  
  okay, let me tell you what I want to accomplish.
  
  I have a table of 100 rows. I want the user to
 select an arbitrary group of rows and change the background
 color.
  
  So I thought I would add a boolean setter and
 getter to the entity:
  
  public void setIsSelectedForEdit(boolean
 _isSelectedForEdit) {
    NSLog.out.appendln(setIsSelectedForEdit
 in the object =  + _isSelectedForEdit);
    this._isSelectedForEdit =
 _isSelectedForEdit;
  }
  
  public boolean isSelectedForEdit() {
    return _isSelectedForEdit;
  }
  
  then if the users checks the checkbox in an
 arbitrary group I could know which are selected and update
 the CSS. (I also have an AjaxObserveField watching the
 checkBox and the whole thing is wrapped in an
 updateContainer)
  
  it works, sort of. the attribute
 _isSelectedForEdit is getting set but the Entity doesn't
 know it was changed. I don't care about saving this boolean
 value, I just need to know which rows to color (I will save
 THIS value).
  
  That's when I decided to try a 'Real' attribute.
  
  td
  wo:WOCheckBox checked =
 $theGridItem.globalUpdate id =
 $session.rowID/webobject name =
 SelectedForEditObserveField/
  /td
  
  globalUpdate is a real boolean attribute of my
 Grid object.
  
  if I bind this attribute to the checkBox, all the
 objects are marked as updated.
  
  so on a lark (or maybe it was a bluejay) I
 switched back to my original setter with a nod to the real
 attribute:
  
  public void setIsSelectedForEdit(boolean
 _isSelectedForEdit) {
    NSLog.out.appendln(setIsSelectedForEdit
 in the object =  + _isSelectedForEdit);
    this._isSelectedForEdit =
 _isSelectedForEdit;
  
    /* let the value be false
    * as I don't really care about
 this value
    */
  
    this.takeValueForKey(false,
 _Grid.GLOBAL_UPDATE);
  }
  
  This works as I want. the row get marked to
 update, the real value never changes (I can throw it away)
 and
  
  NSLog.out.appendln(checkAlteredAction
 ==    + theEC.updatedObjects());
  
  only lists the rows that are selected (checked) as
 altered.
  
  I don't want to say that there must be a better
 way. But if it works and doesn't blow up then it is good,
 right?
  
  There is just too much to learn for one lifetime.
  
  Ted
  
  
  
  
  
  --- On Tue, 3/29/11, Chuck Hill ch...@global-village.net
 wrote:
  
  From: Chuck Hill ch...@global-village.net
  Subject: Re: changed objects
  To: Theodore Petrosky tedp...@yahoo.com
  Cc: David Avendasora webobje...@avendasora.com,
 webobjects-dev@lists.apple.com
  Date: Tuesday, March 29, 2011, 11:23 AM
  
  On Mar 29, 2011, at 5:49 AM, Theodore Petrosky
 wrote:
  
  I find that i have a boolean that is bound
 to the
  'checked' of my WOCheckBox:
  
  wo:WOCheckBox checked =
 $theGridItem.globalUpdate /
  
  Originally I thought it was because I had
 an
  AjaxObserveField to watch the checkbox, so I
 deleted it. No
  Joy. so as long as the WOCheckBox is there, I
 have this
  issue. theEC.updatedObjects() believes that
 all the entities
  have been updated.
  
  The globalUpdate attribute is a boolean
 (intBoolean)
  in my postgresql backend.
  
  Am I screwing this up?
  
  Probably.  :-)  You could override
 the setter and
  log out the original and new value and see if
 that shows
  anything.  An object being in the updated
 list just
  indicates that it _may_ have changed. So
 either the value is
  getting changed, or WOCheckBox is needlessly
 setting the
  Boolean to the exact same value.
  
  
  Chuck
  
  
  --- On Mon, 3/28/11, David Avendasora
 webobje...@avendasora.com
  wrote:
  
  From: David Avendasora webobje...@avendasora.com
  Subject: Re: changed objects
  To: Chuck Hill ch...@global-village.net
  Cc: Theodore Petrosky tedp...@yahoo.com,
  webobjects-dev@lists.apple.com
  Date: Monday, March 28, 2011, 4:31 PM
  Or, I believe, an MS SQL Server DB
  with Date columns as locking
 attributes...
  
  Dave
  
  On Mar 28, 2011, at 2:26 PM, Chuck
 Hill wrote:
  
  If all the objects are in that
 list, then all
  have
  been changed.  You might have a
 floating
  point

Re: changed objects

2011-03-29 Thread Tim Worman
I've taken the route of having my EO superclass have an isSelected boolean that 
I can re-use for a purpose like this.

Tim Worman
UCLA GSEIS


On Mar 29, 2011, at 2:09 PM, Mark Wardle wrote:

 Urrghh
 
 Why not keep an array of selected rows in your UI component and then
 use that to decide re: CSS
 
 Mark
 
 -- 
 Dr. Mark Wardle
 Specialist registrar, Neurology
 (Sent from my mobile)
 
 
 On 29 Mar 2011, at 17:09, Theodore Petrosky tedp...@yahoo.com wrote:
 
 okay, let me tell you what I want to accomplish.
 
 I have a table of 100 rows. I want the user to select an arbitrary group of 
 rows and change the background color.
 
 So I thought I would add a boolean setter and getter to the entity:
 
 public void setIsSelectedForEdit(boolean _isSelectedForEdit) {
   NSLog.out.appendln(setIsSelectedForEdit in the object =  + 
 _isSelectedForEdit);
   this._isSelectedForEdit = _isSelectedForEdit;
 }
 
 public boolean isSelectedForEdit() {
   return _isSelectedForEdit;
 }
 
 then if the users checks the checkbox in an arbitrary group I could know 
 which are selected and update the CSS. (I also have an AjaxObserveField 
 watching the checkBox and the whole thing is wrapped in an updateContainer)
 
 it works, sort of. the attribute _isSelectedForEdit is getting set but the 
 Entity doesn't know it was changed. I don't care about saving this boolean 
 value, I just need to know which rows to color (I will save THIS value).
 
 That's when I decided to try a 'Real' attribute.
 
 td
 wo:WOCheckBox checked = $theGridItem.globalUpdate id = 
 $session.rowID/webobject name = SelectedForEditObserveField/
 /td
 
 globalUpdate is a real boolean attribute of my Grid object.
 
 if I bind this attribute to the checkBox, all the objects are marked as 
 updated.
 
 so on a lark (or maybe it was a bluejay) I switched back to my original 
 setter with a nod to the real attribute:
 
 public void setIsSelectedForEdit(boolean _isSelectedForEdit) {
   NSLog.out.appendln(setIsSelectedForEdit in the object =  + 
 _isSelectedForEdit);
   this._isSelectedForEdit = _isSelectedForEdit;
 
   /* let the value be false
   * as I don't really care about this value
   */
 
   this.takeValueForKey(false, _Grid.GLOBAL_UPDATE);
 }
 
 This works as I want. the row get marked to update, the real value never 
 changes (I can throw it away) and
 
 NSLog.out.appendln(checkAlteredAction ==+ theEC.updatedObjects());
 
 only lists the rows that are selected (checked) as altered.
 
 I don't want to say that there must be a better way. But if it works and 
 doesn't blow up then it is good, right?
 
 There is just too much to learn for one lifetime.
 
 Ted
 
 
 
 
 
 --- On Tue, 3/29/11, Chuck Hill ch...@global-village.net wrote:
 
 From: Chuck Hill ch...@global-village.net
 Subject: Re: changed objects
 To: Theodore Petrosky tedp...@yahoo.com
 Cc: David Avendasora webobje...@avendasora.com, 
 webobjects-dev@lists.apple.com
 Date: Tuesday, March 29, 2011, 11:23 AM
 
 On Mar 29, 2011, at 5:49 AM, Theodore Petrosky wrote:
 
 I find that i have a boolean that is bound to the
 'checked' of my WOCheckBox:
 
 wo:WOCheckBox checked = $theGridItem.globalUpdate /
 
 Originally I thought it was because I had an
 AjaxObserveField to watch the checkbox, so I deleted it. No
 Joy. so as long as the WOCheckBox is there, I have this
 issue. theEC.updatedObjects() believes that all the entities
 have been updated.
 
 The globalUpdate attribute is a boolean (intBoolean)
 in my postgresql backend.
 
 Am I screwing this up?
 
 Probably.  :-)  You could override the setter and
 log out the original and new value and see if that shows
 anything.  An object being in the updated list just
 indicates that it _may_ have changed. So either the value is
 getting changed, or WOCheckBox is needlessly setting the
 Boolean to the exact same value.
 
 
 Chuck
 
 
 --- On Mon, 3/28/11, David Avendasora webobje...@avendasora.com
 wrote:
 
 From: David Avendasora webobje...@avendasora.com
 Subject: Re: changed objects
 To: Chuck Hill ch...@global-village.net
 Cc: Theodore Petrosky tedp...@yahoo.com,
 webobjects-dev@lists.apple.com
 Date: Monday, March 28, 2011, 4:31 PM
 Or, I believe, an MS SQL Server DB
 with Date columns as locking attributes...
 
 Dave
 
 On Mar 28, 2011, at 2:26 PM, Chuck Hill wrote:
 
 If all the objects are in that list, then all
 have
 been changed.  You might have a floating
 point value
 that is getting altered due to a formatter (e.g.
 the scale
 is different).
 
 Chuck
 
 
 On Mar 28, 2011, at 11:16 AM, Theodore
 Petrosky
 wrote:
 
 OK I thought I did this before but I can
 not think
 of how I did it.
 
 I have an EC made with:  theEC =
 ERXEC.newEditingContext();
 
 I then get a list and use a displayGroup
 to
 display it in a table. I want to make a few edits,
 then ask
 the EC for the changed objects.
 
 NSLog.out.appendln(checkAltered
 ==+ theEC.updatedObjects());
 
 updatedOjbects returns all the objects in
 the
 array. I just want the ones that were

changed objects

2011-03-28 Thread Theodore Petrosky
OK I thought I did this before but I can not think of how I did it.

I have an EC made with:  theEC = ERXEC.newEditingContext();

I then get a list and use a displayGroup to display it in a table. I want to 
make a few edits, then ask the EC for the changed objects.

NSLog.out.appendln(checkAltered ==+ theEC.updatedObjects());

updatedOjbects returns all the objects in the array. I just want the ones that 
were altered. Is there a way?

Ted
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: changed objects

2011-03-28 Thread Pascal Robert

Le 2011-03-28 à 14:16, Theodore Petrosky a écrit :

 OK I thought I did this before but I can not think of how I did it.
 
 I have an EC made with:  theEC = ERXEC.newEditingContext();
 
 I then get a list and use a displayGroup to display it in a table. I want to 
 make a few edits, then ask the EC for the changed objects.
 
 NSLog.out.appendln(checkAltered ==+ theEC.updatedObjects());
 
 updatedOjbects returns all the objects in the array. I just want the ones 
 that were altered. Is there a way?

updateObjects should return only what changed, if you get everything, something 
in your code is touching each EOs.


--
Pascal Robert
prob...@macti.ca

AIM/iChat : MacTICanada
LinkedIn : http://www.linkedin.com/in/macti
Twitter : pascal_robert

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: changed objects

2011-03-28 Thread Chuck Hill
If all the objects are in that list, then all have been changed.  You might 
have a floating point value that is getting altered due to a formatter (e.g. 
the scale is different).

Chuck


On Mar 28, 2011, at 11:16 AM, Theodore Petrosky wrote:

 OK I thought I did this before but I can not think of how I did it.
 
 I have an EC made with:  theEC = ERXEC.newEditingContext();
 
 I then get a list and use a displayGroup to display it in a table. I want to 
 make a few edits, then ask the EC for the changed objects.
 
 NSLog.out.appendln(checkAltered ==+ theEC.updatedObjects());
 
 updatedOjbects returns all the objects in the array. I just want the ones 
 that were altered. Is there a way?
 
 Ted

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects









smime.p7s
Description: S/MIME cryptographic signature
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: changed objects

2011-03-28 Thread David Avendasora
Or, I believe, an MS SQL Server DB with Date columns as locking attributes...

Dave

On Mar 28, 2011, at 2:26 PM, Chuck Hill wrote:

 If all the objects are in that list, then all have been changed.  You might 
 have a floating point value that is getting altered due to a formatter (e.g. 
 the scale is different).
 
 Chuck
 
 
 On Mar 28, 2011, at 11:16 AM, Theodore Petrosky wrote:
 
 OK I thought I did this before but I can not think of how I did it.
 
 I have an EC made with:  theEC = ERXEC.newEditingContext();
 
 I then get a list and use a displayGroup to display it in a table. I want to 
 make a few edits, then ask the EC for the changed objects.
 
 NSLog.out.appendln(checkAltered ==+ theEC.updatedObjects());
 
 updatedOjbects returns all the objects in the array. I just want the ones 
 that were altered. Is there a way?
 
 Ted
 
 -- 
 Chuck Hill Senior Consultant / VP Development
 
 Practical WebObjects - for developers who want to increase their overall 
 knowledge of WebObjects or who are trying to solve specific problems.
 http://www.global-village.net/products/practical_webobjects
 
 
 
 
 
 
 
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com
 
 This email sent to webobje...@avendasora.com

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com