Re: Sub-components woes
Re: Sub-components woes
- Subject: Re: Sub-components woes
- From: Pascal Robert <email@hidden>
- Date: Thu, 15 Nov 2012 07:16:19 -0500
Le 2012-11-14 à 21:16, Chuck Hill <email@hidden> a écrit :
> I have had this happen to me before, but I don't recall why. Logging out a stack trace (or setting a breakpoint if you are feeling modern) when setQtyForSynthManifestTransaction is called with a null value is the quickest way to solve this.
It's the exact same stack trace:
BuildManifest.setQtyForSynthManifestTransaction(Integer) line: 112
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
NSKeyValueCoding$ValueAccessor$1.setMethodValue(Object, Method, Object) line: 643
NSKeyValueCoding$_NumberMethodBinding(NSKeyValueCoding$_MethodBinding).setValueInObject(Object, Object) line: 1150
NSKeyValueCoding$_NumberMethodBinding.setValueInObject(Object, Object) line: 1183
NSKeyValueCoding$DefaultImplementation.takeValueForKey(Object, Object, String) line: 1354
BuildManifest(WOComponent).takeValueForKey(Object, String) line: 1748
NSKeyValueCoding$Utility.takeValueForKey(Object, Object, String) line: 469
NSValidation$DefaultImplementation.validateTakeValueForKeyPath(Object, Object, String) line: 679
BuildManifest(WOComponent).validateTakeValueForKeyPath(Object, String) line: 1424
WOHelperFunctionKeyValueAssociation(WOKeyValueAssociation).setValue(Object, WOComponent) line: 76
WOHelperFunctionKeyValueAssociation.setValue(Object, WOComponent) line: 21
ERXWOTextField.takeValuesFromRequest(WORequest, WOContext) line: 166
ERXWORepetition(WODynamicGroup).takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
ERXWORepetition(WODynamicGroup).takeValuesFromRequest(WORequest, WOContext) line: 93
ERXWORepetition.takeValuesFromRequest(WORequest, WOContext) line: 451
ERXWOConditional(WODynamicGroup).takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
ERXWOConditional.takeChildrenValuesFromRequest(WORequest, WOContext) line: 97
ERXWOConditional(WODynamicGroup).takeValuesFromRequest(WORequest, WOContext) line: 93
ERXWOConditional.takeValuesFromRequest(WORequest, WOContext) line: 91
ERXElse(WODynamicGroup).takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
ERXElse(WODynamicGroup).takeValuesFromRequest(WORequest, WOContext) line: 93
ERXElse.takeValuesFromRequest(WORequest, WOContext) line: 35
WODynamicGroup.takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
WODynamicGroup.takeValuesFromRequest(WORequest, WOContext) line: 93
BuildManifest(WOComponent).takeValuesFromRequest(WORequest, WOContext) line: 1051
BuildManifest(ERXComponent).takeValuesFromRequest(WORequest, WOContext) line: 143
BuildManifest(ERXNonSynchronizingComponent).takeValuesFromRequest(WORequest, WOContext) line: 51
WOComponentReference.takeValuesFromRequest(WORequest, WOContext) line: 119
ERXElse(WODynamicGroup).takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
ERXElse(WODynamicGroup).takeValuesFromRequest(WORequest, WOContext) line: 93
ERXElse.takeValuesFromRequest(WORequest, WOContext) line: 35
AjaxUpdateContainer(WODynamicGroup).takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
AjaxUpdateContainer(WODynamicGroup).takeValuesFromRequest(WORequest, WOContext) line: 93
AjaxUpdateContainer.takeValuesFromRequest(WORequest, WOContext) line: 63
ERXWORepetition(WODynamicGroup).takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
ERXWORepetition(WODynamicGroup).takeValuesFromRequest(WORequest, WOContext) line: 93
ERXWORepetition.takeValuesFromRequest(WORequest, WOContext) line: 451
WODynamicGroup.takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
WODynamicGroup.takeValuesFromRequest(WORequest, WOContext) line: 93
AvailableParts(WOComponent).takeValuesFromRequest(WORequest, WOContext) line: 1051
AvailableParts(ERXComponent).takeValuesFromRequest(WORequest, WOContext) line: 143
WOComponentReference.takeValuesFromRequest(WORequest, WOContext) line: 119
AjaxUpdateContainer(WODynamicGroup).takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
AjaxUpdateContainer(WODynamicGroup).takeValuesFromRequest(WORequest, WOContext) line: 93
AjaxUpdateContainer.takeValuesFromRequest(WORequest, WOContext) line: 63
ERXWOForm(WODynamicGroup).takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
ERXWOForm(WODynamicGroup).takeValuesFromRequest(WORequest, WOContext) line: 93
ERXWOForm.takeValuesFromRequest(WORequest, WOContext) line: 281
WODynamicGroup.takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
WODynamicGroup.takeValuesFromRequest(WORequest, WOContext) line: 93
WOComponentContent.takeValuesFromRequest(WORequest, WOContext) line: 26
ERXWOConditional(WODynamicGroup).takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
ERXWOConditional.takeChildrenValuesFromRequest(WORequest, WOContext) line: 97
ERXWOConditional(WODynamicGroup).takeValuesFromRequest(WORequest, WOContext) line: 93
ERXWOConditional.takeValuesFromRequest(WORequest, WOContext) line: 91
WODynamicGroup.takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
WODynamicGroup.takeValuesFromRequest(WORequest, WOContext) line: 93
PageWrapper(WOComponent).takeValuesFromRequest(WORequest, WOContext) line: 1051
PageWrapper(ERXComponent).takeValuesFromRequest(WORequest, WOContext) line: 143
WOComponentReference.takeValuesFromRequest(WORequest, WOContext) line: 119
WODynamicGroup.takeChildrenValuesFromRequest(WORequest, WOContext) line: 84
WODynamicGroup.takeValuesFromRequest(WORequest, WOContext) line: 93
PartBuilder(WOComponent).takeValuesFromRequest(WORequest, WOContext) line: 1051
PartBuilder(ERXComponent).takeValuesFromRequest(WORequest, WOContext) line: 143
Session(WOSession).takeValuesFromRequest(WORequest, WOContext) line: 1331
Session(ERXSession).takeValuesFromRequest(WORequest, WOContext) line: 554
Application(WOApplication).takeValuesFromRequest(WORequest, WOContext) line: 1724
Application(ERXAjaxApplication).takeValuesFromRequest(WORequest, WOContext) line: 95
AjaxRequestHandler(WOComponentRequestHandler)._dispatchWithPreparedPage(WOComponent, WOSession, WOContext, NSDictionary) line: 199
AjaxRequestHandler(WOComponentRequestHandler)._dispatchWithPreparedSession(WOSession, WOContext, NSDictionary) line: 298
AjaxRequestHandler(WOComponentRequestHandler)._dispatchWithPreparedApplication(WOApplication, WOContext, NSDictionary) line: 332
AjaxRequestHandler(WOComponentRequestHandler)._handleRequest(WORequest) line: 369
AjaxRequestHandler(WOComponentRequestHandler).handleRequest(WORequest) line: 442
AjaxRequestHandler.handleRequest(WORequest) line: 17
Application(WOApplication).dispatchRequest(WORequest) line: 1687
Application(ERXApplication).dispatchRequestImmediately(WORequest) line: 2139
Application(ERXApplication).dispatchRequest(WORequest) line: 2104
WOWorkerThread.runOnce() line: 144
WOWorkerThread.run() line: 226
Thread.run() line: 680
> Chuck
>
>
> On 2012-11-14, at 6:14 PM, email@hidden wrote:
>
>>
>>
>> Envoyé de mon iPhone
>>
>> Le 2012-11-14 à 21:00, "Chuck Hill" <email@hidden> a écrit :
>>
>>> Does BuildManifest have a reset() method.
>>
>> Yes, I reset the variables that holds the values from the bindings in reset() but I don't do anything for QtyForSynthManifestTransaction in reset()
>>
>>> What is the stack trace when setQtyForSynthManifestTransaction is called with a null value?
>>>
>>>
>>> On 2012-11-14, at 5:51 PM, Pascal Robert wrote:
>>>
>>>> I think I still have to understand a couple of things about components. So I have a component that display a table where each row is coming from a WORepetition. Inside each row, I have a column that calls a stateless sub-component:
>>>>
>>>> <td class="manifest_column">
>>>> <wo:BuildManifest selectedProject="$selectedProject" spec="$childSpec.spec" transactions="$~transactionsForSpec(childSpec.spec)" employee="$~employee" rootTransaction="$rootTransaction" />
>>>> </td>
>>>>
>>>> In BuildManifest, I have the following code:
>>>>
>>>> <wo:loop list="$spec.parts" item="$partItem">
>>>> <wo:if condition="$spec.isLotInventory">
>>>> <wo:str value="$partItem.serialNumber" />
>>>> </wo:if>
>>>> <wo:textfield value="$qtyForSynthManifestTransaction" size="4" numberformat="#" style="padding: 0px; margin: 0px;" />
>>>> <wo:if condition="$spec.isLotInventory">
>>>> <wo:AjaxSubmitButton updateContainerID="$spec.inventoryNumber" value="SM" action="$~createSyntheticTransactionFromPart(partItem)" /> <br />
>>>> </wo:if>
>>>> <wo:else>
>>>> <wo:AjaxSubmitButton updateContainerID="$spec.inventoryNumber" value="SM" action="$~createSyntheticTransactionFromSpec()" /> </wo:else>
>>>> </wo:loop>
>>>>
>>>> qtyForSynthManifestTransaction is a Integer, with a setter and a getter in BuildManifest.java. Now, if I submit the form, setQtyForSynthManifestTransaction is called with the value that I submitted, that's fine, but the setter is called a second time, and it sets the value to null, so when createSyntheticTransactionFromSpec or createSyntheticTransactionFromPart are finally called, the quantity is set to null!
>>>>
>>>> I have put a breakpoint on the awake method in BuildManifest, and awake() is called as many time as I have rows in my table. So for example, if I had 10 rows, BuildManifest is called 10 times. After the first awake, setQtyForSynthManifestTransaction is called to the correct value, after than awake() is called a couple of times and boum! setQtyForSynthManifestTransaction is called with a null value!
>>>>
>>>> So what's the trick?
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>> --
>>> 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/gvc/practical_webobjects
>>>
>>> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C!
>>> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>
> --
> 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/gvc/practical_webobjects
>
> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C!
> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
>
>
>
>
>
>
>
>
_______________________________________________
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