Updating Nested To-Many Relationship
Updating Nested To-Many Relationship
- Subject: Updating Nested To-Many Relationship
- From: David Avendasora <email@hidden>
- Date: Thu, 5 Apr 2007 13:32:13 -0500
Okay, now I'm having another issue with this wonderful form:
<WOForm>
aRouting
aRouting.routingDescription
aRouting.part
<routingSteps Repitition>
aRoutingStep.stepNumber
aRoutingStep.stepName
aRoutingStep.instructions
<rsComponent Repetition>
aRSComponent.lineNumber
aRSComponent.part
aRSComponent.quantity
</rsComponent Repetition>
</routingSteps Repitition>
<WOSubmitButton/>
</WOForm>
I want to allow the user to move a RSComponent from one RoutingStep
to another. I present the user with a WOPopUpButton on each
rsComponent of all the RoutingSteps and they can simply pick which
one they want it in. It does update everything properly, but when the
page comes back, layout-wise the RSComponent is still in the original
RoutingStep, but in the database it is in the new RoutingStep (right
where it's supposed to be).
Why would the update be done properly, but the page not be fully
updated with the changes?
Here's the method that the WOSubmitButton is bound to:
public WOComponent applyChangesToRequestedBillOfMaterial() {
requestedBillOfMaterial.setRoutingDescription
(requestedBillOfMaterial.part().partDescription() + " (" +
requestedBillOfMaterial.billOfMaterialType().typeName()+")");
return context().page();
}
And here are the methods that return the Arrays for the "list"
binding for each Repetition:
On the Routing class:
public NSArray routingStepsDefaultOrdering() {
NSMutableArray sortOrderings = new NSMutableArray();
EOSortOrdering sortByRoutingStepSequence = new EOSortOrdering
("routingStepSequence",EOSortOrdering.CompareAscending);
sortOrderings.addObject(sortByRoutingStepSequence);
return EOSortOrdering.sortedArrayUsingKeyOrderArray(routingSteps
().immutableClone(), sortOrderings);
On the RoutingStep class:
}
public NSArray rsComponentsDefaultOrdering() {
NSMutableArray sortOrderings = new NSMutableArray();
EOSortOrdering sortByLineNumber = new EOSortOrdering
("lineNumber",EOSortOrdering.CompareAscending);
sortOrderings.addObject(sortByLineNumber);
return EOSortOrdering.sortedArrayUsingKeyOrderArray(rsComponents
().immutableClone(), sortOrderings);
}
Now, just to be clear, these three methods are the direct result of
help of the list on my last two issues, so you all are at least as
responsible as me for any bugs here. :P
Dave
_______________________________________________
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