Re: something is changing a value behind my back
Re: something is changing a value behind my back
- Subject: Re: something is changing a value behind my back
- From: Peter Vandoros <email@hidden>
- Date: Fri, 06 Jul 2007 18:00:11 +1000
Hi Xavier,
If this is a component element then make sure you have a method
synchonizesBindingsWithVariables() that returns false. Otherwise, WO
will automatically synchronize your bindings with you variables.
Hope this helps.
Regards
Peter
WO Dev wrote:
Hi,
I'm using some int variables to manage the different part of a
component like:
public final static int search = 0;
private int status = search;
public final static int inAddWriteLive = 1;
public final static int inListWriteLive = 2;
but I've got some weird issue, like something is changing the value
behind my back. I've added:
NSLog.out.appendln(new RuntimeException("item called"));
in my setter method to track what's calling it.
So here's what I got when I'm calling the following method:
public WOComponent edit() {
setStatus(inAddWriteLive);
return context().page();
}
----------------------------------------
AWAKE
status: 2
[2007-07-06 09:42:35 CEST] <WorkerThread3> java.lang.RuntimeException:
item called
at WriteLiveComp.setStatus(WriteLiveComp.java:92)
at WriteLiveComp.edit(WriteLiveComp.java:162)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:54)
at
com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1160)
at
com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1268)
at
com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1539)
at
com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:498)
at
com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212)
at
com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1600)
at
com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:46)
at
com.webobjects.appserver._private.WOHyperlink.invokeAction(WOHyperlink.java:76)
at er.extensions.ERXHyperlink.invokeAction(ERXHyperlink.java:56)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
er.extensions.ERXWOConditional.invokeChildrenAction(ERXWOConditional.java:93)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
er.extensions.ERXWOConditional.invokeAction(ERXWOConditional.java:84)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com.webobjects.appserver._private.WOGenericContainer.invokeAction(WOGenericContainer.java:23)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
er.extensions.ERXWORepetition.invokeAction(ERXWORepetition.java:390)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
er.extensions.ERXWOConditional.invokeChildrenAction(ERXWOConditional.java:93)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
er.extensions.ERXWOConditional.invokeAction(ERXWOConditional.java:84)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
com.webobjects.appserver._private.WOComponentContent.invokeAction(WOComponentContent.java:31)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
com.webobjects.appserver._private.WOComponentContent.invokeAction(WOComponentContent.java:31)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
com.webobjects.appserver._private.WOComponentContent.invokeAction(WOComponentContent.java:31)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:945)
at
com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:104)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:945)
at
com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:104)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:945)
at
com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:104)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:945)
at
com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1168)
at
com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:1375)
at
er.extensions.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:74)
at er.extensions.ERXApplication.invokeAction(ERXApplication.java:992)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedPage(WOComponentRequestHandler.java:196)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedSession(WOComponentRequestHandler.java:287)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedApplication(WOComponentRequestHandler.java:322)
at
com.webobjects.appserver._private.WOComponentRequestHandler._handleRequest(WOComponentRequestHandler.java:358)
at
com.webobjects.appserver._private.WOComponentRequestHandler.handleRequest(WOComponentRequestHandler.java:432)
at
com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1306)
at
er.extensions.ERXApplication.dispatchRequest(ERXApplication.java:1041)
at
com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:173)
at
com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:254)
at java.lang.Thread.run(Thread.java:613)
[2007-07-06 09:42:35 CEST] <WorkerThread3> java.lang.RuntimeException:
item called
at WriteLiveComp.setStatus(WriteLiveComp.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
KeyValueCodingProtectedAccessor.setMethodValue(KeyValueCodingProtectedAccessor.java:65)
at
com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.setValueInObject(NSKeyValueCoding.java:1175)
at
com.webobjects.foundation.NSKeyValueCoding$_NumberMethodBinding.setValueInObject(NSKeyValueCoding.java:1205)
at
com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.takeValueForKey(NSKeyValueCoding.java:1293)
at
com.webobjects.appserver.WOComponent.takeValueForKey(WOComponent.java:1550)
at
com.webobjects.foundation.NSKeyValueCoding$Utility.takeValueForKey(NSKeyValueCoding.java:519)
at
com.webobjects.foundation.NSValidation$DefaultImplementation.validateTakeValueForKeyPath(NSValidation.java:733)
at
com.webobjects.appserver.WOComponent.validateTakeValueForKeyPath(WOComponent.java:1273)
at
com.webobjects.appserver._private.WOKeyValueAssociation.setValue(WOKeyValueAssociation.java:71)
at
com.webobjects.appserver.WOComponent._doPushValuesUp(WOComponent.java:569)
at
com.webobjects.appserver.WOComponent.pushValuesToParent(WOComponent.java:547)
at
com.webobjects.appserver._private.WOComponentReference._popComponentFromContext(WOComponentReference.java:91)
at
com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:105)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:945)
at
com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1168)
at
com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:1375)
at
er.extensions.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:74)
at er.extensions.ERXApplication.invokeAction(ERXApplication.java:992)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedPage(WOComponentRequestHandler.java:196)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedSession(WOComponentRequestHandler.java:287)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedApplication(WOComponentRequestHandler.java:322)
at
com.webobjects.appserver._private.WOComponentRequestHandler._handleRequest(WOComponentRequestHandler.java:358)
at
com.webobjects.appserver._private.WOComponentRequestHandler.handleRequest(WOComponentRequestHandler.java:432)
at
com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1306)
at
er.extensions.ERXApplication.dispatchRequest(ERXApplication.java:1041)
at
com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:173)
at
com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:254)
at java.lang.Thread.run(Thread.java:613)
APPEND
status: 2
----------------------------------------
All this is triggered, the first "part" is OK, my status is changed to
the correct one and I can see which line of the edit() method is
calling the setter...
But something triggers the setter again right after without any action
on my side, but it seems I can't see which method/line is calling the
setter again and changing its value.
Any clue on what's going on here?
Thanks
Xavier
PS: the AWAKE and APPEND is a log to print the status value in the
awake and appendToResponse methods.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Peter Vandoros
Software Engineer
Etech Group Pty Ltd
Level 3/21 Victoria St
Melbourne VIC 3000
Australia
Ph: +61 3 9639 9677
Fax: +61 3 9639 9577
----------------------------------
IMPORTANT: This e-mail message and any attachments are confidential and
may be privileged. If received in error, please reply to this message
and destroy all copies and any attachments. You should check this
message and any attachments for viruses or defects. Our liability is
limited to resupplying any affected message or attachments. For more
information about Etech Group, please visit us at
http://www.etechgroup.com.au.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden